2

I am trying to install Angular/CLI onto my Ubuntu system.

Ubuntu 18.04.4 LTS 64 bit

 node -v


npm -v

npm version is 3.5.2

npm install -g @angular/cli

I have installed Node and its showing version as v8.10.0 but when I try to install Angular/cli It shows some error as below

 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.

Can anyone please help me to get rid of this error.

georgeawg
  • 48,608
  • 13
  • 72
  • 95
newCoder
  • 61
  • 1
  • 8
  • read this link, help you: https://stackoverflow.com/questions/42042300/angular-cli-install-error/42042619 – mohammad javad ahmadi Feb 16 '20 at 07:36
  • The error message clearly says wanted: {"node":">= 10.13.0","npm":">= 6.11.0"; your versions are way older. Just use a later node and npm. – Henry Feb 16 '20 at 08:51

4 Answers4

2

Seems like your NodeJS version is not compatible with your Angular CLI version. See the Angular CLI/Angular/NodeJS/Typescript compatibility details here

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

angularrocks.com
  • 26,767
  • 13
  • 87
  • 104
1

try this:

  sudo npm uninstall -g @angular/cli
  sudo npm cache clean --force
  sudo npm install --force -g @angular/cli

Worked for me!

ELDagoberto
  • 31
  • 1
  • 4
0

You have not write permission to create directory, try it with :

sudo npm install -g @angular/cli
Behzad Jafari
  • 110
  • 1
  • 6
0

i had the same problem:

Solutions is simple: Run the following commands one by one.

  1. sudo npm cache clean -f
  2. sudo npm install -g n
  3. sudo n stable

after that run the following command to create your new project.

ng new <projectName>

if still having problem then simply close the terminal and open again.

you are good to go !!!!

Pran Sukh
  • 207
  • 4
  • 12