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

Throws error when asking for any version or alias #912

Closed
marcoslhc opened this issue Nov 20, 2015 · 4 comments
Closed

Throws error when asking for any version or alias #912

marcoslhc opened this issue Nov 20, 2015 · 4 comments
Labels
non-issue / invalid This isn't relevant to nvm, or turned out to be something unrelated.

Comments

@marcoslhc
Copy link

When I try nvm use [version or alias] this error jumps 😢

$ nvm use default
module.js:339
    throw err;
    ^

Error: Cannot find module 'npm-registry-client'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/Users/marcoslh/.nvm/versions/node/v5.0.0/lib/node_modules/npm/lib/cache/caching-client.js:9:22)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run `npm config delete prefix` or `nvm use --delete-prefix v5.0.0 --silent` to unset it.
module.js:339
    throw err;
    ^

Error: Cannot find module 'npm-registry-client'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/Users/marcoslh/.nvm/versions/node/v5.0.0/lib/node_modules/npm/lib/cache/caching-client.js:9:22)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run `npm config delete prefix` or `nvm use --delete-prefix v5.0.0` to unset it.
@ljharb ljharb closed this as completed Nov 20, 2015
@ljharb ljharb reopened this Nov 20, 2015
@ljharb
Copy link
Member

ljharb commented Nov 20, 2015

On second thought, this looks like you have a broken npm itself. Try nvm use default --silent to skip the npm invocation, and then nvm uninstall 5.0.0 && nvm install 5.0.0?

@ljharb ljharb added the needs followup We need some info or action from whoever filed this issue/PR. label Nov 20, 2015
@marcoslhc
Copy link
Author

mmm I did the nvm use default --silent

nvm use default --silent
module.js:339
    throw err;
    ^

Error: Cannot find module 'npm-registry-client'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/Users/marcoslh/.nvm/versions/node/v5.0.0/lib/node_modules/npm/lib/cache/caching-client.js:9:22)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run `npm config delete prefix` or `nvm use --delete-prefix v5.0.0 --silent` to unset it.

the I ran npm config list and got

; cli configs
user-agent = "npm/3.4.1 node/v5.1.0 darwin x64"

; userconfig /Users/marcoslh/.npmrc
registry = "http://registry.npmjs.org/"

; builtin config undefined
prefix = "/usr/local"

; node bin location = /usr/local/Cellar/node/5.1.0/bin/node
; cwd = /Users/marcoslh
; HOME = /Users/marcoslh
; "npm config ls -l" to show all defaults.

may be the 5.0.0 and 5.1.0 are conflicting?

@marcoslhc
Copy link
Author

No worries, Uninstalling and reinstalling the version worked. Thanks @ljharb! 👍

@ljharb
Copy link
Member

ljharb commented Nov 21, 2015

Glad to hear it! Please do note that installing nvm with homebrew is unsupported, so if you have further trouble, please try to brew uninstall it first and install it properly with the curl command in the readme :-)

@ljharb ljharb closed this as completed Nov 21, 2015
@ljharb ljharb added non-issue / invalid This isn't relevant to nvm, or turned out to be something unrelated. and removed needs followup We need some info or action from whoever filed this issue/PR. labels Nov 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-issue / invalid This isn't relevant to nvm, or turned out to be something unrelated.
Projects
None yet
Development

No branches or pull requests

2 participants