Questions tagged [fs-extra]

57 questions
14
votes
3 answers

Copy a source file to another destination in Nodejs

I'm trying to copy an image from a folder to another using fs-extra module . var fse = require('fs-extra'); function copyimage() { fse.copy('mainisp.jpg', './test', function (err) { if (err) return console.error(err) }); } This…
Rao Hammas
  • 819
  • 1
  • 9
  • 29
6
votes
0 answers

EACCES: permission denied with fs-extra only using nodemon

I am attempting to use the move method from the fs-extra npm module. It works for moving files and empty directories, but every time I try to move a non-empty directory while using nodemon, I get this error: [Error: EACCES: permission denied, rename…
Jacolack
  • 1,215
  • 2
  • 9
  • 23
6
votes
0 answers

how to use file system (fs) in angular 2

In my angular 2 application, need to use file system for uploading large files to Amazon S3 server. But, I have problem in importing file system in my application. Please help to implement file system in my application. My component.ts file import…
Manush
  • 1,468
  • 4
  • 19
  • 32
4
votes
4 answers

create-react-app error - Cannot find module 'fs-extra'

When I run create-react-app in the CLI I get the following error message back: $ create-react-app udacity-goals-todo internal/modules/cjs/loader.js:573 throw err; ^ Error: Cannot find module 'fs-extra' at…
Mike Bauer
  • 41
  • 1
  • 2
4
votes
1 answer

Can Fs-Extra delete only files in a directory?

Can I do delete all files in apples directory without deleting the directory itself? fs-extra API does not describe if it is possible. fsExtra.remove 'apples/*', -> if !err # Do stuff
Steve K
  • 12,452
  • 10
  • 74
  • 126
3
votes
1 answer

'fs-extra' symlink not permitted when running as administrator and with the policy added, running mklink myself works?

I'm trying to use this plugin together with serverless to bundle my dependencies using symlinks. Under the hood it uses fs.symlink from fs-extra as follows: async function link (target, f) { await fs.ensureDir(path.dirname(f)) await…
SebastianG
  • 5,763
  • 2
  • 24
  • 61
3
votes
4 answers

fs-extra: source and destination must not be the same. (cordova)

I get an error while building with cordova. Error: Source and destination must not be the same. Build-System: Ionic: ionic (cli): 4.10.1 ionic framework: ionic-angular 3.9.2 @ionic/app-scripts: 3.1.11 Cordova: cordova (cli): …
Dominik
  • 2,191
  • 12
  • 26
3
votes
1 answer

Creating Directories using NPM Module fs-extra

I need some help. I need to be able to create a directory structure which looks like the following: parent child1 folder1 folder2 child2 folder1 folder2 I'm currently using fs-extra (npm module). My issue is that the folder…
sudodashell
  • 93
  • 2
  • 11
3
votes
2 answers

Angular JS console logs correct but no output

I have an electron app that is suppose to walk a directory and list the contents of the dir into side bar nav I am using this library to walk the dir. I get the correct console output as shown below but I guess I am doing something wrong that I can…
0xtvarun
  • 688
  • 6
  • 18
2
votes
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
  • 225
  • 13
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,884
  • 24
  • 84
  • 163
2
votes
3 answers

Getting empty string from fs.readFile inside chokidar.watch(path_file).on('change', ...)

I have the following very simple Node project: https://github.com/tlg-265/chokidar-issue $ git clone https://github.com/tlg-265/chokidar-issue $ cd chokidar-issue $ npm i $ npm run watch-changes which basically takes care of detecting changes on…
Viewsonic
  • 482
  • 4
  • 20
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,278
  • 10
  • 26
2
votes
1 answer

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
  • 97
  • 1
  • 8
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
  • 321
  • 1
  • 3
  • 14
1
2 3 4