javascript - 当我运行“npm install”时,我的终端上出现此错误消息“npm ERR!Linux 5.4.72-microsoft-standard-WSL2”
问题描述
我有这个错误信息:npm ERR! Linux 5.4.72-microsoft-standard-WSL2
当我运行时在我的终端上npm install
。我在一个 vue.js 应用程序上,自从我安装了 vuetify 后我就收到了这条消息。这是整个错误消息:
npm ERR! Linux 5.4.72-microsoft-standard-WSL2
npm ERR! argv "/home/josephine/.nvm/versions/node/v14.15.0/bin/node" "/home/josephine/.nvm/versions/node/v14.15.0/bin/npm" "install"
npm ERR! node v14.15.0
npm ERR! npm v3.10.10
npm ERR! cb.apply is not a function.
我也无法安装最新版本的 npm 我认为这与问题有关。(我有这个版本v3.10.10
)。当我跑步时,npm run serve
我有这个:
> vue-cli-service serve
sh: 1: vue-cli-service: not found
npm ERR! Linux 5.4.72-microsoft-standard-WSL2
npm ERR! argv "/home/josephine/.nvm/versions/node/v14.15.0/bin/node" "/home/josephine/.nvm/versions/node/v14.15.0/bin/npm" "run" "serve"
npm ERR! node v14.15.0
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! my-app@0.1.0 serve: vue-cli-service serve
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the my-app@0.1.0 serve script 'vue-cli-service serve'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the my-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! vue-cli-service serve
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs my-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls my-app
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?`.
我有 Vue.JS 版本@ vue / cli 4.5.12
。最后,我有一台 Window PC,我已经安装了 linux 和 ubuntu。如果你能帮助我,我提前感谢你。
解决方案
您的 npm 版本已过时。您的版本是 3.x,但我们目前是 7.x
跑
npm update -g
然后再试一次。
推荐阅读
- sql - 与不合作的反枢轴作斗争
- c - 如何从二进制文件中写入和读取动态数组
- git - 尽管没有人触及远程分支,但 git 阻止推送
- google-drive-api - Google Drive Activity API 是否适用于团队云端硬盘?
- python - 限制现有 memmap 的维度 (NumPy)
- regex - 正则表达式检查 url 是否有斜杠和参数
- typescript - source-map-loader 在哪里适合使用 Webpack 进行 TypeScript 编译?
- c# - 从 C# 到 SQL Server 的 GO 附近出错
- android - 尝试通过循环动态添加多个文本视图时应用程序崩溃。添加单个文本视图时效果很好
- scikit-learn - RandomForestRegressor,特征重要性