Day064 — how to run command from locally installed npm packages

Jacky Tsang
1 min readMar 5, 2019

--

previously, I can just write a build script in package.json. e.g.

package.json:

"scripts": {
"build":"gatsby build",
}

and then run it with npm run build.

Now I can simply use:

npx gatsby build

At the top of my head, I think it is very useful for testing written script of an npm package that installed in devDependencies before writing it to the package.json. (It is recommended that you install webpack locally with npm install — save-dev webpack)

e.g.

npx webpack --help

--

--

No responses yet