【发布时间】:2021-04-22 19:29:14
【问题描述】:
这里是新手,我正在尝试使用 npm 安装 vue cli 进行前端开发,但它会抛出错误。
这是sudo npm install -g @vue/cli的输出
[18:00 vue]$ sudo npm install -g @vue/cli
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-01-18T13_06_37_662Z-debug.log
我尝试了使用和不使用 sudo,同样的错误。
我的机器运行 Manjaro KDE 20.2,npm 版本 6.14.9,节点 v15.4.0。我试过了:
- 重试看看这次是否有效
-
sudo npm cache verify和sudo npm cache clean --force - 删除
/usr/lib/node_modules - 重新安装 node 和 npm
- 我在互联网上找到的任何其他内容
我被这个错误困扰了几天,感谢任何帮助。
有趣的是,它在没有 -g 标志的情况下工作,安装到当前文件夹,但我不知道如何使用 vue 命令。
【问题讨论】:
标签: vue.js npm npm-install vue-cli