angular版本问题&compiler_cli_1.readConfiguration is not a function

问题一、angular版本问题

cielo@cielo-ThinkPad-E550:~/cprogrames/test-bna/angular-test$ ng serve
The serve command requires to be run in an Angular project, but a project definition could not be found.

用npm start也是同样的问题。

cielo@cielo-ThinkPad-E550:~/cprogrames/test-bna/angular-test$ npm start

> angular-test@0.0.1 start /home/cielo/cprogrames/test-bna/angular-test
> ng serve --proxy-config proxy.conf.js --host 0.0.0.0

The serve command requires to be run in an Angular project, but a project definition could not be found.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-test@0.0.1 start: `ng serve --proxy-config proxy.conf.js --host 0.0.0.0`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the angular-test@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/cielo/.npm/_logs/2019-04-12T13_09_57_716Z-debug.log

该问题解决方案:

ng update @angular/cli --migrate-only --from=1.7.3
https://stackoverflow.com/questions/53096996/angular-cli-error-the-serve-command-requires-to-be-run-in-an-angular-project-b


作者:低调奋进
来源:CSDN
原文:https://blog.csdn.net/zwbHUST/article/details/89024467
版权声明:本文为博主原创文章,转载请附上博文链接!

其实我也在starkoverflow看到了。

我的版本明明是7.3.8,但是–from=【】这块写7.3.8没有用。
不过运行了之后好了似乎。报了新的错误

问题二

红一片,我的心情不知道该如何描述。

cielo@cielo-ThinkPad-E550:~/cprogrames/test-bna/angular-test$ npm start

> angular-test@0.0.1 start /home/cielo/cprogrames/test-bna/angular-test
> ng serve --proxy-config proxy.conf.js --host 0.0.0.0
> 
compiler_cli_1.readConfiguration is not a function
TypeError: compiler_cli_1.readConfiguration is not a function
    at AngularCompilerPlugin._setupOptions (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:92:39)
    at new AngularCompilerPlugin (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:53:14)
    at _createAotPlugin (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/typescript.js:37:12)
    at Object.getNonAotConfig (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/typescript.js:43:19)
    at BrowserBuilder.buildWebpackConfig (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@angular-devkit/build-angular/src/browser/index.js:89:37)
    at DevServerBuilder.buildWebpackConfig (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@angular-devkit/build-angular/src/dev-server/index.js:108:46)
    at MergeMapSubscriber.rxjs_1.from.pipe.operators_1.concatMap [as project] (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@angular-devkit/build-angular/src/dev-server/index.js:36:40)
    at MergeMapSubscriber._tryNext (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/operators/mergeMap.js:69:27)
    at MergeMapSubscriber._next (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
    at MergeMapSubscriber.Subscriber.next (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/Subscriber.js:67:18)
    at TapSubscriber._next (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/operators/tap.js:65:26)
    at TapSubscriber.Subscriber.next (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/Subscriber.js:67:18)
    at MergeMapSubscriber.notifyNext (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
    at InnerSubscriber._next (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
    at InnerSubscriber.Subscriber.next (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/Subscriber.js:67:18)
    at SafeSubscriber.__tryOrUnsub (/home/cielo/cprogrames/test-bna/angular-test/node_modules/@angular-devkit/architect/node_modules/rxjs/internal/Subscriber.js:209:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-test@0.0.1 start: `ng serve --proxy-config proxy.conf.js --host 0.0.0.0`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the angular-test@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/cielo/.npm/_logs/2019-04-12T13_24_09_534Z-debug.log

解决方法:
据说仍然还是版本更新不彻底。只好强制一点了。

ng update @angular/compiler-cli --force

ok


ok了,我这样算是完整地跑了一个网页的例子了。

想哭。

相关文章

ANGULAR.JS:NG-SELECTANDNG-OPTIONSPS:其实看英文文档比看中...
AngularJS中使用Chart.js制折线图与饼图实例  Chart.js 是...
IE浏览器兼容性后续前言 继续尝试解决IE浏览器兼容性问题,...
Angular实现下拉菜单多选写这篇文章时,引用文章地址如下:h...
在AngularJS应用中集成科大讯飞语音输入功能前言 根据项目...
Angular数据更新不及时问题探讨前言 在修复控制角标正确变...