Kit Ho Kit Ho - 8 months ago 48
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?


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"