nodist icon indicating copy to clipboard operation
nodist copied to clipboard

Explicitly specified interpreter is lost when running "npm\bin\npm-cli.js"

Open segrey opened this issue 8 years ago • 4 comments

  1. Have PATH containing several node installations (C:\Program Files\nodejs and C:\Program Files\Nodist)
  2. Run C:\Program Files\Nodist\bin\node C:\Program Files\Nodist\npm\bin\npm-cli.js
  3. Underlying npm process is running with C:\Program Files\nodejs\node.exe, not one from Nodist.

Yeah, I know that "Nodist was designed to replace any existing node.js installation, so if node is already installed on your machine, uninstall it first.". However, seems it plays with other node installations nicely in other cases. Would be great to make it friendly here too. BTW, thanks for the tool!

segrey avatar Aug 16 '17 15:08 segrey

Why are you not running npm.exe?

marcelklehr avatar Aug 17 '17 20:08 marcelklehr

try set DEBUG=nodist:shim-node

marcelklehr avatar Aug 17 '17 20:08 marcelklehr

Put nodist earlier in your PATH than regular node processes, restart any shells, and it'll use nodist instead of node. Better still, uninstall node. :D

robrich avatar Aug 18 '17 01:08 robrich

Why are you not running npm.exe?

I'm using WebStorm and it runs npm commands with explicitly specified interpreter, e.g. C:\Program Files\Nodist\bin\node.exe C:\Program Files\Nodist\npm\bin\npm-cli.js info karma

Looks like it's caused by running Nodist\bin\npm.exe in Nodist\npm\bin\npm-cli.js: current interpreter running npm-cli.js is lost and npm.exe will use interpreter from PATH. It's in compliance with output of set DEBUG=nodist:shim-node: there is only one log entry with Going to execute the following binary (when npm-cli.js is starting execution).

Put nodist earlier in your PATH than regular node processes, restart any shells, and it'll use nodist instead of node.

That works, thanks. However, it requires manual PATH configuration. Feel free to close this issue if nodist is not designed to live with other existing node.js installations as stated in the description.

segrey avatar Aug 18 '17 13:08 segrey