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.

"Error: Cannot find module"

See original GitHub issue

Is this a BUG or a FEATURE REQUEST?:

What happened: Running

compile({
      name: 'myExe',
      input: 'dist/lib/index.exe.js',
      target: 'windows-x64-8.9.4',
      build: false,
      output: exePath,
      resources: [],
      loglevel: 'verbose',
    });

Compiles the executable fine, however when I run the executable I get a “Error: Cannot find module”.

I recently updated nexe from 2.0.0-rc.26 to the latest version (3.3.2) and tried the next version (4.0.0-beta.1) but it cannot find any modules included in node_modules

What you expected to happen:

I would expect the modules kept in node_modules to be found by my application code.

How to reproduce it (as minimally and precisely as possible):

compile({
      name: 'myExe',
      input: 'dist/lib/index.exe.js',
      target: 'windows-x64-8.9.4',
      build: false,
      output: exePath,
      resources: [],
      loglevel: 'verbose',
    });
  • Platform(OS/Version): Windows 10
  • Host Node Version: v8.14.0
  • Target Node Version: windows-x64-8.9.4
  • Nexe version: 3.3.2 and 4.0.0-beta.1
  • Python Version:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

2reactions
danawoodmancommented, Sep 20, 2019

If I do a nexe -t macos -n myapp bin/myapp.js right now it generates a binary but as soon as I move it to another directory it fails. If I use the pkg project it works as expected. What do I need to do to tell the build to be static and not expecting a particular file system path?

0reactions
danawoodmancommented, Oct 7, 2019

@calebboyd any suggestions as to why this is happening?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I resolve "Cannot find module" error using Node.js?
This happens when a first npm install has crashed for some reason (SIGINT of npm), or that the delay was too long, or...
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
How to Fix the "cannot find module" Error · delete the node modules folder by running rm -rf node_modules · delete package.lock.json file...
Read more >
How to resolve "Cannot find module" error in Node - Sabe.io
The Cannot find module error is a common error that usually happens when dependencies are not installed. Once you install your dependencies and ......
Read more >
Error: Cannot find module in JavaScript [SOLVED]
Error : Cannot find module 'package-name' is a popular module error message that you might face when working with Node and its packages...
Read more >
Fixing The "Cannot Find Module" Error In TypeScript
The first thing to fix the "cannot find module" error in TypeScript is to ensure that the package is installed on your system....
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