How do I solve an nexe compilation code 2 error? - node.js

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 npm#6.14.4
3 info using node#v13.8.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle robson-callcentre#0.1.0~prebuild: robson-callcentre#0.1.0
6 info lifecycle robson-callcentre#0.1.0~build: robson-callcentre#0.1.0
7 verbose lifecycle robson-callcentre#0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle robson-callcentre#0.1.0~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 robson-callcentre#0.1.0~build: CWD: /Users/darryllrobinson/Documents/projects/Source/fonebookeohcollections/server
10 silly lifecycle robson-callcentre#0.1.0~build: Args: [ '-c', 'nexe server.js --build' ]
11 silly lifecycle robson-callcentre#0.1.0~build: Returned: code: 1 signal: null
12 info lifecycle robson-callcentre#0.1.0~build: Failed to exec build script
13 verbose stack Error: robson-callcentre#0.1.0 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 robson-callcentre#0.1.0
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 robson-callcentre#0.1.0 build: `nexe server.js --build`
22 error Exit status 1
23 error Failed at the robson-callcentre#0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

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

Related

error when running npm run dev on laravel + inertia + linux

0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node',
'/usr/bin/npm', 'run', 'dev' ] 2 info using npm#6.14.4 3 info using
node#v10.19.0 4 verbose run-script [ 'predev', 'dev', 'postdev' ] 5
info lifecycle #~predev: # 6 info lifecycle #~dev: # 7 verbose
lifecycle #~dev: unsafe-perm in lifecycle true 8 verbose lifecycle
#~dev: PATH:
/usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/www/html/SostLaravel/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/mssql-tools18/bin
9 verbose lifecycle #~dev: CWD: /var/www/html/SostLaravel 10 silly
lifecycle #~dev: Args: [ '-c', 'npm run development' ] 11 silly
lifecycle #~dev: Returned: code: 1 signal: null 12 info lifecycle
#~dev: Failed to exec dev script 13 verbose stack Error: # dev: npm run development 13 verbose stack Exit status 1 13 verbose stack
at EventEmitter.
(/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16) 13 verbose
stack at EventEmitter.emit (events.js:198:13) 13 verbose stack
at ChildProcess.
(/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13
verbose stack at ChildProcess.emit (events.js:198:13) 13 verbose
stack at maybeClose (internal/child_process.js:982:16) 13 verbose
stack at Process.ChildProcess._handle.onexit
(internal/child_process.js:259:5) 14 verbose pkgid # 15 verbose cwd
/var/www/html/SostLaravel 16 verbose Linux 5.4.0-135-generic 17
verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "dev" 18 verbose
node v10.19.0 19 verbose npm v6.14.4 20 error code ELIFECYCLE 21
error errno 1 22 error # dev: npm run development 22 error Exit
status 1 23 error Failed at the # dev script. 23 error This is
probably not a problem with npm. There is likely additional logging
output above. 24 verbose exit [ 1, true ]
Good morning, I've already cleared the cache, I've reinstalled npm, I've deleted node-modules and package-lock, I've done everything but everything results in this same error.
Might be a good idea to check your node version and be sure its compatible with your packages.

Unable to start twilio project

I have a twilio flex plugin project. I normally start the project with npm start which is aliased to UNBUNDLED_REACT=true twilio flex:plugins:start within my package.json file. However, today when I run npm start, I'm getting the following error:
» Could not get credentials for profile "my_email#my_work.com".
» To reconfigure the profile, run: twilio profiles:create`
Also logged to the console is a message that gives me a path to a log file. Within that log file I see the following content:
`0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/usr/local/Cellar/node/14.11.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm#6.14.8
3 info using node#v14.11.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle twilio-flex-agent-dashboard#0.0.2~prestart: twilio-flex-agent-dashboard#0.0.2
6 info lifecycle twilio-flex-agent-dashboard#0.0.2~start: twilio-flex-agent-dashboard#0.0.2
7 verbose lifecycle twilio-flex-agent-dashboard#0.0.2~start: unsafe-perm in lifecycle true
8 verbose lifecycle twilio-flex-agent-dashboard#0.0.2~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/my_user/Desktop/twilio-flex-agent-dashboard/node_modules/.bin:/Users/my_user/kafka-stuff/bin:/usr/local/opt/postgresql#9.6/bin:/bin:/usr/bin:/usr/local/bin:/usr/sbin
9 verbose lifecycle twilio-flex-agent-dashboard#0.0.2~start: CWD: /Users/my_user/Desktop/twilio-flex-agent-dashboard
10 silly lifecycle twilio-flex-agent-dashboard#0.0.2~start: Args: [ '-c', 'UNBUNDLED_REACT=true twilio flex:plugins:start' ]
11 silly lifecycle twilio-flex-agent-dashboard#0.0.2~start: Returned: code: 1 signal: null
12 info lifecycle twilio-flex-agent-dashboard#0.0.2~start: Failed to exec start script
13 verbose stack Error: twilio-flex-agent-dashboard#0.0.2 start: `UNBUNDLED_REACT=true twilio flex:plugins:start`
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:314: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:314:20)
13 verbose stack at maybeClose (internal/child_process.js:1047:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid twilio-flex-agent-dashboard#0.0.2
15 verbose cwd /Users/my_user/Desktop/twilio-flex-agent-dashboard
16 verbose Darwin 20.5.0
17 verbose argv "/usr/local/Cellar/node/14.11.0/bin/node" "/usr/local/bin/npm" "start"
18 verbose node v14.11.0
19 verbose npm v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error twilio-flex-agent-dashboard#0.0.2 start: `UNBUNDLED_REACT=true twilio flex:plugins:start`
22 error Exit status 1
23 error Failed at the twilio-flex-agent-dashboard#0.0.2 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
When I do what the original error message is suggesting (ie running twilio profiles:create, I get a success message. However, I'm still unable to start the project.
So my question is, what has happened to my system where now I'm getting this error, and how do I fix it so I can start my project with npm start like I was doing previously?
Alright, issue has been resolved, My issue was that I was entering what I thought was the correct username when I ran twilio profiles:create, but really in fact, was the wrong username. Entering the correct username has resolved this issue.

Not able to run NPM Start after create-react-app

As I am learning the react for the first time I need to install the react-app but getting below error.
I have tried everything from the instructions in the error log and several other available solutions of StackOverflow but still not able to solve and getting the same error.
Here is the pic of below:
And here is the log:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Mr Rushil Dewaskar\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm#6.14.5
3 info using node#v12.17.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle jsfx#0.1.0~prestart: jsfx#0.1.0
6 info lifecycle jsfx#0.1.0~start: jsfx#0.1.0
7 verbose lifecycle jsfx#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle jsfx#0.1.0~start: PATH: C:\Users\Mr Rushil Dewaskar\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Mr Rushil Dewaskar\jsfx\node_modules\.bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\Wbem;C:\Python38\Scripts\;C:\Python38\;C:\Program Files (x86)\Common Files\ArcSoft\Bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Java\jdk-11.0.4;C:\Program Files (x86)\Brackets\command;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Users\Mr Rushil Dewaskar\AppData\Local\Programs\Python\Python38-32\Scripts\;C:\Users\Mr Rushil Dewaskar\AppData\Local\Programs\Python\Python38-32\;C:\Windows\System32\wbem\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\Wbem;C:\Python38\Scripts\;C:\Python38\;C:\Program Files (x86)\Common Files\ArcSoft\Bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Java\jdk-11.0.4;C:\Program Files (x86)\Brackets\command;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Users\Mr Rushil Dewaskar\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Mr Rushil Dewaskar\AppData\Roaming\npm;C:\Windows\System32\ variable;C:\Windows\System32\;
9 verbose lifecycle jsfx#0.1.0~start: CWD: C:\Users\Mr Rushil Dewaskar\jsfx
10 silly lifecycle jsfx#0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle jsfx#0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle jsfx#0.1.0~start: Failed to exec start script
13 verbose stack Error: jsfx#0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Mr Rushil Dewaskar\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Mr Rushil Dewaskar\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid jsfx#0.1.0
15 verbose cwd C:\Users\Mr Rushil Dewaskar\jsfx
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Mr Rushil Dewaskar\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.17.0
19 verbose npm v6.14.5
20 error code ELIFECYCLE
21 error errno 1
22 error jsfx#0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the jsfx#0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Please Help As soon as possible.
The solution to your problem is to remove the whitespaces in your username. In fact, the whitespaces anywhere in your path.
In your case, your username is Mr Rushil Dewasker. That's two whitespaces.
Change it to something without spaces and rebuild your project. It should work fine after that.
I had this problem once, myself.
Well the error itself shows some way to solve this issue. Have you tried that?

npm start givin error

I am building a project with react (Downloaded project using git) and have recently encountered the following error when running
npm start
The error is
enter code here
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm#5.4.2
3 info using node#v8.7.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle #~prestart: #
6 info lifecycle #~start: #
7 verbose lifecycle #~start: unsafe-perm in lifecycle true
8 verbose lifecycle #~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/ambuj/Documents/react-weather-app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/snap/bin
9 verbose lifecycle #~start: CWD: /home/ambuj/Documents/react-weather-app
10 silly lifecycle #~start: Args: [ '-c', 'concurrently "yarn serve:webpack" "yarn serve:json"' ]
11 silly lifecycle #~start: Returned: code: 1 signal: null
12 info lifecycle #~start: Failed to exec start script
13 verbose stack Error: # start: `concurrently "yarn serve:webpack" "yarn serve:json"`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack at emitTwo (events.js:125:13)
13 verbose stack at EventEmitter.emit (events.js:213:7)
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 emitTwo (events.js:125:13)
13 verbose stack at ChildProcess.emit (events.js:213:7)
13 verbose stack at maybeClose (internal/child_process.js:927:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid #
15 verbose cwd /home/ambuj/Documents/react-weather-app
16 verbose Linux 4.10.0-19-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
18 verbose node v8.7.0
19 verbose npm v5.4.2
20 error code ELIFECYCLE
21 error errno 1
22 error # start: `concurrently "yarn serve:webpack" "yarn serve:json"`
22 error Exit status 1
23 error Failed at the # start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
First install all the dependencies using npm install and then run npm start.
Try to remove the folder node_modules and reinstall them with npm install

NPM run-script init-cloudsql skipping user prompt

I'm just starting here so sorry in advance if this seems obvious,
I've been getting myself accustomed with the appengine back-end and am following Google's bookshelf example as a start.
Everything was going okay until I run the NPM run-script init-cloudsql command and for some reason after I enter the host IP of my db the cmd skips the user prompt and asks me for the password. Then it tried to launch the script with an anonymous user.
I'm following the instructions as described, I get no errors in the previous steps.
Below is the log of my run-script:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\barda\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run-script',
1 verbose cli 'init-cloudsql' ]
2 info using npm#3.5.0
3 info using node#v4.2.2
4 verbose run-script [ 'preinit-cloudsql', 'init-cloudsql', 'postinit-cloudsql' ]
5 info lifecycle nodejs-getting-started#1.0.0~preinit-cloudsql: nodejs-getting-started#1.0.0
6 silly lifecycle nodejs-getting-started#1.0.0~preinit-cloudsql: no script for preinit-cloudsql, continuing
7 info lifecycle nodejs-getting-started#1.0.0~init-cloudsql: nodejs-getting-started#1.0.0
8 verbose lifecycle nodejs-getting-started#1.0.0~init-cloudsql: unsafe-perm in lifecycle true
9 verbose lifecycle nodejs-getting-started#1.0.0~init-cloudsql: PATH: C:\Users\barda\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\nodejs-getting-started-2-structured-data\node_modules\.bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\apache-maven-3.3.9\bin\;C:\Users\barda\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin;C:\Users\barda\AppData\Roaming\npm;C:\Program Files\nodejs\
10 verbose lifecycle nodejs-getting-started#1.0.0~init-cloudsql: CWD: C:\nodejs-getting-started-2-structured-data
11 silly lifecycle nodejs-getting-started#1.0.0~init-cloudsql: Args: [ '/d /s /c', 'node books/model-cloudsql.js' ]
12 silly lifecycle nodejs-getting-started#1.0.0~init-cloudsql: Returned: code: 1 signal: null
13 info lifecycle nodejs-getting-started#1.0.0~init-cloudsql: Failed to exec init-cloudsql script
14 verbose stack Error: nodejs-getting-started#1.0.0 init-cloudsql: `node books/model-cloudsql.js`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (C:\Users\barda\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:232:16)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at EventEmitter.emit (events.js:172:7)
14 verbose stack at ChildProcess.<anonymous> (C:\Users\barda\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:24:14)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at ChildProcess.emit (events.js:172:7)
14 verbose stack at maybeClose (internal/child_process.js:818:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid nodejs-getting-started#1.0.0
16 verbose cwd C:\nodejs-getting-started-2-structured-data
17 error Windows_NT 10.0.10586
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\barda\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run-script" "init-cloudsql"
19 error node v4.2.2
20 error npm v3.5.0
21 error code ELIFECYCLE
22 error nodejs-getting-started#1.0.0 init-cloudsql: `node books/model-cloudsql.js`
22 error Exit status 1
23 error Failed at the nodejs-getting-started#1.0.0 init-cloudsql script 'node books/model-cloudsql.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the nodejs-getting-started package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error node books/model-cloudsql.js
23 error You can get their info via:
23 error npm owner ls nodejs-getting-started
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

Resources