vue-cli创建项目npm install错误

npmWARNdeprecatedsocks@1.1.10:Ifusing2.xbranch,pleaseupgradetoatleast2.1.6toavoidaser... npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at leas
t 2.1.6 to avoid a serious bug with socket data flow and an import issue introdu
ced in 2.1.0

> phantomjs-prebuilt@2.1.16 install D:\test\vue-demo\node_modules\phantomjs-preb
uilt
> node install.js

npm WARN fsevents@1.2.0 had bundled packages that do not match the required vers
ion(s). They have been replaced with non-bundled versions.
npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed.
You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.0 (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.0: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

npm ERR! file C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Node.js
npm ERR! path C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Node.js
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Node
.js
npm ERR! phantomjs-prebuilt@2.1.16 install: `node install.js`
npm ERR! spawn C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Node.js ENOE
NT
npm ERR!
npm ERR! Failed at the phantomjs-prebuilt@2.1.16 install script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Program Files\nodejs\node_cache\_logs\2018-04-22T08_42_31_098Z-d
ebug.log
展开
 我来答
DoramiHe
2018-04-22 · 知道合伙人互联网行家
DoramiHe
知道合伙人互联网行家
采纳数:25332 获赞数:59542
2011年中山职业技术学院毕业,现担任毅衣公司京东小二

向TA提问 私信TA
展开全部
今日使用 npm init webpack love 创建一个新项目,然后执行 npm run dev 之后项目报错,提示错误如下:
没有给这些选项指定值:config-name, context, entry, module-bind, module-bind-post, module-bind-pre, output-path, output-filename, output-chunk-filename, output-source-map-filename, output-public-path, output-jsonp-function, output-library, output-library-target, records-input-path, records-output-path, records-path, define, target, watch-aggregate-timeout, devtool, resolve-alias, resolve-extensions, resolve-loader-alias, optimize-max-chunks, optimize-min-chunk-size, prefetch, provide, plugin, open-page npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! love@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 love@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:
经过排查,发现是 webpack 的新版本的BUG,解决方法就是卸载新版本,安装老版本。

命令如下:
npm remove webpack-dev-server npm install webpack-dev-server@2.9.1 npm run dev
然后项目就正常了。目前确定是 webpack-dev-server@2.10.0 的 BUG。在其发布新版本解决问题之前,先安装老版本解决问题吧。

如果不能解决问题,请在评论中留言。

以上这篇解决vue-cli + webpack 新建项目出错的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
您可能感兴趣的文章:vue-cli webpack模板项目搭建及打包时路径问题的解决方法浅谈vue+webpack项目调试方法步骤webpack vue 项目打包生成的文件,资源文件报404问题的修复方法(总结篇)详解vue-cli 构建Vue项目遇到的坑解决vue+webpack打包路径的问题
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式