-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Support environment variables in .npmrc's "prefix" setting #79
Comments
Yeaaa... I dont like the implementation of the I can look at that bug in the coming days, because im on vacation. It feels like it's a bug here, but if not it is on the global-modules side. |
In case it's a 3rd party bug, g-i-p should add a hint to the error message which module suggested the broken path. PS: The guess is almost right, minus the |
hm, strange. I know it's the same but try $HOME? otherwise it more and more feels to like a problem with symlinking and prefix resolving which is inside global-modules and global-prefix packages. |
with
with the
However, it's a good thing you reminded me about that stale npm. I generally don't install modules globally, but the way I install node.js causes an old npm to linger there. Is g-i-p supposed to be able to find files as well? If so, the old npm seems to confuse it:
Bonus:
|
In case it helps, here's the workaround I use for the |
No, it automatically detects the entry point of a package - the Doh. Okey, i'm at home so debugging can start. Meanwhile can you try the Also, is |
edit: edit2: okey, can you please report the problem in the |
For some reason (probably because of using
when set the Doh... One more thing is that even that i have Total mess.. Anyway, i'll clean up and report :D |
Nope, cwd was |
Wait. ~/tunnckoCore/baw
❯ npm i -g lodash
+ [email protected]
added 1 package from 2 contributors in 1.538s
~/tunnckoCore/baw
❯ node -p 'console.log(require.resolve("lodash"))'
internal/modules/cjs/loader.js:596
throw err;
^
Error: Cannot find module 'lodash'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
at Function.resolve (internal/modules/cjs/helpers.js:30:19)
at [eval]:1:21
at Script.runInThisContext (vm.js:91:20)
at Object.runInThisContext (vm.js:298:38)
at Object.<anonymous> ([eval]-wrapper:6:22)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at evalScript (internal/bootstrap/node.js:539:27)
at startup (internal/bootstrap/node.js:213:9)
at bootstrapNodeJSCore (internal/bootstrap/node.js:572:3) |
But anyway. It sounds like a problem in Also, i can't really find a way to try and error, and fix that bug, because i'm using NVM. I'm open for PRs. |
I traced the strange behavior of
resolve-package
to a problem in this package:My node code:
Output:
When I change the
prefix
setting in my.npmrc
from${HOME}
to${HOME}/foobar
and copy my~/.node_modules
symlink there, the error message adapts toError: get-installed-path: module not found "lodash" in path /home/mk/${HOME}/foobar/lib/node_modules/lodash
I wonder though, where does the
/home/mk
come from if the${HOME}
wasn't replaced?The text was updated successfully, but these errors were encountered: