Questions tagged [fs-extra]
73 questions
2
votes
2 answers
copying files using `ncp` throws: no such file or directory, mkdir
I'm using ncp to copy files as following:
import ncp from "ncp";
import { promisify } from "util";
const ncpPromise = promisify(ncp);
const copyAssets = async (exportFolderName, includeSourceMaps) => {
const assets = glob.sync("**/", { cwd:…

Renaud is Not Bill Gates
- 1,684
- 34
- 105
- 191
2
votes
1 answer
react-scripts build works local but fails in CodeBuild
I am using CodeBuild to deploy a react website to S3. When I run npm run build locally, it works perfectly. However, when it hits CodeBuild it fails with the following error:
[Container] 2021/01/26 00:29:23 Running command npm run build
>…

doriansm
- 247
- 1
- 5
- 31
2
votes
0 answers
Is there a way to get the progress for move and delete operation in nodeJS?
Currently, I am using fs.move and fs.remove (from fs-extra package) to move and delete file via nodeJS on Ubuntu 18.04, I want to monitor the progress of these operation. For copy, I can use progress-stream to measure the progress for copy or file…

Shashank Shekhar
- 105
- 1
- 14
2
votes
3 answers
Rename files asynchronously in Node.js if destination files don't exist
I am trying to rename files asynchronously in Node.js only if destination files don't exist.
I made a quick test like follows:
const fs = require('fs')
const files = [ 'file1', 'file2', 'file3' ]
const new_name = 'new-name' // same destination name…

Systems Rebooter
- 1,281
- 2
- 14
- 30
2
votes
1 answer
fs.writeFileSync TypeError: lazyErrmapGet is not a function or its return value is not iterable
fs.writeFileSync TypeError: lazyErrmapGet is not a function or its
return value is not iterable
I faced this issue while using fs.writeFileSync from fs-extra as following inside one of my gulp task :
fs.writeFileSync(
…

Rahul Bhooteshwar
- 1,675
- 17
- 31
2
votes
2 answers
Multiple files move into another directory in NodeJS
I want to move multiple files from source directory to destination directory.
I tried with multiple package but its moving the folder itself. but i would like to move one the files contain in the source directory into destination…

Jay
- 187
- 2
- 13
2
votes
0 answers
Syncronize files using fs-extra and Chokidar node.js
I am new to node.js in general and trying to monitor a file directory using chokidar below code is working fine but now what I want to achieve is when the file is or directory has changed a function will run and copy the files into a folder.
I am…

Sarotobi
- 707
- 1
- 9
- 28
2
votes
1 answer
Data from one async execution of a function being mixed with another execution of the function
I have been writing a web scraping API built on top of NodeJS, using Cheerio, node-fetch and fs-extra. In the following piece of code, I call the getReport method, for each string in the config.supportedMountains array. For each of the items, I want…

Pegladon
- 503
- 1
- 3
- 12
1
vote
0 answers
fs.mkdir not creating directory nor giving error
The following code does not create a new directory, nor does it output any err
const fs = require("fs-extra");
fs.mkdir(dirPath, { recursive: true }, (err) => {
if (err) {
console.log("ERR: When attempting to mkdir", err);
} else {
…

lowcrawler
- 6,777
- 9
- 37
- 79
1
vote
1 answer
changing code from fs to fs-extra using node js
I wrote a code by using var fs= require("fs").promises;
to read all my files in directories and sub-directories
var fs= require("fs").promises;
async function checkFileLoc(folderPath, depth) {
depth -= 1;
let files = await…

Aakash
- 139
- 1
- 3
- 22
1
vote
0 answers
convert fs code to fs-extra using node js
i have code which used to read directory recursive and with given depth but i have wrote this code
by using var fs= require("fs");
so my code look like this
async function checkFileLoc(folderPath, depth) {
depth -= 1;
let files = await…

Vishal
- 17
- 2
1
vote
2 answers
How to check if a file exist in nuxt
I'm on Nuxt 2.15.4 and i wanna check in my store codes if a file exist in nuxt directory by fs-extra package.
it is simple in modules because i can get files path by this code:
const path = require('path')
const fse = require('fs-extra');
const…

Mojtaba Barari
- 1,127
- 1
- 15
- 49
1
vote
1 answer
fs-extra readFile is not a function
I'm trying to generate pdf with puppeteer and I'm having an issue when I need to bring the handlebars file along.
In the tutorial the guy was using fs-extra npm package so that is the one I installed,
const html = await fs.readFile(filePath,…

Double Bang
- 184
- 15
1
vote
0 answers
nodejs -- Force move a Busy Directory
How do I move/delete/rename a busy Directory with node.js?
Currently I'm using fs-extra package to move and replace a directory.
fse.move(src, dest, { overwrite: true }, err => {
if (err) return console.error(err)
console.log('moved')
…

Faid
- 554
- 1
- 5
- 18
1
vote
3 answers
Cannot find module 'fs-extra' error when launching tests despite the module is present in cypress
Just encountered the issue. After launching my tests this error appears in the cypress context window.
Can't start server
The plugins file is missing or invalid.
Your pluginsFile is set to…

Alexander Tunick
- 517
- 1
- 6
- 20