I see a lot of examples on the internet, that say:
1. install a node package using: npm install package
for example npm install node-sass
2. to run the package from the commandline just call the package + arguments like so:node-sass --output-style compressed -o dist/css src/scss
I'm new to node.js and I'm probably doing something wrong or I just don't understand it yet, but I have to do the following to use the package from the commandline:node node_modules/node-sass --output-style compressed -o dist/css src/scss
What am I doing wrong?
You're on the right track. If installing locally (without -g
option) as you did, you have to manually dig what's included in a package. But check out node_modules/.bin
, since that is where any command line tools are placed.
Typically any package that provides binaries is installed with npm install -g package
that performs a system install. Binaries from globally installed packages are in path and work form the command line as expected. So maybe this is the option that would work the best for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With