node.js - 无法在 Windows 10 上安装@vue/cli 3

标签 node.js windows vue.js npm command

我无法在全局或本地安装最新版本的 Vue。

对于这两个安装,我都有这个错误。我不明白为什么 Node 没有被识别为命令,因为它适用于其他包。

例如,使用 vue-cli 安装 Vue 2 可以完美运行。 高级系统里的路径我也查过了,添加到安装文件夹D:\Nodejs,系统变量和用户变量都有。

$ npm install -g @vue/cli
npm WARN deprecated hoek@5.0.4: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
C:\Users\huygh\AppData\Roaming\npm\vue -> C:\Users\huygh\AppData\Roaming\npm\node_modules\@vue\cli\bin\vue.js

> protobufjs@6.8.8 postinstall C:\Users\huygh\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\protobufjs
> node scripts/postinstall

'node' n'est pas reconnu en tant que commande interne
ou externe, un programme ex▒cutable ou un fichier de commandes.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\@vue\cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! protobufjs@6.8.8 postinstall: `node scripts/postinstall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the protobufjs@6.8.8 postinstall 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:
npm ERR!     C:\Users\huygh\AppData\Roaming\npm-cache\_logs\2018-12-19T09_25_36_393Z-debug.log

Angular 等其他包可以正常工作。 以下是其他全局包:

C:\Users\huygh\AppData\Roaming\npm
+-- @angular/cli@6.2.8
+-- cordova@8.1.2
+-- gulp-cli@2.0.1
+-- ionic@4.5.0
+-- nodemon@1.18.9
+-- npm@6.5.0
+-- npm-check@5.9.0
+-- sass@1.15.2
`-- serve@10.1.1

最佳答案

在 Windows 10 上:打开 start(Win 键)-> 键入:cmd -> 右键单击​​:命令提示符 -> 选择: 以管理员身份运行 -> 输入:npm install -g @vue/cli

注意:确保在安装之前运行 Node.js 版本 8.9 或更高版本(推荐 8.11.0+)。

关于node.js - 无法在 Windows 10 上安装@vue/cli 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53848287/

相关文章:

windows - 更改 desktop.ini 不会在 Windows 中自动更新文件夹图标

c++ - WinAPI ReportEvent - 未安装组件

windows - DynamoDb SocketException : A socket operation was attempted to an unreachable network

javascript - 一次清除所有表单字段,reactjs

Javascript:将日期转换为 UTC 格式

node.js - FFMPEG:如何结合视频和图像(视频模板)

node.js - 在 ubuntu 14.04 中安装最新的 nodejs 版本

typescript 将属性添加到 Vue 库定义

javascript - 在 Javascript (Vue.js) 中按多种美食过滤位置

javascript - 在 Vue.js + Vite.js 中禁用代码拆分( block )