简体   繁体   中英

One command to npm install and bower in npm?

A friend of mine said maven is king and npm and bower sucks because you have to run 2 commands. "npm install"... wait... then run "bower install". I heard node's package.json is able to support scripts. Is there a way for me to modify package.json so that I can do something like "npm setupmyproject" that will run both the npm install and bower install commands, then execute a grunt task? That way I can have one command to hit three birds?

Yes, you could add a single script to perform all those operations, eg

{
  "scripts": {
    "setup": "npm install && bower install && grunt build"
  }
}

Then you'll be able to run it with

npm run setup

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM