How to execute commands if npm does not install dependencies globally

for example, I don"t have webpack installed globally
how to use the webpack command in shell

Mar.31,2021

upgrade your NPM to the latest (5.2 +), and then use the npx webpack parameter to execute.


.. / node_modules/.bin/webpack param
or
configure
script

using srcipt in the npm package.json file
webpack 

this is simple. After you have partially installed webpack in the project, you can write it in package.json

.
"scripts": {
    "dev": "node node_modules/webpack-dev-server/bin/webpack-dev-server.js  --progress --quiet --hot",
    "pro": "node node_modules/webpack/bin/webpack.js --progress --hide-modules"
  },

synthesize:

there are two schemes:

  1. / node_modules/.bin/webpack.
  2. npx webpack.

ps: among them. Representative parameter

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e3690b-443b3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e3690b-443b3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?