-
-
Notifications
You must be signed in to change notification settings - Fork 743
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
Using n to install node broke NPM #63
Comments
thanks to the terrible directory structure of *nix we need to just install a bunch more crap. #62 |
Reinstalling NPM (curl http://npmjs.org/install.sh | sh) fixed it for v0.6.13, but now I can't install anything in 0.4.7 because of... Error: npm doesn't work with node v0.4.7 How can I run 2 different versions of NPM? |
+1 |
1 similar comment
+1 |
In case this helps others... You can still use N to toggle between 0.4.x and 0.6.x, but each time you need to install the right version of NPM. To install an old version of NPM, follow the instructions I wrote here: http://blog.grandelabs.com/post/20069207998/how-to-install-an-old-version-of-npm Just an interim solution until the awesome guys at visionmedia can fix this. Cheers! |
It seems like this was working in a past version of n. Is that true? If so, presumably we could just use an old version of n. |
I got also this: npm --versionnode.js:201 So I was pushed to use it like this: /usr/local/n/current/bin/npm --version |
+1. Had to uninstall n. |
I just finished a fresh install of Ubuntu. My plan was to use
|
+1 to this issue and +1 to @deremer 's temporary fix (which also worked for 0.6.x <-> 0.7.x)
|
xmppo/node-expat#16 Having similar issues |
+1 |
I had to remove ~/.npm and ~/.npmrc to get this working again, dunno which of the folders made it work. |
ok, so had the same issue: looks like the problem is that /usr/local/bin/npm is populated with the npm file instead of a symbolic link to the current npm version (/usr/local/n/current/bin/npm). I'm sure there's a more robust fix -- @visionmedia am I missing something here? would be great to update n to take care of this pesky npm issue :) cheers, |
as long as we copy everything from the build it should just work |
Looking in /usr/local/bin/npm you can see it references a relative directory ("../lib/ ... "). I think that's what's breaking. How should we resolve it? Is there a down-side to using symbolic links to the current version instead of copying? |
symlinks should be fine, i just went with copying originally because it was the first thing i wrote and the time it took was negligible so i didn't bother with symlinks :D |
+1 :( |
+1 My temp fix:
|
+1 |
1 similar comment
+1 |
now i can do:
|
oh.. with sudo npm it still sucks this way :/ |
+1 going from 0.8.0 to 0.6.19 module.js:337 |
+1 |
1 similar comment
+1 |
@visionmedia are you trolling me? |
you can do if you have already installed a node with npm (via n), just remove this way n will not destroy npm, but one has to install npm manually (which i prefer anyways) we could hardcode it (https://github.com/visionmedia/n/blob/master/bin/n#L196), since most users of n will use a custom installed npm anyway? actually i think the best solution would be to hardcode it into node :P |
In your .bashrc if your ok with relying on what ever n is doing |
+1 for n having a 'meh' attitude to node_modules, great idea but poorly executed. |
with all the pullrequests that have slowly kinda messed things up this could use a rewrite entirely, plus now we have binaries to install instead |
I agree with this issue it kind of makes this module useless |
2+ |
I've been working on node 4.7 for a long time because that's all Heroku supported, but recently they announced support for other versions, so I was looking to upgrade node. Since I have production code working on 4.7, I need to swap between 4.7 and 6.13.
n seems awesome and I'd love to use it. For running node, it works fine. But something happened when I installed it such that npm no longer works.
If I switch to n 0.4.7 and run 'npm install' for a module I get:
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module '../lib/npm.js'
at Function._resolveFilename (module.js:320:11)
at Function._load (module.js:266:25)
at require (module.js:348:19)
at /usr/local/lib/node_modules/npm/bin/npm.js:24:11
at Object. (/usr/local/lib/node_modules/npm/bin/npm.js:87:2)
at Module._compile (module.js:404:26)
at Object..js (module.js:410:10)
at Module.load (module.js:336:31)
at Function._load (module.js:297:12)
at Array. (module.js:423:10)
If I switch to n 0.6.13 and run 'npm install' for a module I get:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: No such module
at Object. (/usr/local/lib/node_modules/npm/lib/utils/config-defs.js:5:21)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at Object. (/usr/local/lib/node_modules/npm/lib/utils/ini.js:40:18)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
Your help would be most appreciated as I can't seem to figure it out. Thanks!
The text was updated successfully, but these errors were encountered: