How to batch run npm install on Windows 10

  • fennng 

If for some reasons, npm update doesn’t fit you need and you need to update some npm packages one by one.

You will want to write a batch command to do it. It seems that a simple bat or cmd file with all the npm installl command listed will work.

But the truth on windows is, only the first command is run.

The reason is that npm itself is not a command but a batch file too. Too make sure all the npm commands will be run, you can add a call in the front of the command.

Check the example below:

call npm install @angular/core@latest
call npm install @angular/forms@latest
call npm install @angular/platform-browser@latest
call npm install @angular/platform-browser-dynamic@latest
call npm install @angular/platform-server@latest
call npm install @angular/router@latest
call npm install @angular/tsc-wrapped@latest
call npm install @angular/core@latest
call npm install angular2-notifications@latest
call npm install bootstrap@latest
call npm install codelyzer@latest
call npm install elements-zone-strategy@latest
call npm install extract-text-webpack-plugin@latest
call npm install html-webpack-plugin@latest
call npm install karma-webpack@latest
call npm install webpack-dev-middleware@latest
call npm install ng-pick-datetime@latest
call npm install ng2-img-max@latest
call npm install ngx-file-drop@latest
call npm install ngx-mask@latest
call npm install tsickle@latest

发表评论

您的电子邮箱地址不会被公开。