jonschlinkert / global-modules Goto Github PK
View Code? Open in Web Editor NEWReturns the directory used by NPM for globally installed NPM packages.
Home Page: https://github.com/jonschlinkert
License: MIT License
Returns the directory used by NPM for globally installed NPM packages.
Home Page: https://github.com/jonschlinkert
License: MIT License
Line 25 in 916edb1
Hey there. Just found that it not works for yarn global path.
Which i believe isn't configurable or?
If that's right, then it is /home/<username>/.config/yarn/global/node_modules
Hi,
It will be better to provides an array instead of only path.
Debian will first search to /usr/local/lib//nodejs than to /usr/local/lib/nodejs than /usr/local/share/nodejs then /usr/lib//nodejs than to /usr/lib/nodejs than /usr/share/nodejs
So please return an array
It will break depends but it is life
mocha -R spec
mods
1) should resolve the path to the global npm modules directory:
0 passing (20ms)
1 failing
1) mods should resolve the path to the global npm modules directory::
AssertionError: false == true
at Context.<anonymous> (/<<PKGBUILDDIR>>/test.js:17:5)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:223:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
at /usr/lib/nodejs/mocha/lib/runner.js:451:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
at /usr/lib/nodejs/mocha/lib/runner.js:308:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
at Immediate._onImmediate (/usr/lib/nodejs/mocha/lib/runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:383:17)
On debian the global modules path is /usr/lib/nodejs. Its similar to jonschlinkert/global-prefix#15
Heya. I'm just thinking that it probably better idea would to move this to npm-global-modules
and then we can implement both things here - you call globalModules()
and get both for Yarn and Npm.
This name is good and because we already have yarn-global-modules
, then it make sense to rename this one too.
But anyway, it's not something so important for now.
Please tag the 0.2.2 release that corresponds with the 0.2.2 version in NPM, thanks!
I am on gentoo linux with npm 6.4.1 and node 8.12.0 and have set my local prefix to ~/.local
.
Now npm is installing packages into ~/.local/lib64/node_modules
. Unfortunately global-modules is returning ~/.local/lib/node_modules
.
With the default prefix, there would actually be a /usr/lib -> /usr/lib64
symlink, but npm by itself does not use that. (Though as a workaround I will create a symlink in ~/.local/
too).
Hi, I found that the result from npm root -g
should be the correct path. However sometimes global-modules will find the wrong one when we use nvm to manage our node versions.
Do you have any ideas?
Trying to debug a gulp script, I enabled breakpoints on all exceptions. There were a large number of exceptions from the global-modules package. If you can change the implementation to avoid this, it would make this a better package.
P.S. It would also be nice if you adopt semver and bump the version number to 1, semver rules say version 0 is reserved effectively excluded from versioning.
I have in my .npmrc
prefix=~/.npm-packages
Even though Windows doesn't natively expand ~
to homedir, it works as expected since npm
manages to handle it... then this module should be able to handle it too
Security vulnerability CVE-2019-20149 downstream in kind-of (used by global-prefix, which this package uses) leads to any projects using this to be flagged.
As this security vulnerability has been rated fairly high, this is problematic.
A new version of kind-of (6.0.3) has been released with a fix, but not yet clone-deep.
When this PR in global-prefix to bump the kind-of version is merged and a new version released, then this package should also bump its version of global-prefix to match.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.