errors when doing an nw install with latest node.js

338 Views Asked by At

I have been using nw for a number of years. I recently updated node.js to 19.3.0 and am wanting to update nw in my projects. When I do the following: npm install [email protected] I get a number of deprecate messages and then a 404 error. After starting the command I do see the nodemodules folder being created, but it is later deleted. The first error appearing is this:

3602 verbose stack Error: command failed 3602 verbose stack at ChildProcess. (/Users/csrf/.nvm/versions/node/v19.3.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)

I am wondering whether I need to revert to an earlier version of node.js and nw?

2

There are 2 best solutions below

2
Jaredcheeda On

Cannot reproduce. I changed my Node version to 19.3.0. Made an empty folder and ran this in it:

echo > index.html && npm init -y && npm pkg set devDependencies.nw="0.72.0-sdk" && npm pkg set main="index.html" && npm pkg set scripts.start="nw ." && npm install && npm start

Worked without any issues. Other than the usual audit notice:

added 119 packages, and audited 120 packages in 1m

8 packages are looking for funding
  run `npm fund` for details

4 vulnerabilities (2 moderate, 2 high)

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

I'm assuming you just had a bad internet connect, or the server that hosts the NW.js binaries was being flaky (I've seen reports of this before). Just delete the node_modules and try again.

0
Richard Foss On

This command has enabled the installation of nw:

npm_config_nwjs_process_arch=x64 npm install [email protected] --verbose

Came from this issue report: https://github.com/nwjs/npm-installer/issues/83