Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

npm install -g pkg will install version in $PWD/pkg/package.json globally #8284

Closed
dbkaplun opened this issue May 15, 2015 · 3 comments
Closed

Comments

@dbkaplun
Copy link

Even if you use something like npm install -g pkg@latest, if there's a $PWD/pkg@latest/package.json file, it will use that.

This makes npm unreliable as a package manager for global packages.

Maybe we should consider prioritizing remote packages over local paths when using -g?

@othiym23
Copy link
Contributor

@secrettriangle That would make it impossible to install local packages in some cases, or at least very confusing (e.g. if we required something like ./pkg@latest). Why would you have a directory named pkg@latest in the current directory? What were you trying to do when you ran into this problem?

@dbkaplun
Copy link
Author

Maybe you're right in that that would make it impossible to install local packages in some cases. (Not entirely sure.)

In the current implementation it's impossible to install remote packages in some cases.

@npm-robot
Copy link

We're closing this support issue as it has gone three days without activity. The npm CLI team itself does not provide support via this issue tracker, but we are happy when users help each other here. In our experience once a support issue goes dormant it's unlikely to get further activity. If you're still having problems, you may be better served by joining package.community and asking your question there.

For more information about our new issue aging policies and why we've instituted them please see our blog post.

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

No branches or pull requests

3 participants