Comments (5)
Also, I just saw that a new version of node came out that looks for modules in $PREFIX/lib/node, I just updated nvm to use this for it's $NODE_PATH directory. So if you default to the global $PREFIX based location that will work for me too.
from npm.
That's a great idea.
If you run npm with sudo, it'll default to $PREFIX/lib/node. If not, it'll default to $HOME/.node_libraries.
But it would be good to check the $NODE_PATH, and do something smart with it. At the very least, npm should make sure that the --root setting is in the $NODE_PATH, and show some kind of warning if it's not.
from npm.
the sudo check doesn't work for my case since my $PREFIX is in my home folder. I imagine others do this too. Maybe try to write to the global library folder and fallback to $HOME/.node_libraries if it's not possible.
from npm.
Discussed in IM:
- When not sudo, use require.paths[0]
- When sudo, use process.installPrefix+"/lib/node"
This also ensures that the --root config is in the require path.
from npm.
Fixed in 9baec09
from npm.
Related Issues (20)
- npm version output does not seem to account for tag-version-prefix
- npm start not working Angular HOT 6
- how do i install package? HOT 2
- npm install resulting in npm ERR! 500 Internal Server Error HOT 1
- Unhandled rejection Error: Command failed: /usr/local/bin/git clone --mirror -q HOT 1
- Failing to login from PowerShell - npm Err! code EAUTHIP, Unable to authenticate, need: Basic HOT 7
- Deprecated CSSselect and CSSwhat HOT 3
- Can not install modules HOT 1
- npm install - cb() never called HOT 2
- npm install with local packages and symlinks - ENOENT ... HOT 3
- Missing ) after argument list
- cb() never called error using " ng new" HOT 1
- npm ERR! cb() never called! when trying to install mern-cli globally HOT 4
- ESLint-scope 3.7.2 has been hacked HOT 24
- npm install (6.1.0) doesn't update package-lock.json when using Git URL as dependency
- npm ci creates wrong symlink
- NPM docs website shows wrong `last modified` date HOT 1
- Feature Request: npm install Should Only Install Exact Versions Unless Explicitly Overridden HOT 2
- Enforce 2FA on publish HOT 3
- password reset broken HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from npm.