【问题标题】:Can't install @vue/cli 3 on Windows 10无法在 Windows 10 上安装 @vue/cli 3
【发布时间】:2019-05-19 18:31:12
【问题描述】:

我无法在全局或本地安装最新版本的 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

【问题讨论】:

    标签: node.js windows vue.js npm command


    【解决方案1】:

    vue cli 3好像有问题,暂时最好还是坚持2版本,可以详细了解这个问题here

    【讨论】:

    • 我通过使用 Windows 命令提示符(暂时)解决了我的问题。它允许我在全局范围内安装它并执行 npm run serve(在 Git Bash 中也是不可能的)。
    【解决方案2】:

    我用Node.js command prompt 解决了这个问题。使用简单的 cmd 找不到 vue,但使用 Node.js command prompt 很容易安装 (npm install -g @vue/cli) 并运行它 (vue create example-project)。

    【讨论】:

      【解决方案3】:

      以上回复都不适合我,无法通过 npm 安装 vue(我有 Windows 7)。我刚刚通过 yarn 安装了 vue cli 3,它运行良好。

      【讨论】:

        【解决方案4】:

        在 Windows 10 上:打开 start(Win 键)-> 键入:cmd -> 右键单击​​:Command Prompt -> 选择:Run as Administer -> 键入:npm install -g @vue/cli

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

        【讨论】:

        • 试过这个,运行了半个多小时,显然卡住了。
        • 做了这件事,但它对我不起作用:(并且使用节点 v8.11.3 得到“请使用管理员”仍然
        猜你喜欢
        • 1970-01-01
        • 2019-05-10
        • 2017-02-06
        • 1970-01-01
        • 2020-05-12
        • 2021-01-24
        • 1970-01-01
        • 2021-01-15
        • 2022-11-27
        相关资源
        最近更新 更多