无法运行npm start

时间:2020-05-03 18:09:12

标签: json npm webpack

因此,我正在学习在线课程,但遇到了麻烦。我正在cmd中运行命令npm run start,但似乎无法正常工作。

这是webpack.config.js文件:

enter image description here

这是package.json文件: enter image description here

这是我从cmd得到的错误代码:

C:\Users\user\Desktop\complete-javascript-course-master\9-forkify\starter>npm run start

> forkify@1.0.0 start C:\Users\user\Desktop\complete-javascript-course-master\9-forkify\starter
> webpack-dev-server --mode development --open

internal/modules/cjs/loader.js:985
  throw err;
  ^

Error: Cannot find module 'webpack-cli/bin/config-yargs'
Require stack:
- C:\Users\user\Desktop\complete-javascript-course-master\9-forkify\starter\node_modules\webpack-dev-server\bin\webpack-dev-server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (C:\Users\user\Desktop\complete-javascript-course-master\9-forkify\starter\node_modules\webpack-dev-server\bin\webpack-dev-server.js:65:1)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\user\\Desktop\\complete-javascript-course-master\\9-forkify\\starter\\node_modules\\webpack-dev-server\\bin\\webpack-dev-server.js'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! forkify@1.0.0 start: `webpack-dev-server --mode development --open`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the forkify@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-05-04T10_43_57_046Z-debug.log

C:\Users\user\Desktop\complete-javascript-course-master\9-forkify\starter>

请问可能有什么问题吗?

0 个答案:

没有答案