question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with npm install when we have multiple versions of node in nodist

See original GitHub issue

So i get this when i try to run npm install of modules in package.json.

D:\work\masterproject\client\project>nodist

  (x64)
> 0.12.7  (global: 0.12.7)
  5.11.1


D:\work\masterproject\client\project>nodist npm
> 2.11.3  (global: match)
  3.8.6

D:\work\masterproject\client\project>npm i
npm WARN package.json ionic-project@1.1.0 No repository field.
npm WARN package.json ionic-project@1.1.0 No license field.
/


> node-sass@0.9.6 install D:\work\masterproject\client\project\node_modules\gulp-sas
s\node_modules\node-sass
> node build.js

(node) child_process: options.customFds option is deprecated. Use options.stdio
instead.

D:\work\masterproject\client\project\node_modules\gulp-sass\node_modules\node-sass>i
f not defined npm_config_node_gyp (node "C:\Program Files (x86)\Nodist\npmv\2.11
.3\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  els
e (node  rebuild )
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 404 status code downloading 32-bit node.lib
gyp ERR! stack     at Request.<anonymous> (C:\Program Files (x86)\Nodist\npmv\2.
11.3\node_modules\node-gyp\lib\install.js:377:20)
gyp ERR! stack     at emitOne (events.js:95:20)
gyp ERR! stack     at Request.emit (events.js:182:7)
gyp ERR! stack     at Request.onRequestResponse (C:\Program Files (x86)\Nodist\n
pmv\2.11.3\node_modules\request\request.js:1142:10)
gyp ERR! stack     at emitOne (events.js:90:13)
gyp ERR! stack     at ClientRequest.emit (events.js:182:7)
gyp ERR! stack     at HTTPParser.parserOnIncomingClient (_http_client.js:469:21)

gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:103:23
)
gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:359:20)
gyp ERR! stack     at emitOne (events.js:90:13)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files (x86)\\Nodist\\v-x64\\5.11.1\\node.exe" "C:\
\Program Files (x86)\\Nodist\\npmv\\2.11.3\\node_modules\\node-gyp\\bin\\node-gy
p.js" "rebuild"
gyp ERR! cwd D:\work\masterproject\client\project\node_modules\gulp-sass\node_module
s\node-sass
gyp ERR! node -v v5.11.1
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
Build failed
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\Nodist/v-x64/0.12.7/node.exe" "C:\\Progr
am Files (x86)\\Nodist\\npmv\\2.11.3\\bin\\npm-cli.js" "i"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE

npm ERR! node-sass@0.9.6 install: `node build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@0.9.6 install script 'node build.js'.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node build.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\work\masterproject\client\project\npm-debug.log

D:\work\masterproject\client\project>

I think it uses the newer version of node because when i remove the new version of node from nodist and leave only the wanted version the npm install works.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

2reactions
marcelklehrcommented, Aug 5, 2016

I can reproduce the problem. Running nodist in debug mode, it transpires, the error is not strictly on nodist’s side:

17:54:51.783 1ms    1ms    nodist:shim - getTargetEngine: ReadFile C:\Users\Marcel Klehr\Desktop\test\node_modules\node-sass\package.json
17:54:51.831 26ms   26ms   nodist:shim - parsePackageJSON: {Engines:{Npm: Node:>=0.10.0}}
17:54:51.835 0ns    0ns    nodist:shim - Target engine found:'>=0.10.0'
17:54:51.836 61ms   61ms   nodist:shim-node - Current version spec: >=0.10.0
17:54:51.844 7ms    7ms    nodist:shim - checking 6.3.0 against >=0.10.0
17:54:51.846 2ms    2ms    nodist:shim-node - found matching version: 6.3.0

This means: node-sass specifies that it’s able to run on any node version greater than v0.10.0, and nodist consequently uses the latest installed version that matches this criteria, which in this case is 6.x.

This is certainly not optimal.

I tend to think it would make sense to lock the node version for all child processes of a running node instance. So, in this case all child processes would run with 0.12.7, which was the first decision. However, this could cause problems when you really do want to involve nodist’s version chooser, e.g. when executing some shell command in your node script. So, the more conservative choice would be to just lock the node version for all descendant node instances of npm.

0reactions
taddeusb90commented, Aug 8, 2016

Thanks @marcelklehr

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem with npm install when we have multiple versions of ...
So i get this when i try to run npm install of modules in package.json. D:\work\masterproject\client\project>nodist (x64) > 0.12.7 (global: ...
Read more >
Nodist: Running multiple version of NodeJS on Windows
Now whenever you issue Node & NPM commands in that directory, it will use the version specified instead of the global version. Setting...
Read more >
Sorry, there's a problem with nodist. When trying to initilise a ...
In this case you need to install that version by nodist local XXX where XXX is the version of the node in .node-version...
Read more >
Install multiple node js version in windows | by Saleem Malik
Firstly, we need to install nodist for Windows which is the tool that will enable us to switch between different versions of Node.js....
Read more >
How To Manage Multiple NodeJs Versions? - srinivasankk.com
<WID>: nodist npm latest/match will install the required npm version against the node version. Since I am a windows user, so here I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found