0

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?

Ali Akbarpour
  • 958
  • 2
  • 18
  • 35
Michael H.
  • 471
  • 2
  • 9
  • 22
  • Possible duplicate of [angular-cli server - how to proxy API requests to another server?](https://stackoverflow.com/questions/37172928/angular-cli-server-how-to-proxy-api-requests-to-another-server) – Shanil Fernando Jul 12 '17 at 17:32
  • What are the error messages? Please post them as part of your question. – Timour Jul 12 '17 at 17:33
  • Here my command and the resulting first few messages: ng serve --proxy-config proxy.conf.json The "@angular/compiler-cli" package was not properly installed. Error: The "@angular/compiler-cli" package was not properly installed. at Object. (/Users/Shared/Projects/BSA/client/node_modules/@ngtools/webpack/src/index.js:14:11) at Module._compile (module.js:571:32) – Michael H. Jul 12 '17 at 20:05
  • Hi, I resolved it after re-installing angluare and cli. Also didnt use the quickstart. Now it works - even I dont know exactly why. – Michael H. Aug 07 '17 at 12:09

0 Answers0