I've tried installing the Angular compiler-cli (ngc) using:
npm install @angular/compiler-cli typescript @angular/platform-server @angular/compiler
And the install appears to have worked, but now when I run ngc -p src
, per the solution to this question, I get:
module.js:442
throw err;
^
Error: Cannot find module '@angular/core'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at /usr/local/lib/node_modules/@angular/compiler/bundles/compiler.umd.js:7:83
at Object.<anonymous> (/usr/local/lib/node_modules/@angular/compiler/bundles/compiler.umd.js:10:2)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
My project runs fine with ng serve
. What am I doing wrong here?