Updating npm with homebrew

When node (v.0.10.33) is installed with homebrew (v. 0.9.5), at some point it says:

==> Caveats If you update npm itself do NOT use the npm upgrade command Instead execute: npm install -g npm@latest 

So what exactly is npm upgrade and what is the difference with npm install -g npm@latest ?

- change 2015

the problem no longer exists with the current version of node. (but I never had an answer to what npm upgrade ?)

+8
npm homebrew
source share
2 answers

Use npm install to install the package and npm update to update the package.

What is Failure from hpf = "https://github.com/Homebrew/homebrew/commit/f2bfb09f278ad979560920a83bb022d0dd9a6133" Homebrew npm caveat has been removed after fixing the npm update -g problem.

+8
source share

npm comes bundled with node, both parts of Node.js install --- no need to install separately

Below are the steps for installing Node.js from a source (OSX / linux). Issuing cmds as your own is NOT root (sudo)

to start fresh uninstall before node and npm installation, as well as the following:

 sudo mv ~/.npmrc ~/.npmrc_ignore sudo mv ~/.npm ~/.npm_ignore sudo mv ~/tmp ~/tmp_ignore sudo mv ~/.npm-init.js ~/.npm-init.js_ignore 

Download Source: http://nodejs.org/download/

 cd freshly-downloaded-dir 

define the NODE_PATH environment variable as a directory for subsequent installation modules

 export NODE_PARENT=${HOME}/nodejs-v0.10.33 export PATH=${NODE_PARENT}/bin:${PATH} export NODE_PATH=${NODE_PARENT}/lib/node_modules ./configure --prefix=${NODE_PARENT} make make install # IMPORTANT this is NOT using sudo # not wanted since installing into $USER owned $NODE_PARENT 

which puts it in the directory above --prefix

when you use the syntax: npm install -g some_cool_module -g for global installs it in the $ NODE_PATH directory, not your $ PWD

Now put the three exported xxx = yyy commands into your ~ / .bashrc or some of them to save these changes to the environment variables.

-one
source share

All Articles