Code Monkey home page Code Monkey logo

Comments (33)

samccone avatar samccone commented on August 24, 2024 1

@visionmedia are you trolling me?

from n.

tj avatar tj commented on August 24, 2024

thanks to the terrible directory structure of *nix we need to just install a bunch more crap. #62

from n.

deremer avatar deremer commented on August 24, 2024

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
Required: [email protected] || 0.7 || 0.8
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:67:23
at Object. (/usr/local/lib/node_modules/npm/bin/npm-cli.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.0 (module.js:423:10)
at EventEmitter._tickCallback (node.js:126:26)

How can I run 2 different versions of NPM?

from n.

vjpr avatar vjpr commented on August 24, 2024

+1

from n.

alexkwolfe avatar alexkwolfe commented on August 24, 2024

+1

from n.

deremer avatar deremer commented on August 24, 2024

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!

from n.

alexkwolfe avatar alexkwolfe commented on August 24, 2024

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.

from n.

deianvasilev avatar deianvasilev commented on August 24, 2024

I got also this:

npm --version

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module '../lib/utils/log.js'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at /usr/local/bin/npm:18:11
at Object. (/usr/local/bin/npm:87:2)
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)

So I was pushed to use it like this: /usr/local/n/current/bin/npm --version

from n.

ashtuchkin avatar ashtuchkin commented on August 24, 2024

+1. Had to uninstall n.

from n.

ryancole avatar ryancole commented on August 24, 2024

I just finished a fresh install of Ubuntu. My plan was to use n to install my first version of node.js, so that I could start using node version management from the get-go. n worked great to install node.js, but does not seem to configure everything so that it's also friendly with npm. npm just does not work. I am seeing the same error as noted by @deianvasilev two comments up. Here is some output from my system.

ryan@ryan-server:~$ n
/usr/local/bin/node
  ο 0.6.15
    0.7.8
ryan@ryan-server:~$ n -V
0.7.1
ryan@ryan-server:~$ npm

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: Cannot find module '../lib/utils/log.js'
    at Function._resolveFilename (module.js:332:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:354:17)
    at require (module.js:370:17)
    at /usr/local/bin/npm:18:11
    at Object.<anonymous> (/usr/local/bin/npm:87:2)
    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)

from n.

525c1e21-bd67-4735-ac99-b4b0e5262290 avatar 525c1e21-bd67-4735-ac99-b4b0e5262290 commented on August 24, 2024

+1 to this issue

and

+1 to @deremer 's temporary fix (which also worked for 0.6.x <-> 0.7.x)

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!

from n.

sveisvei avatar sveisvei commented on August 24, 2024

astro/node-expat#16 Having similar issues

from n.

rauchg avatar rauchg commented on August 24, 2024

+1

from n.

sveisvei avatar sveisvei commented on August 24, 2024

I had to remove ~/.npm and ~/.npmrc to get this working again, dunno which of the folders made it work.

from n.

akumpf avatar akumpf commented on August 24, 2024

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,
Adam

from n.

tj avatar tj commented on August 24, 2024

as long as we copy everything from the build it should just work

from n.

akumpf avatar akumpf commented on August 24, 2024

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?

from n.

tj avatar tj commented on August 24, 2024

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

from n.

TedAvery avatar TedAvery commented on August 24, 2024

+1 :(

from n.

dwradcliffe avatar dwradcliffe commented on August 24, 2024

+1

My temp fix:

cd /usr/local/bin
mv npm npm.old
ln -s /usr/local/n/current/bin/npm .

from n.

rauchg avatar rauchg commented on August 24, 2024

+1

from n.

tj avatar tj commented on August 24, 2024

+1

from n.

guybrush avatar guybrush commented on August 24, 2024
mkdir ~/local
export PATH=~/local/bin:"$PATH"
curl http://npmjs.org/install.sh | npm_config_prefix=~/local sh

now i can do:

patrick@ilvy ~ $ which npm
/home/patrick/bin/npm
patrick@ilvy ~ $ npm -v
1.1.32
patrick@ilvy ~ $ n -V
0.7.2
patrick@ilvy ~ $ node -v
v0.6.19
patrick@ilvy ~ $ sudo n 0.8.0
/usr/local/bin/node
patrick@ilvy ~ $ node -v
v0.8.0
patrick@ilvy ~ $ which npm
/home/patrick/bin/npm
patrick@ilvy ~ $ npm -v
1.1.32
patrick@ilvy ~ $ sudo n 0.6.19
/usr/local/bin/node
patrick@ilvy ~ $ node -v
v0.6.19
patrick@ilvy ~ $ which npm
/home/patrick/bin/npm
patrick@ilvy ~ $ npm -v
1.1.32

from n.

guybrush avatar guybrush commented on August 24, 2024

oh.. with sudo npm it still sucks this way :/

from n.

samccone avatar samccone commented on August 24, 2024

+1

going from 0.8.0 to 0.6.19

module.js:337
throw new Error("Cannot find module '" + request + "'");
^
Error: Cannot find module '../lib/utils/log.js'

from n.

tj avatar tj commented on August 24, 2024

+1

from n.

rauchg avatar rauchg commented on August 24, 2024

+1

from n.

guybrush avatar guybrush commented on August 24, 2024

you can do n 0.8.0 --without-npm then it will only install node without npm

if you have already installed a node with npm (via n), just remove $n_prefix/versions/<node-version>/bin/npm

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

from n.

 avatar commented on August 24, 2024

In your .bashrc if your ok with relying on what ever n is doing
alias npm="n npm node -v"

from n.

BenJam avatar BenJam commented on August 24, 2024

+1 for n having a 'meh' attitude to node_modules, great idea but poorly executed.

from n.

tj avatar tj commented on August 24, 2024

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

from n.

jessekinsman avatar jessekinsman commented on August 24, 2024

I agree with this issue it kind of makes this module useless

from n.

noorzaie avatar noorzaie commented on August 24, 2024

2+

from n.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.