微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

> [email protected] 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! [email protected] 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 [email protected] 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

> [email protected] 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! [email protected] 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 [email protected] 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了,我这样算是完整地跑了一个网页的例子了。

想哭。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐