Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPM and NPX require NODE in PATH #24110

Closed
deinok opened this issue Nov 5, 2018 · 6 comments
Closed

NPM and NPX require NODE in PATH #24110

deinok opened this issue Nov 5, 2018 · 6 comments
Labels
npm Issues and PRs related to the npm client dependency or the npm registry.

Comments

@deinok
Copy link

deinok commented Nov 5, 2018

Any UNIX version of the Node Binaries like https://nodejs.org/dist/v11.1.0/node-v11.1.0-linux-x64.tar.xz require to have Node inside PATH.

How to reproduce

What is expected

I expect that runing the above commands work without having Node in the path

@richardlau
Copy link
Member

richardlau commented Nov 5, 2018

It used to work without having to have node in the PATH but at the request of the npm team it was changed (#6098). See #6095 for details.

@richardlau richardlau added the npm Issues and PRs related to the npm client dependency or the npm registry. label Nov 5, 2018
@deinok
Copy link
Author

deinok commented Nov 5, 2018

For what I understand, this have some issues. Correct me if im wrong please.

Supose that I have installed the binaries at /anyDirectory/node/ (Absolute Path)
Then, I have /anyDirectory/node/bin/node, /anyDirectory/node/bin/npm and /anyDirectory/node/bin/npx
So, I expect that executing /anyDirectory/node/bin/npm will use /anyDirectory/node/bin/node even if I have node in the PATH, cause I'm forcing an exact version of npm

And, if I have node, npm and npx in the PATH, and I execute it like npm it will use whatever instance of node is in the PATH

This is working on win OS

@richardlau
Copy link
Member

No you're correct. Your expected behavior is the way it used to work, but as I referenced the npm team asked us to change the behavior two and half years ago.

cc @nodejs/npm

@devsnek
Copy link
Member

devsnek commented Nov 5, 2018

couldn't you ./bin/node ./bin/npm

@deinok
Copy link
Author

deinok commented Nov 5, 2018

@devsnek Yes, but then the process ID is node and not npm

@Trott
Copy link
Member

Trott commented Nov 21, 2018

I don't think we're likely to override the request of the npm folks on this one so I think the place to take this up is https://npm.community/. I'm going to close this, but feel free to comment (or re-open if GitHub permits) if there's a reason it should stay open.

@Trott Trott closed this as completed Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
npm Issues and PRs related to the npm client dependency or the npm registry.
Projects
None yet
Development

No branches or pull requests

4 participants