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

npm error after using n to switch versions #101

Closed
mpalmerlee opened this issue Feb 16, 2013 · 40 comments
Closed

npm error after using n to switch versions #101

mpalmerlee opened this issue Feb 16, 2013 · 40 comments

Comments

@mpalmerlee
Copy link

I've been using n to sucessfully switch node versions (it seems) for the last few days, but I'm having problems now with npm:
module.js:340
throw err;
^
Error: Cannot find module 'npmlog'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at /usr/local/bin/npm:19:11
at Object. (/usr/local/bin/npm:87:3)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

Thanks for your help.

@fgnass
Copy link

fgnass commented Mar 3, 2013

Same thing here.

@fent
Copy link

fent commented Mar 5, 2013

Getting the same error.

@mpalmerlee
Copy link
Author

I think it has to do with my manual install of v0.6.19, (since there is no compiled version for mac of 0.6.19, I had to copy files manually to:
/usr/local/n/versions/0.6.19

and I noticed there are files for npm (in 0.8.20) here:
/usr/local/n/versions/0.8.20/lib/node_modules/npm

@tj
Copy link
Owner

tj commented Mar 5, 2013

works for me :s

@bryanchriswhite
Copy link

having the same problem node v0.8.22

@malkomalko
Copy link

same, but I fixed it by manually running "curl https://npmjs.org/install.sh | sh" once

@csmosx
Copy link

csmosx commented Mar 11, 2013

+1 from a clean install (manually removed all previous node & npm artifacts), though I installed to /opt/local instead of /usr & exported N_PREFIX accordingly.

Failed on n version 0.8.2 and the latest 0.9.1.

@SpaceLegends
Copy link

When i install Node and it bring me a rolling back action and giving me a error

@SpaceLegends
Copy link

C:\Users\Zack\Desktop\sparkle>npm install ttapi

module.js:340
throw err;
^
Error: Cannot find module 'npmlog'
at Function.Module._resolveFilename (module.js
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at C:\Program Files\nodejs\node_modules\npm\bi
at Object. (C:\Program Files\nodejs
js:86:3)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:46
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

@SpaceLegends
Copy link

Im using a pc

@CrabDude
Copy link

Same issue, $ curl https://npmjs.org/install.sh | sh solved it.

@CrabDude
Copy link

Check that, reinstall npm didn't solve it. Had to reinstall node, and n unfortunately doesn't work 100% of the time. =(

@CrabDude
Copy link

It looks like the reason for the previous "fix" was that I removed /usr/local/npm (and relaunched my terminal), which caused it to fallback on ~/.npm_prefix/bin/npm which works.

So, I'm assuming this is an npm prefix issue.

@blakeembrey
Copy link

Was switching from using nvm to n and the manual curl https://npmjs.org/install.sh | sh fixed the issue for me

@mpalmerlee
Copy link
Author

Thanks guys, I was able to fix my issues with:
curl https://npmjs.org/install.sh | sh

as well.

@mikemoser
Copy link

This fixed my issue as well.

Note: If you get "301 Moved Permanently" then try curl -0 -L http://npmjs.org/install.sh | sudo sh to follow redirects. Also notice I added sudo before the sudo sh command depending on your users permissions.

@lukeburns
Copy link

thank you @mikemoser

1 similar comment
@rsgrafx
Copy link

rsgrafx commented Sep 1, 2014

thank you @mikemoser

@d0tlab
Copy link

d0tlab commented Feb 20, 2015

Thank you @mikemoser :)

@jhash
Copy link

jhash commented Mar 19, 2015

You da man @mikemoser ;)

@alejandroschmechel
Copy link

Thaaanks @mikemoser 👯

@scotttesler
Copy link

I'm still having this issue and I'm using the latest version of n. npmconf cannot be found is the error.

@LiamKlyneker
Copy link

@mikemoser ty dude! you save me

@FrankFang
Copy link

sudo rm -rf /usr/local/lib/node_modules fixed my issue as well.

@Narven
Copy link

Narven commented Jul 29, 2015

thanks @mikemoser

@felipesousa
Copy link

@mikemoser Thank's! 👍

@dznet
Copy link

dznet commented Aug 8, 2015

Not work for me. what wrong?

screenshot from 2015-08-08 12 59 08

@maxrimue
Copy link
Contributor

maxrimue commented Aug 8, 2015

@dznet I think your problem is just that the install.sh file requires administrator rights, so sudo ./install should solve it

@dznet
Copy link

dznet commented Aug 8, 2015

I try it. but dont solve for me

screenshot from 2015-08-08 13 17 51

@maxrimue
Copy link
Contributor

maxrimue commented Aug 8, 2015

@dznet I have no idea what you are doing there as you don't give any context, but yes, your problem is solved, that one is a new one, a module is missing, inside a Node.js project you can call npm install to install its dependencies/modules. Please note that these problems are not caused by or have to deal with n.

@dznet
Copy link

dznet commented Aug 8, 2015

@maxrimue sorry. i try run test Node.js project with mongodb
i also try ##npm install "module_name''
and other things via inet don't work for me.
what an information i will give you?

@maxrimue
Copy link
Contributor

maxrimue commented Aug 8, 2015

I think your problem is that your app is looking for "mongobd", it's called
"mongodb" though
dzNET notifications@github.com schrieb am Sa., 8. Aug. 2015 um 12:33:

@maxrimue https://github.com/maxrimue sorry. i try run test Node.js
project with mongodb
i also try ##npm install "module_name''
and other things via inet don't work for me.
what an information i will give you?


Reply to this email directly or view it on GitHub
#101 (comment).

@joncode
Copy link

joncode commented Sep 3, 2015

right on @mikemoser !

@edutrul
Copy link

edutrul commented Sep 13, 2015

@mikemoser ty dude! you are awesome!

@GerkinDev
Copy link

I had this problem too, because I was logged in as root. I just su to another user account, and the problem disapeared, that was kinda magic.

@JoshuaChi
Copy link

$ curl https://npmjs.org/install.sh | sh

Vote +1

@EdgarPozas
Copy link

thanks :)

@bhargav1
Copy link

bhargav1 commented Jan 8, 2016

Thanks @mikemoser

1 similar comment
@beatcode
Copy link

beatcode commented Jan 9, 2016

Thanks @mikemoser

@qw3rtman
Copy link
Collaborator

Going to add this catch to the README since it's been helpful to so many people! Thanks @mikemoser. 😄

qw3rtman added a commit that referenced this issue Jan 10, 2016
Add npm error information (#101) to README.
Repository owner locked and limited conversation to collaborators Jan 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests