Error: Cannot find module ‘webpack-cli/package.json‘

解决办法:npm install webpack-cli -g

Error: Cannot find module 'webpack-cli/package.json'
Require stack:
- C:\Users\12987\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.resolve (internal/modules/cjs/helpers.js:94:19)
    at runCli (C:\Users\12987\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js:65:26)
    at C:\Users\12987\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js:154:5
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\12987\\AppData\\Roaming\\npm\\node_modules\\webpack\\bin\\webpack.js'
  ]
}
上一篇:ts 排除 node_modules 目录检测无效


下一篇:js&ts_webpack错误