Reputation: 71
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/[email protected]: 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/[email protected]: wanted: {"node":">= 10.13.0","npm":">= 6.11.0","loadDep:uuid -> get / |##########---------------------------------------|
WARN engine @angular-devkit/[email protected]: wanted: {"node":">= 10.13.0","npmloadDep:uuid -> get - |##########---------------------------------------|
WARN engine @angular-devkit/[email protected]: 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/[email protected]: wanted: {"node":">= 10.13.0","npm"loadDep:uuid -> get | |##########---------------------------------------|
WARN engine @schematics/[email protected]: wanted: {"node":">= 10.13.0","npm":">= 6.loadDep:uuid -> network | |##########---------------------------------------|
WARN engine @schematics/[email protected]: wanted: {"node":">= 10.13.0","npm":">= 6npm WARN deprecated [email protected]: 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/[email protected]
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.
Upvotes: 2
Views: 5766
Reputation: 545
i had the same problem:
Solutions is simple: Run the following commands one by one.
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 !!!!
Upvotes: 0
Reputation: 31
try this:
sudo npm uninstall -g @angular/cli
sudo npm cache clean --force
sudo npm install --force -g @angular/cli
Worked for me!
Upvotes: 1
Reputation: 28269
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.
Upvotes: 2
Reputation: 110
You have not write permission to create directory, try it with :
sudo npm install -g @angular/cli
Upvotes: 0