sudo npm install -g @vue/cli --unsafe-perm

sudo npm install -g @vue/cli

> 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/lilulu/Library/Caches/node-gyp/14.17.6"

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.5.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 v14.17.6

gyp ERR! node-gyp -v v5.1.0

gyp ERR! not ok 

> core-js-pure@3.17.3 postinstall /usr/local/lib/node_modules/@vue/cli/node_modules/core-js-pure

> node -e "try{require('./postinstall')}catch(e){}"

解决:sudo npm install -g @vue/cli --unsafe-perm

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容