运行项目时报错

来源:6-1 Vue项目预热 - 环境配置

雅兰心诺

2018-07-28

1.$ npm install

npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.

npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features!

npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.

npm WARN notice [SECURITY] mime has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=mime&version=1.3.6 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.


2.$ npm run dev

> vue-travel@1.0.0 dev C:\Users\15873\Desktop\vue-travel

> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js


'webpack-dev-server' ▒▒▒▒▒ڲ▒▒▒▒ⲿ▒▒▒Ҳ▒▒▒ǿ▒▒▒▒еij▒▒▒

▒▒▒▒▒▒▒▒▒ļ▒▒▒

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! vue-travel@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the vue-travel@1.0.0 dev script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm WARN Local package.json exists, but node_modules missing, did you mean to install?


npm ERR! A complete log of this run can be found in:

npm ERR!     C:\Users\15873\AppData\Roaming\npm-cache\_logs\2018-07-28T00_57_00_759Z-debug.log


写回答

1回答

Dell

2018-07-29

npm install webpack-dev-server -g 试试

2
5
明月之乡
回复
雅兰心诺
试试这个方法,我和你的问题是一样的,我是用这个方法解决的。 解决:原因是因为你的node_modules有意外改动,导致依赖库不完整。 删除项目下的node_modules,在你的项目目录下,重新执行npm install,这会重新生成node_modules, 执行npm run build , npm run dev.
2018-10-27
共5条回复

Vue2.5-2.6-3.0开发去哪儿网App 零基础入门到实战

课程紧跟Vue3版本迭代,企业主流版本Vue2+Vue3全掌握

10675 学习 · 8191 问题

查看课程