angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

not able to install angular js on linux lite.

Open naivedeveloper95 opened this issue 8 years ago • 10 comments

ang

I am trying to install angular-cli on linux lite. I have installed nodejs. root@LinuxLite-Notebook-PC:~# node -v v9.5.0

What should I do? How to intsall angular-cli on linux lite. I ran the sudo npm install -g @angular/cli command, got errors that I have listed below.

root@LinuxLite-Notebook-PC:~# sudo npm install -g @angular/cli npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! path /usr/local/bin/ng npm ERR! code EEXIST npm ERR! Refusing to delete /usr/local/bin/ng: ../lib/node_modules/angular-cli/bin/ng symlink target is not controlled by npm /usr/local/lib/node_modules/@angular/cli npm ERR! File exists: /usr/local/bin/ng npm ERR! Move it away, and try again.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2018-02-15T10_49_29_898Z-debug.log

naivedeveloper95 avatar Feb 15 '18 17:02 naivedeveloper95

First I installed yarn https://yarnpkg.com/en/docs/install

Then this worked yarn global add @angular/cli

dny238 avatar Feb 17 '18 22:02 dny238

I was about to jump off the cliff. You just saved my life. Thanks!

ang

naivedeveloper95 avatar Feb 18 '18 13:02 naivedeveloper95

I have been having the same issue The way i got to to install was by: two root shell or sudo su one one: npm install -g @angular/cli on the second: cd /usr/lib/node_modules/@angular/

after a bit the following message starts repeatedly appearing on the first terminal

gyp verb command install [ '8.9.4' ]
gyp verb install input version string "8.9.4"
gyp verb install installing version: 8.9.4
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 8.9.4
gyp verb ensuring nodedir is created /usr/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.9.4
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.9.4"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp"
gyp verb tmpdir == cwd automatically will remove dev files after to save disk space

So on the second terminal i did chmod a+rwx cli/ -R

after this the message stopped and the install continued as it should have.

I had this same problem in the last hour, and this allowed me to install angular, so far i have seen no issues with the installation.

BTW: I did this on a fresh install of ubuntu 16.04lts from the minimalist instalation (https://help.ubuntu.com/community/Installation/MinimalCD)

lrebelo avatar Feb 18 '18 19:02 lrebelo

I have the same problem doing the installation on my fedora 27 from a sudoer user, however i can install under root using

su
npm install @angular/cli -g

but im getting this warning

# npm install @angular/cli -g
/usr/bin/ng -> /usr/lib/node_modules/@angular/cli/bin/ng
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/@angular/cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ @angular/[email protected]
updated 1 package in 169.503s

how can i install that peer dependency?

pablohectorg avatar Feb 19 '18 02:02 pablohectorg

Not sure if I did the right thing but, since none of the suggestions worked for me, I took the

You must install peer dependencies yourself.

...literraly. So I just went:

npm i ajv@^6.0.0

And the warning is gone.

andrei-gheorghiu avatar Feb 19 '18 04:02 andrei-gheorghiu

Should it be in DevDependencies or Dependencies ? if it's related to AngularCli i would put it in DevDependencies, but am i right?

Korigoth avatar Feb 19 '18 14:02 Korigoth

@Korigoth yes, I added it as DevDep.

andrei-gheorghiu avatar Feb 20 '18 11:02 andrei-gheorghiu

Closing as the original issue appears to be solved and the peer dependency issue is being tracked here: #9691

clydin avatar Feb 20 '18 20:02 clydin

yarn is a good solution. That worked on mac as well.

ajeets1978 avatar Feb 21 '18 23:02 ajeets1978

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.