Mateusz Gbiorczyk
Mateusz Gbiorczyk

Reputation: 31

Gulp install globally

I need install gulp. I used this command: npm install gulp gulp-plumber gulp-sass gulp-autoprefixer gulp-concat gulp-uglify gulp-notify

Unfortunelly in my project It was created node_modules directory. How do I do this? I don't have to add files in any project. I would like to use only command "gulp watch".

Upvotes: 2

Views: 6541

Answers (3)

Codesingh
Codesingh

Reputation: 3384

Add gulp in your package.json and run npm intall from your project directory.

Upvotes: 0

Syam Pillai
Syam Pillai

Reputation: 5217

add -g for global installing

$ npm install -g gulp

OR

$ sudo npm install -g gulp

Upvotes: 3

Paul S.
Paul S.

Reputation: 66334

To install a npm package globally on a machine, use one of

  • npm i -g <packages>
  • npm install --global <packages>

However, this doesn't let anybody else know about this dependency. Consider instead adding node_modules/ to your .gitignore file (or the ignore of whatever VCS you are using), then install with

  • npm i --save-dev <packages>

The --save-dev here means that it knows that this dependency is only for development and not required in deployment. So if you use a script to deploy which installs the npm dependencies, you can have it ignore these packages

Upvotes: 1

Related Questions