Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to download and install all node modules through package.json?

I want to invoke and download all node modules through maven, in maven I have defined the plugins to install it but now in my package.json i have defined the following npm install command, please advise how can i install all node modules and can define them in package.json

package.json

{
  "name": "MyProject",
  "version": "1.0.0",
   "author": "Saral",
  "scripts":{
  "start":"node gulpfile.js",
   "prebuild": "npm install",
    "build": "gulp"
    },

  "dependencies": {
    "gulp": "*",
    "gulp-ruby-sass": "*",
    "gulp-util": "*",
    "gulp-rename": "*",
    "gulp-concat": "^2.6.0",
    "gulp-concat-vendor": "0.0.4",
    "map-stream": "*",
    "gulp-livereload": "*",
    "gulp-concat": "*",
    "gulp-uglify": "*",
    "gulp-minify-css" : "^1.2.1",
    "gulp-notify":"2.2.0",
    "gulp-inject": "1.5.0",
    "run-sequence": "1.1.4",
    "stream-series": "0.1.1",
    "gulp-gzip": "1.2.0",
    "gulp-clone": "1.0.0",
    "gulp-watch": "*"


  }
}
like image 482
Ankit Saxena Avatar asked Jan 21 '26 12:01

Ankit Saxena


1 Answers

Go to your terminal and type in

npm install 

This will crawl through all the required packages mentioned in package.json and download it to node_modules folder.

When using gulp in your gulpfile.js

var install = require("gulp-install");

gulp.src(['./bower.json', './package.json'])
.pipe(install());

So when you run gulp in your terminal all the packages in bower.json and package.json will be downloaded into bower_components and node_modules, respectively.

like image 64
Aswin Avatar answered Jan 24 '26 05:01

Aswin