Current Behavior:
The flag --scripts-prepend-node-path, which is supposed to add the calling node executable to the PATH variable, doesn't seem to work. The directory isn't added.
Expected Behavior:
The directory of the calling node executable should be added to PATH.
Steps To Reproduce:
- Download NodeJS and npm via nvm (in my case
14.15.5 and 7.6.0 respectively)
- Create some skeleton with a
package.json (in my case npm init nx-workspace)
- Call
node and npm in isolation to any shell environment:
env -i bash --noprofile --norc -c '/path/to/.nvm/versions/node/v14.15.5/bin/node /path/to/.nvm/versions/node/v14.15.5/lib/node_modules/npm/bin/npm-cli.js --scripts-prepend-node-path run nx'
(note: in order to fix sh: nx: command not found I've prepended the node call with PATH=$PATH:/path/to/.nvm/versions/node/v14.15.5/lib/node_modules/nx/bin)
Expected Behavior:
The help message of nx
Current Behavior:
env: node: No such file or directory
If you add a script with env or echo $PATH to the package.json you can see that PATH doesn't contain the directory to the calling node executable, so I assume it's not a bug of nx.
Environment:
- macOS 11.1
- NodeJS 14.15.5
- npm 7.6.0
Current Behavior:
The flag
--scripts-prepend-node-path, which is supposed to add the callingnodeexecutable to thePATHvariable, doesn't seem to work. The directory isn't added.Expected Behavior:
The directory of the calling
nodeexecutable should be added toPATH.Steps To Reproduce:
14.15.5and7.6.0respectively)package.json(in my casenpm init nx-workspace)nodeandnpmin isolation to any shell environment:env -i bash --noprofile --norc -c '/path/to/.nvm/versions/node/v14.15.5/bin/node /path/to/.nvm/versions/node/v14.15.5/lib/node_modules/npm/bin/npm-cli.js --scripts-prepend-node-path run nx'sh: nx: command not foundI've prepended the node call withPATH=$PATH:/path/to/.nvm/versions/node/v14.15.5/lib/node_modules/nx/bin)Expected Behavior:
The help message of
nxCurrent Behavior:
env: node: No such file or directoryIf you add a script with
envorecho $PATHto thepackage.jsonyou can see thatPATHdoesn't contain the directory to the callingnodeexecutable, so I assume it's not a bug ofnx.Environment: