Angular CLI代理配置

时间:2017-07-12 17:26:33

标签: angular proxy

我在这里找到了一些如何在Angular中配置代理服务器的建议。不幸的是,它对我不起作用。在我的package.json中,启动脚本定义为:

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

如果我将其更改为:

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

因为建议我在使用npm start或在命令行中直接输入ng serve --proxy-config proxy.conf.json时收到一些错误消息:

Ť

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)

有人有什么想法吗?

0 个答案:

没有答案