[英]Can't install @vue/cli 3 on Windows 10
我無法在全局或本地安裝最新版本的 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
-> 右鍵單擊: Command Prompt
-> 選擇: Run as Administer
-> 鍵入: npm install -g @vue/cli
。
注意:安裝前請確保您運行的是 Node.js 8.9 或更高版本(推薦 8.11.0+)。
以上回復都不適合我,無法通過 npm 安裝 vue(我有 Windows 7)。 我剛剛通過紗線安裝了 vue cli 3 並且它運行完美。
vue cli 3 好像有問題,暫時還是堅持版本2吧。可以在這里了解更多問題。
我用Node.js command prompt
解決了這個問題。 使用簡單的 cmd 找不到 vue,但是使用Node.js command prompt
可以輕松安裝( npm install -g @vue/cli
)並運行它( vue create example-project
)。
解決此問題的一種方法是卸載 Node 並重新安裝。 我的意思是,這種方法對我有用。 Go 到控制面板 -> 節點 -> 卸載
安裝節點后 - 你需要做的第一件事是安裝 Vue CLI - npm install -g @vue/cli
試試這個 ===> https://phoenixnap.com/kb/install-node-js-npm-on-windows它對我有用
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.