Vue-cli 3:“命令失败:npm install --loglevel 错误"; [英] Vue-cli 3: "command failed: npm install --loglevel error"

查看:74
本文介绍了Vue-cli 3:“命令失败:npm install --loglevel 错误";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我尝试创建一个新项目(vue create my-project)时,我都会收到这个错误:

Every time I try to create a new project (vue create my-project), I get this error:

错误:命令失败:npm install --loglevel 错误

ERROR : command failed: npm install --loglevel error

我使用的是 PC/Windows 10、Vue-cli 3.2.1、Node 8.11.3、Npm 5.6.0.预设:巴别塔、ESLint &Prettier、SASS、Vue 路由器、Vuex

I'm on PC / Windows 10, Vue-cli 3.2.1, Node 8.11.3, Npm 5.6.0. Presets: Babel, ESLint & Prettier, SASS, Vue router, Vuex

来自日志:

2736 傻saveTree`-- vuex@3.0.1

2736 silly saveTree `-- vuex@3.0.1

2737 warn ajv-keywords@2.1.1 需要 ajv@^5.0.0 的对等点,但没有安装.您必须自己安装对等依赖项.

2737 warn ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.

2738 详细堆栈错误:EINVAL:无效参数,读取

2738 verbose stack Error: EINVAL: invalid argument, read

知道这意味着什么以及如何解决吗?

Any idea what that means and how to solve it?

我发现排除任何 lint 功能会使问题消失.所以问题变成了:我怎样才能仍然使用 linting 并使其工作?

I figured out that excluding any lint feature makes the problem disappear. So the question becomes: how can I still use linting and make it work?

推荐答案

尝试

npm cache clean --force 

如果它不起作用然后手动删除 %appdata%\npm-cache 文件夹.然后再次尝试创建项目.

If it doesn't work then manually delete %appdata%\npm-cache folder. Then try to create the project again.

这篇关于Vue-cli 3:“命令失败:npm install --loglevel 错误";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆