gpt4 book ai didi

linux - 在 Ubuntu 上设置 Angular CLI

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:46:22 25 4
gpt4 key购买 nike

我正在开发 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_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

关于linux - 在 Ubuntu 上设置 Angular CLI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44114670/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com