How do I solve an nexe compilation code 2 error?

918 Views Asked by At

I am trying to compile my node server using nexe (3.3.2) but it keeps failing. When I first tried, it said I needed to use the --build flag which I included in my script. The process kicked off again, compiled for over two hours and then failed.

I upgraded my node and npm versions using Homebrew, it didn't work. I thought it might be the size of the folders I've included but even if I just include my server.js, it fails.

Does anyone have any ideas for me please? Below is a copy of the latest log file.

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/usr/local/lib/node_modules/node/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/darryllrobinson/Documents/projects/Source/fonebookeohcollections/server/node_modules/.bin:/usr/local/opt/openssl/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin
9 verbose lifecycle [email protected]~build: CWD: /Users/darryllrobinson/Documents/projects/Source/fonebookeohcollections/server
10 silly lifecycle [email protected]~build: Args: [ '-c', 'nexe server.js --build' ]
11 silly lifecycle [email protected]~build: Returned: code: 1  signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
13 verbose stack Error: [email protected] build: `nexe server.js --build`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:321:20)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:321:20)
13 verbose stack     at maybeClose (internal/child_process.js:1026:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/darryllrobinson/Documents/projects/Source/fonebookeohcollections/server
16 verbose Darwin 19.4.0
17 verbose argv "/usr/local/lib/node_modules/node/bin/node" "/usr/local/bin/npm" "run" "build"
18 verbose node v13.8.0
19 verbose npm  v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: `nexe server.js --build`
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

1

There are 1 best solutions below

0
On BEST ANSWER

I wasn't able to resolve the problem so I used pkg instead.