"Error: Cannot find module"
See original GitHub issueIs 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:
- Created 4 years ago
- Reactions:2
- Comments:5
Top 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 >
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
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?@calebboyd any suggestions as to why this is happening?