如何解决 vue.js 安装问题
How to fix the problem with vue.js instalation
大家晚上好!
我正在尝试使用 npm 在我的 linux mint 上安装 vue.js。
当我运行vue教程中给出的简单命令:
npm install -g @vue/cli
经过一些警告后,终端出现以下错误:
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access \'/usr/local/lib\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib' }
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! and path to error log here
我明白了,“操作被我的操作系统拒绝了”
但我不知道如何解决它。如果有人帮助我,我将不胜感激,因为我想这是一个简单的问题
尝试sudo npm install -g @vue/cli
我在 Whosebug 的另一个讨论中找到了另一个解决方案:
npm throws error without sudo
基本上发生的事情是 NPM 没有访问权限 /usr/local/lib
。要授予它访问权限,您可以更改 ~/.npm
的所有权以属于您当前的用户。这可能是这样的:
sudo chown -R $(whoami) ~/.npm
这样你就不必 运行 npm
作为 sudo,这是不推荐的。我相信这是由于 npm 包中已知的漏洞造成的。
这是一篇关于它的文章:Don't use "sudo" with npm "install"
大家晚上好! 我正在尝试使用 npm 在我的 linux mint 上安装 vue.js。 当我运行vue教程中给出的简单命令:
npm install -g @vue/cli
经过一些警告后,终端出现以下错误:
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access \'/usr/local/lib\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib' }
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! and path to error log here
我明白了,“操作被我的操作系统拒绝了” 但我不知道如何解决它。如果有人帮助我,我将不胜感激,因为我想这是一个简单的问题
尝试sudo npm install -g @vue/cli
我在 Whosebug 的另一个讨论中找到了另一个解决方案: npm throws error without sudo
基本上发生的事情是 NPM 没有访问权限 /usr/local/lib
。要授予它访问权限,您可以更改 ~/.npm
的所有权以属于您当前的用户。这可能是这样的:
sudo chown -R $(whoami) ~/.npm
这样你就不必 运行 npm
作为 sudo,这是不推荐的。我相信这是由于 npm 包中已知的漏洞造成的。
这是一篇关于它的文章:Don't use "sudo" with npm "install"