Linux 在Ubuntu上安装Angular CLI
我正在开发xubuntu 16.04 LTS版本,并试图在我的机器上安装Angular cli。我已经尝试过删除、清理npm缓存,然后重新安装,但没有效果。当我在控制台中写入Linux 在Ubuntu上安装Angular CLI,linux,angular-cli,Linux,Angular Cli,我正在开发xubuntu 16.04 LTS版本,并试图在我的机器上安装Angular cli。我已经尝试过删除、清理npm缓存,然后重新安装,但没有效果。当我在控制台中写入npm install-g@angular/cli时,出现以下错误: $ npm install -g @angular/cli npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/@angular/cli/node_mo
npm install-g@angular/cli
时,出现以下错误:
$ npm install -g @angular/cli
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/@angular/cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.4.0-78-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "@angular/cli"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! path /usr/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /home/papamilo/npm-debug.log
尝试以root用户身份运行它,如下所示:
$ sudo npm install -g @angular/cli