Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

Node.js / Angular : permissions problems

After running the following:

$sudo n stable

I got this version response for Node:

$ node -v
v8.6.0

I then ran:

$npm install -g @angular/cli

but got permission errors which suggested I run the command  as root.
 
So, I tried:

$sudo su
(added my password)

$npm install -g @angular/cli
but get bad sounding warnings...


User generated image
I killed the process, but need to get Angular installed. What can I do?

I get the following error when I try and start the server, whether I am root or have exited root:

sh-3.2# ng serve
module.js:529
    throw err;
    ^

Error: Cannot find module '@ngtools/json-schema'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/@angular/cli/models/config/config.js:7:23)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)

Is this an Old version of Node??
ASKER CERTIFIED SOLUTION
Avatar of Justin Estrada
Justin Estrada

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of curiouswebster

ASKER

no. Do I need to uninstall first?
It seemed to have worked:

R-MBP-2:~ newbieweb$ sudo npm install -g @angular/cli
Password:
/usr/local/bin/ng -> /usr/local/lib/node_modules/@angular/cli/bin/ng
+ @angular/cli@1.4.5
updated 7 packages in 50.258s