nexe: Nexe does not automatically bundle dependencies

Is this a BUG or a FEATURE REQUEST?:

Bug 🐛 🪲 🐝

What happened:

The produced binaries fail to run unless the entirety of node_modules/ is bundled with them. If node_modules/ is moved or removed, the binary complains that it cannot find necessary modules.

$ npm i
$ npx nexe -i ./bin/agent -t static-x64-10.15.0 -o build/agent -r lib/
$ rm -rf node_modules/
$ ./build/agent --help
Error: Cannot find module 'yargs'

The workaround, to specify -r node_modules/ doubles the size of the resulting executables, creating 100MB binaries from 29KB of source code.

What you expected to happen:

I expect Nexe to resolve require calls during compilation, and not to fail for want of dependencies after the fact.

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

See the above code sample.

Anything else we need to know?:

Environment

  • Platform(OS/Version): Ubuntu 18.04
  • Host Node Version: v10.7.0
  • Target Node Version: v10.15.0
  • Nexe version: v3.3.1
  • Python Version: 2.7.15+ / 3.7.0

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 17 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I hesitate to link the project’s dependencies but I will say yargs is in there:

$ cat package.json | jq .dependencies.yargs
"^12.0.5"