qq_41950999
YP_LiYa
采纳率0%
2019-06-16 01:11 阅读 29.1k

运行Vue项目时,报错npm ERR! errno 1 npm ERR! Failed at the single@1.0.0 dev script.

运行Vue项目时,报错,不清楚是哪里出了问题

Error: Cannot find module 'webpack-cli/bin/config-yargs'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (E:\HBuilderProjects\Vue\single\node_modules\_webpack-dev-server@3.7.1@webpack-dev-server\bin\webpack-dev-server.js:60:1)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! single@1.0.0 dev: `webpack-dev-server --open --hot --port 8020`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the single@1.0.0 dev 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\asus\AppData\Roaming\npm-cache\_logs\2019-06-15T16_43_01_654Z-debug.log

这个是package.json文件

{
  "name": "single",
  "version": "1.0.0",
  "description": "",
  "main": "main.js",
  "scripts": {
    "dev": "webpack-dev-server --open --hot --port 8020"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "vue": "^2.6.10"
  },
  "devDependencies": {
    "babel-core": "^6.26.3",
    "babel-loader": "^8.0.6",
    "babel-preset-env": "^1.7.0",
    "css-loader": "^3.0.0",
    "file-loader": "^4.0.0",
    "vue-html-loader": "^1.2.4",
    "vue-loader": "^15.7.0",
    "vue-style-loader": "^4.1.2",
    "vue-template-compiler": "^2.6.10",
    "webpack": "^4.34.0",
    "webpack-dev-server": "^3.7.1"
  }
}

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

相关推荐