question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to run when node module folder contain dot

See original GitHub issue

I 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

  1. npm install threads
  2. pkg test.js
  3. 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:closed
  • Created 5 years ago
  • Comments:14

github_iconTop GitHub Comments

1reaction
Daniel-Oliviercommented, Mar 11, 2019

I’m afraid I can’t help you with that one. Hopefully someone else if familiar with it

1reaction
ronkorlandcommented, Mar 11, 2019

New error

  /Users/rkorland/git/runner-pkg/node_modules/is-function/browser-test.js
> Error! TypeError: alias.match is not a function
    at shortFromAlias (/usr/local/lib/node_modules/pkg/lib-es5/walker.js:70:18)
    at Walker._callee5$ (/usr/local/lib/node_modules/pkg/lib-es5/walker.js:891:25)
    at tryCatch (/usr/local/lib/node_modules/pkg/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/usr/local/lib/node_modules/pkg/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/pkg/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/usr/local/lib/node_modules/pkg/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /usr/local/lib/node_modules/pkg/node_modules/babel-runtime/helpers/asyncToGenerator.js:30:13
    at <anonymous>
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found