0

I'm using JointsWP (an excellent Foundation 6 port to Wordpress).

I'm using the Sass version and it's working great. However, I seem to have to install npm with every project. Is this nessesary?

Is there a way to install npm globally and link to it from my project? Or have the project find it automatically?

Colin Marshall
  • 2,142
  • 2
  • 21
  • 31
catchlight
  • 63
  • 1
  • 2
  • 11

3 Answers3

2

I think you are confused about what the command npm install actually does. npm install installs all the npm dependencies for your project into the node_modules directory. It doesn't actually install npm. To run npm install you have to have Node.js installed (npm is included with node).

So to answer your question, yes it is necessary to run npm install for every project.

Relevant Article: Global vs Local installation

Colin Marshall
  • 2,142
  • 2
  • 21
  • 31
1

The article above shared by Colin Marshall is great and sums up the answer perfectly.

In general, the rule of thumb is:

If you’re installing something that you want to use in your program, using require('whatever'), then install it locally, at the root of your project. If you’re installing something that you want to use in your shell, on the command line or something, install it globally, so that its binaries end up in your PATH environment variable.

So to answer your question, is it possible? Yes.

Is it recommended? No.

https://nodejs.org/en/blog/npm/npm-1-0-global-vs-local-installation/

JeremyE
  • 1,368
  • 4
  • 20
  • 40
0

You can install gulp sass globally with the command:

npm install -g gulp-sass

Alexander van Trijffel
  • 2,916
  • 1
  • 29
  • 31
  • Some stuff has to be installed globally, but you still need the rest of the dependencies listed here: https://github.com/JeremyEnglert/JointsWP/blob/master/package.json – Colin Marshall Jan 27 '16 at 21:01