javascriptnode.jsnode-webkitnvmnvm-windows

nvm-windows Node.js version change in NW.js


I am using nvm-windows and I've two different node.js versions installed. I am also working with nw.js but after having some problem with async/await I checked the node.js installation in use running:

    nvm ls

I get:

  * 14.6.0 (Currently using 64-bit executable)
    5.11.0

But when I console.log the node.js version inside the nw.js app I get:

console.log(process.version);
console.log(process.versions['nw']);
console.log(process.versions['chromium']);

v5.12.0
0.14.7
50.0.2661.102

So I am clearly missing something! Is there a way I can specify to nw.js the node.js version to use?

my package.json dependencies:

  "dependencies": {
    "@fortawesome/fontawesome-free": "^5.15.0",
    "bootstrap": "^4.5.2",
    "jquery": "^3.5.1",
    "popper.js": "^1.16.1"
  },
  "devDependencies": {
    "nw": "^0.48.3-sdk",
    "nwjs-builder-phoenix": "^1.15.0"
  }

Also inside package.json:

  "scripts": {
    "dist": "build --tasks win-x86,win-x64,linux-x86,linux-x64,mac-x64 --mirror https://dl.nwjs.io/ .",
    "start": "run --x86 --mirror https://dl.nwjs.io/ ."
  },

as suggested here because I am using nwjs-builder-phoenix


Solution

  • To solve the problem use nw u [version] like:

    nw u 0.48.3
    

    Then add this snippet to the package.json:

    "build": {
      "nwVersion": "0.48.3"
    },
    

    It is needed by nwjs-builder-phoenix to chose the nw version to use.

    And run npm start again

    [ Also helpful ]

    To install a new nw version run nw i [version]