Angular CLI proxy configuration

Michael H. Source

I found some recommendations here how to configure a proxy server in Angular. Unfortunately, it doesn't work for me. In my package.json the start script is defined as:

"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\""

If I change this to:

"start": "ng serve --proxy-config proxy.conf.json"

as it was recommended I get some error messages when using npm start or directly enter ng serve --proxy-config proxy.conf.json in the command line:

T

he "@angular/compiler-cli" package was not properly installed.
Error: The "@angular/compiler-cli" package was not properly installed.
    at Object.<anonymous> (/Users/Shared/Projects/BSA/client/node_modules/@ngtools/webpack/src/index.js:14:11)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/Shared/Projects/BSA/client/node_modules/@angular/cli/tasks/eject.js:10:19)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)

Somebody any idea?

angularproxy

Answers

comments powered by Disqus