Failed to run when node module folder contain dot
See original GitHub issueI created a sample application with threads
package.
test.js
const spawn = require('threads').spawn;
const thread = spawn(function(input, done) {
done({ string : input.string, integer : parseInt(input.string) });
});
thread
.send({ string : '123' })
.on('message', function(response) {
console.log('123 * 2 = ', response.integer * 2);
thread.kill();
})
.on('error', function(error) {
console.error('Worker errored:', error);
})
.on('exit', function() {
console.log('Worker has been terminated.');
});
How to reproduce
npm install threads
pkg test.js
- Run pkg binary file
ERROR
module.js:547
throw err;
^
Error: Cannot find module '/snapshot/threads-pkg/node_modules/threads/lib/worker.node/slave.js'
at Function.Module._resolveFilename (module.js:545:15)
at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1280:46)
at Function.Module._load (module.js:472:25)
at Function.Module.runMain (pkg/prelude/bootstrap.js:1309:12)
at startup (bootstrap_node.js:227:16)
at bootstrap_node.js:648:3
Worker has been terminated.
Issue Analytics
- State:
- Created 5 years ago
- Comments:14
Top Results From Across the Web
Failed to run when node module folder contain dot · Issue #640
I created a sample application with threads package. test.js const spawn = require('threads').spawn; const thread = spawn(function(input, ...
Read more >After removing node_modules folder and later running npm ...
The problem looks like a mis-match of versions, although I couldn't reproduce the same error message.
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
To fix the error, you need to install the package that is absent in your project directory – npm install package-name or yarn...
Read more >Cannot find module 'dotenv' error in Node.js | bobbyhadz
To solve the error "Cannot find module 'dotenv'", make sure to install the dotenv package by opening your terminal in your project's root...
Read more >Rename operation not permitted - POSTGRAVITYART
Installation of JavaScript dependencies via `npm` or `yarn` fails with `EPERM: operation not permitted` if the terminal does not have permission for the...
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
I’m afraid I can’t help you with that one. Hopefully someone else if familiar with it
New error