嘿,所以我正在尝试通过 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
关于node.js - 无法安装 Vue CLI? (苹果系统),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62494949/