NPM 2.0 and how it helps avoiding global dependencies

added by JavaScript Kicks
10/21/2014 10:28:41 AM

127 Views

Especially the recent changes inside of the command line client are a heavy discussed topic and I highly recommend to listen to this episode, when you are dealing with npm on a daily basis. One thing that is mentioned and really gets me excited is the change regarding the functionality to run scripts via npm which was introduced in the latest major version of npm – [email protected] So let us reassess how to run scripts via npm, have a look at what has changed in version 2.0.0 and check why this is such a big deal.


3 comments

Bob Senoff
10/21/2014 1:30:34 PM
@ceejbot any of your folks have something to add on this?

C J Silverio
10/21/2014 5:15:21 PM
That's a great article on some of the new workflows that passing arguments through `npm run` can enable for you! My colleague Benjamin Coe did this work, mostly driven by back-end service-running needs, and it's great to see it paying off in the front-end as well. If you're using npm regularly you should keep up with fresh releases of the CLI. It's on a steady release schedule now. `npm install -g npm@latest` (possibly sudo required) will get a faster, less-buggy npm for you.

Drew Peterson
10/22/2014 5:50:06 PM
The ability to install the command line tools locally and use npm to run them definitely helps on the CI end of things, for the developer end I would most likely put an alias in my bashrc/zshrc to alias grunt to `npm run grunt` :)