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

Global installed NPM packages are shared between all node versions #198

Open
evangalen opened this issue Feb 19, 2017 · 4 comments
Open

Comments

@evangalen
Copy link

I noticed that when installing NPM packages globally, they are shared between all installed Node.js version.

For instance, I did a npm install -g yarn and noticed that after switching to another Node.js version (using nodist env ..) that yarn was also available when using another Node.js version.

I noticed that the prefix used by Node.js doesn't appear to be related to the active Node.js version
When running npm config list, the "prefix" (under "environment configs") was "C:\Program Files (x86)\Nodist\bin" instead of something Node.js version specific like "C:\Program Files (x86)\Nodist\v-x64\6.9.5").

@marcelklehr
Copy link
Member

marcelklehr commented Feb 19, 2017

Yes, this is by design, although there are some issues with this feature. Also see the README section on the topic.

@Keyes
Copy link

Keyes commented May 23, 2017

nodist is not usable with global NPM packages for me - grunt for example is always run with node 7, although the current folder requires node 4

@marcelklehr
Copy link
Member

I understand. A quick fix might be to create a build task in your package.json and start it using npm run.

@marcelklehr
Copy link
Member

A real solution would involve detecting whether the target file is in the global modules folder and using the cwd instead of the target dir in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants