nwutils / nw-sample-apps

Sample Apps
MIT License
1.95k stars 551 forks source link

nw install fails on Debian 10 #43

Open sid-the-sloth opened 4 years ago

sid-the-sloth commented 4 years ago

Trying to install nw as per readme.md under: https://github.com/zcbenz/nw-sample-apps

nw installation fails - can't figure out the failure reason even after reading the error log.

Please help.

On Debian 10, running with sudo for system-wide installation:

$ sudo npm install -g nw

The last part of the error log:

3564 silly postinstall nw@0.44.1
3565 info lifecycle nw@0.44.1~postinstall: nw@0.44.1
3566 verbose lifecycle nw@0.44.1~postinstall: unsafe-perm in lifecycle false
3567 verbose lifecycle nw@0.44.1~postinstall: PATH: /opt/nodejs/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/opt/nodejs/lib/node_modules/nw/node_modules/.bin:/opt/nodejs/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
3568 verbose lifecycle nw@0.44.1~postinstall: CWD: /opt/nodejs/lib/node_modules/nw
3569 silly lifecycle nw@0.44.1~postinstall: Args: [ '-c', 'node scripts/install.js' ]
3570 silly lifecycle nw@0.44.1~postinstall: Returned: code: 1  signal: null
3571 info lifecycle nw@0.44.1~postinstall: Failed to exec postinstall script
3572 timing action:postinstall Completed in 16579ms
3573 verbose unlock done using /root/.npm/_locks/staging-64689f1deb8f5141.lock for /opt/nodejs/lib/node_modules/.staging
3574 timing stage:rollbackFailedOptional Completed in 121ms
3575 timing stage:runTopLevelLifecycles Completed in 24181ms
3576 verbose stack Error: nw@0.44.1 postinstall: `node scripts/install.js`
3576 verbose stack Exit status 1
3576 verbose stack     at EventEmitter.<anonymous> (/opt/nodejs/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
3576 verbose stack     at EventEmitter.emit (events.js:182:13)
3576 verbose stack     at ChildProcess.<anonymous> (/opt/nodejs/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
3576 verbose stack     at ChildProcess.emit (events.js:182:13)
3576 verbose stack     at maybeClose (internal/child_process.js:962:16)
3576 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
3577 verbose pkgid nw@0.44.1
3578 verbose cwd /home/<user>/foo/bar
3579 verbose Linux 4.19.0-6-amd64
3580 verbose argv "/opt/nodejs/bin/node" "/usr/bin/npm" "install" "-g" "nw"
3581 verbose node v10.15.0
3582 verbose npm  v6.13.7
3583 error code ELIFECYCLE
3584 error errno 1
3585 error nw@0.44.1 postinstall: `node scripts/install.js`
3585 error Exit status 1
3586 error Failed at the nw@0.44.1 postinstall script.
3586 error This is probably not a problem with npm. There is likely additional logging output above.
3587 verbose exit [ 1, true ]

Many thanks!

sid-the-sloth commented 4 years ago

Solved:

The correct way to install system-wide on GNU/Linux, from root account:

# npm install --unsafe-perm=true -g nw

or, from user account:

$ sudo npm install --unsafe-perm=true -g nw

Perhaps the readme.md at https://github.com/zcbenz/nw-sample-apps can be updated to reflect that. Thank you!