fs.copyFileSync does not work for resources bundled in binaries
See original GitHub issueTo recreate
- Create a bundle and add a resource (e.g., ‘my-file’)
- In the binary, try to read and/or copy the resource to the external file system
What should happen
fs.readFileSync
and fs.copyFileSync
should both work.
What actually happens
Only fs.readFileSync
works.
Example
This works:
const myFile = path.join(__dirname, 'my-file')
const contents = fs.readFileSync(myFile)
This doesn’t work:
const myFile = path.join(__dirname, 'my-file')
fs.copyFileSync(myFile, someExternalDirectory)
Note: This issue follows on from #605
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
NodeJS, fs.copyFileSync not working and not throwing error
I'm using the nodeJS class fs for copying files from a folder to another, using a loop. The problem is that this function...
Read more >Nexe issue #607 appears to be fixed; refactor accordingly (#225 ...
Nexe issue fs.copyFileSync does not work for resources bundled in binaries appears to be fixed. We should confirm and refactor accordingly.
Read more >Node.js fs.copyFileSync() Function
The fs.copyFileSync() method is used to synchronously copy a file from the source path to destination path. Node.js will overwrite the file ...
Read more >Node.js v19.3.0 Documentation
Indicates the failure of an assertion. All errors thrown by the node:assert module will be instances of the AssertionError class. new assert.AssertionError( ...
Read more >Configure the create-react-app public URL post-build with ...
The frontend of that application is built with create-react-app which is ... that is bundled as a binary and each user should be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://github.com/nexe/nexe/releases/tag/v3.2.0
@paulocoghi, @calebboyd tested both these functions in production from current master branch, works fine as expected 👍