curiouswebster
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...
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._resolveFi lename (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_modul es/@angula r/cli/mode ls/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??
$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...
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._resolveFi
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_modul
at Module._compile (module.js:624:30)
at Object.Module._extensions.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It seemed to have worked:
R-MBP-2:~ newbieweb$ sudo npm install -g @angular/cli
Password:
/usr/local/bin/ng -> /usr/local/lib/node_module s/@angular /cli/bin/n g
+ @angular/cli@1.4.5
updated 7 packages in 50.258s
R-MBP-2:~ newbieweb$ sudo npm install -g @angular/cli
Password:
/usr/local/bin/ng -> /usr/local/lib/node_module
+ @angular/cli@1.4.5
updated 7 packages in 50.258s
ASKER
ASKER