gpt4 book ai didi

node.js - 我无法将 Angular/Cli 安装到我的 ubuntu 18 系统上

转载 作者:行者123 更新时间:2023-12-04 18:28:55 29 4
gpt4 key购买 nike

我正在尝试将 Angular/CLI 安装到我的 Ubuntu 系统上。

Ubuntu 18.04.4 LTS 64 bit


 node -v


npm -v

npm 版本为 3.5.2
npm install -g @angular/cli

我已安装 Node 及其显示版本为 v8.10.0 但是当我尝试安装 Angular/cli 它显示一些错误如下
 npm install -g @angular/cli
- |---------------------------------------------------------------------------|
WARN engine @angular/cli@9.0.2: wanted: {"node":">= 10.13.0","npm":">= 6.11.0","yarn":">= 1.13.0"} (current: {"node":"8.10.0","npm":"3.5.2"})
WARN engine @angular/cli@9.0.2: wanted: {"node":">= 10.13.0","npm":">= 6.11.0","loadDep:uuid -> get / |##########---------------------------------------|
WARN engine @angular-devkit/architect@0.900.2: wanted: {"node":">= 10.13.0","npmloadDep:uuid -> get - |##########---------------------------------------|
WARN engine @angular-devkit/core@9.0.2: wanted: {"node":">= 10.13.0","npm":">= 6.11.0","yarn":">= 1.13.0"} (current: {"node":"8.10.0","npm":"3.5.2"})
WARN engine @angular-devkit/schematics@9.0.2: wanted: {"node":">= 10.13.0","npm"loadDep:uuid -> get | |##########---------------------------------------|
WARN engine @schematics/angular@9.0.2: wanted: {"node":">= 10.13.0","npm":">= 6.loadDep:uuid -> network | |##########---------------------------------------|
WARN engine @schematics/update@0.900.2: wanted: {"node":">= 10.13.0","npm":">= 6npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/@angular/cli
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/@angular
/usr/local/lib
`-- @angular/cli@9.0.2

npm ERR! Linux 5.3.0-28-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "@angular/cli"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! path /usr/local/lib/node_modules/@angular/cli
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/@angular/cli'
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules/@angular/cli'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules/@angular/cli' }
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/sagar/npm-debug.log
sagar@sagar-HP-Notebook:~$ ng -v
Node.js version v8.10.0 detected.
The Angular CLI requires a minimum Node.js version of either v10.13 or v12.0.


ng -v

Node.js version v8.10.0 detected.
The Angular CLI requires a minimum Node.js version of either v10.13 or v12.0.

谁能帮我摆脱这个错误。

最佳答案

似乎您的 NodeJS 版本与您的 Angular CLI 版本不兼容。见 Angular CLI/Angular/NodeJS/Typescript兼容性详情 here

Also I would recommend to use NVM to manage NodeJS - this way you can switch between NodeJS versions with ease.

关于node.js - 我无法将 Angular/Cli 安装到我的 ubuntu 18 系统上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60246337/

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