Kit Ho Kit Ho - 1 year ago 120
Node.js Question

NPM : how to source ./node_modules/.bin folder?

i have a problem on npm installation

I have created a project say project A

cd ~/projectA
npm install sails

but sails command is not found after installation.
I know that it is successfully install in ~/projectA/node_modules directory.
but the executable cannot be sourced. And i know it is installed ~/projectA/node_modules/.bin

How can I source the .bin automatically whenever I enter into this projectA folder?

Did i did sth wrong?

Answer Source

I can give you an inelegant solution, which is working for me. I just exported my path in my .bashrc file.

export PATH="$PATH:./node_modules/.bin"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download