Vue脚手架安装不上的问题

Vue脚手架安装不上的问题

Last login: Tue Nov 30 17:44:11 on ttys000
guohongwei@guohongweideMBP ~ % node -v
v16.13.0
guohongwei@guohongweideMBP ~ % npm -v
8.1.0
guohongwei@guohongweideMBP ~ % npm install nrm -g
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/nrm/cli.js
npm ERR! dest /usr/local/bin/nrm
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/nrm/cli.js' -> '/usr/local/bin/nrm'
npm ERR!  [Error: EACCES: permission denied, symlink '../lib/node_modules/nrm/cli.js' -> '/usr/local/bin/nrm'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../lib/node_modules/nrm/cli.js',
npm ERR!   dest: '/usr/local/bin/nrm'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/guohongwei/.npm/_logs/2021-11-30T09_49_53_534Z-debug.log
guohongwei@guohongweideMBP ~ % nrm ls
zsh: command not found: nrm
guohongwei@guohongweideMBP ~ %

相关截图:

https://img1.sycdn.imooc.com//climg/61a5f40d09889e5e11700742.jpg

问题描述:

老师的Mac电脑为什么安装不上您说的npm install nrm -g

正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕然然 2021-11-30 18:13:33

同学你好,猜测是权限的问题,建议在安装命令前面添加sudo试试,如下

sudo npm install nrm -g

祝学习愉快!

  • 提问者 果子呀 #1

    老师,按照您说的从新安装了一遍,在最后出现了这几行代码:
    npm ERR! code EEXIST
    npm ERR! path /usr/local/bin/vue
    npm ERR! EEXIST: file already exists
    npm ERR! File exists: /usr/local/bin/vue
    npm ERR! Remove the existing file and try again, or run npm
    npm ERR! with --force to overwrite files recklessly.

    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/guohongwei/.npm/_logs/2021-11-30T10_17_37_151Z-debug.log
    guohongwei@guohongweideMBP ~ %


    2021-11-30 18:18:58
  • 好帮手慕然然 回复 提问者 果子呀 #2

    同学你好,建议执行以下命令试试:

     sudo npm install nrm -g --force

    祝学习愉快!

    2021-11-30 18:30:51
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师