[英]Can't install Vue CLI? (MacOS)
嘿,所以我正在嘗試通過 npm ( sudo npm install -g @vue/cli
) 安裝 Vue,我只是收到一堆警告和錯誤,我無法真正理解它,也不知道它為什么會發生。 ..
npm WARN deprecated request@2.88.2: request has been deprecated, see [`https://github.com/request/request/issues/3142`](https://github.com/request/request/issues/3142) npm WARN deprecated resolve-url@0.2.1: [`https://github.com/lydell/resolve-url#deprecated`](https://github.com/lydell/resolve-url#deprecated) npm WARN deprecated urix@0.1.0: Please see [`https://github.com/lydell/urix#deprecated`](https://github.com/lydell/urix#deprecated) npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. /usr/local/bin/vue -> /usr/local/lib/node_modules/@vue/cli/bin/vue.js > fsevents@1.2.13 install /usr/local/lib/node_modules/@vue/cli/node_modules/fsevents` > node install.js gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/Users/jamesecroyd/Library/Caches/node-gyp/12.18.0" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/@vue/cli/node_modules/fsevents/.node-gyp" gyp WARN install got an error, rolling back install gyp WARN install got an error, rolling back install gyp ERR: configure error gyp ERR: stack Error, EACCES. permission denied. mkdir '/usr/local/lib/node_modules/@vue/cli/node_modules/fsevents/.node-gyp' gyp ERR. System Darwin 18.7.0 gyp ERR. command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/local/lib/node_modules/@vue/cli/node_modules/fsevents gyp ERR! node -v v12.18.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok
有人知道為什么會這樣嗎? 我已經多次安裝和卸載Vue,沒有運氣...
使用 NPM 的--unsafe-perm
標志:
sudo npm install -g @vue/cli --unsafe-perm
以這種方式修復了我的 Mac 安裝:
sudo npm uninstall -g @vue/cli
sudo npm install -g @vue/cli --unsafe-perm
sudo npm install -g vue@3.0.0-rc.9
在第 3 步之后,“vue --version”命令此時會打印“@vue/cli 4.5.4”,但它之前會這樣做。
因此,為了進行真正的測試,我在 vue ui 中創建了一個新項目,這比我在最初遇到問題的 vue cli 安裝后創建的第一個項目花費的時間要長得多(30+ 秒)。
這個新項目有效! -- I clicked "serve" in the Tasks window, can see a clean build in the Output window, and the demo page loads at http://localhost:8080/
like it supposed to, Welcome to Your Vue.js App. ETC...
我有同樣的問題只是運行這個命令
sudo npm 卸載 -g @vue/cli
首先檢查您是否安裝了 npm 和節點
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.