Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which npm/bin folder(s) should be in the PATH ? ( OS X 10.8.2 / npm installed with homebrew )

Upgrading node by using homebrew

==> Downloading http://nodejs.org/dist/v0.8.21/node-v0.8.21.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/node/0.8.21
==> make install

I'm noticed this

==> Caveats
Homebrew installed npm.
We recommend prepending the following path to your PATH environment
variable to have npm-installed binaries picked up:
  /usr/local/share/npm/bin

In the $PATH I had already: /usr/local/share/npm/lib/node_modules/scripted/bin Should I add /usr/local/share/npm/bin too?

Please note that /usr/local/share/npm/bin only contains two subfolder: scr and scripted that are also in /usr/local/share/npm/lib/node_modules/scripted/bin so what's the difference in the purpose of these two folders?

EDIT /usr/local/share/npm/bin only contains two symlinks ( not subfolders )

like image 526
Franco Rondini Avatar asked Mar 02 '13 04:03

Franco Rondini


People also ask

Where is the npm bin located?

The prefix config defaults to the location where node is installed. On most systems, this is /usr/local . On Windows, it's %AppData%\npm . On Unix systems, it's one level up, since node is typically installed at {prefix}/bin/node rather than {prefix}/node.exe .

What folder to run npm install?

You should run it in your project root folder, or the folder above your node_modules folder as sometimes the structure can differentiate between projects. But in general: the root folder of your project, as long as it is one folder above your node_modules.

What is bin folder in npm?

That is a folder where binaries (executables) from your node modules are located. NPM site states: Executables When in global mode, executables are linked into {prefix}/bin on Unix, or directly into {prefix} on Windows. When in local mode, executables are linked into ./node_modules/.

Where is npm installed Mac?

You should have some familiarity with the Mac Terminal application since you'll need to use it to install and test Node and NPM. You'll also need the Terminal to use Node. js and NPM. The Terminal application is located in the Utilities folder in the Applications folder.


1 Answers

Maybe you are upgrading from old version fo node? I'm using node from homebrew repository since 0.8.17 and i don't have any subfolders in my /usr/local/share/npm/bin. It contains only simlinks to executable scripts of globally installed modules (in /usr/local/share/npm/lib/node_modules). So, i have /usr/local/share/npm/bin in my $PATH and it works fine. If you are upgrading from old version of node and npm, try to reinstall your globally installed modules before changing your $PATH.

like image 119
Vadim Baryshev Avatar answered Nov 15 '22 19:11

Vadim Baryshev