2

With most NPM packages you can invoke their command line application by running it from the bin folder inside the package's folder in node_modules:

npm install foo
./node_modules/foo/bin/foo

Now of course you can do this more easily if you install the package globally:

npm install -g foo
foo

but that's generally considered to be a bad practice.

With the compass package however this doesn't appear to be the case. When you do:

npm install compass

the package's node_modules directory doesn't even have a bin folder.

So, my question is, is there anyway to install compass non-globally, but still be able to invoke it from the command line?

P.S. I know I could also install compass through the system, ie. sudo apt-get install compass, but I was hoping I could keep my process simple and have NPM manage everything.

machineghost
  • 33,529
  • 30
  • 159
  • 234

1 Answers1

2

It turns out the answer is no, because the compass NPM package doesn't actually include compass. Rather, the package is a JS front-end to the compass executable, which must be installed separately. Presumably this is because compass relies on Ruby, and they didn't want to make Ruby a package dependency.

So if you want to use Compass it will have to be part of the system-level (on Linux, apt-get install) setup.

machineghost
  • 33,529
  • 30
  • 159
  • 234
  • Thank you! You saved me a bunch of time [thinking I was] troubleshooting a docker container.... – UnsettlingTrend Sep 20 '18 at 14:08
  • Whenever I solve my own problem I wonder if I should just delete it instead of answering myself ... but then I get comments like this one and I know I made the right choice :) – machineghost Sep 21 '18 at 03:07