最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Cannot read properties of undefined (reading 'write') - Stack Overflow

programmeradmin0浏览0评论

Hey guys I have a problem. I'm trying to open a project made in Angular 5.2.0 and its Angular/cli version is 1.7.4, my Angular/cli version is 14.0.7... I executed "npm install" and it doesn't give me any error, but when I write "ng version" to see the local version of angular, it gave me an error "Cannot read properties of undefined (reading 'write')", I tried to execute "ng serve --open" and doesn't work neither.

The steps I followed and their results were: 1.- npm install --> ok; 2.- ng version (to check if the Angular's package local version was installed) --> Error = "Cannot read properties of undefined (reading 'write')"; 3.- ng serve --open (to try open the app) --> Error = same as above.

Hey guys I have a problem. I'm trying to open a project made in Angular 5.2.0 and its Angular/cli version is 1.7.4, my Angular/cli version is 14.0.7... I executed "npm install" and it doesn't give me any error, but when I write "ng version" to see the local version of angular, it gave me an error "Cannot read properties of undefined (reading 'write')", I tried to execute "ng serve --open" and doesn't work neither.

The steps I followed and their results were: 1.- npm install --> ok; 2.- ng version (to check if the Angular's package local version was installed) --> Error = "Cannot read properties of undefined (reading 'write')"; 3.- ng serve --open (to try open the app) --> Error = same as above.

Share Improve this question edited Jul 22, 2022 at 2:51 ReiDevL asked Jul 22, 2022 at 0:48 ReiDevLReiDevL 231 silver badge6 bronze badges 3
  • My final goal is to update the application to newer angular version – ReiDevL Commented Jul 22, 2022 at 0:52
  • Please replace/supplement images of code/errors with plaintext versions. – jcalz Commented Jul 22, 2022 at 1:36
  • Please review the guidelines for How to Ask and try to provide a minimal reproducible example so that others can demonstrate your issue for themselves. – jcalz Commented Jul 22, 2022 at 1:37
Add a ment  | 

2 Answers 2

Reset to default 5

This error message is not helpful at all. It turns out it may be a wrong angular version.

Try downgrading to version 14.0.0.

npm -g i @angular/[email protected]

In my case, I discovered downgrading to any version 14 or below seemed to work, but that may not always be the case.

Please recreate incrementally with Angular v14.

发布评论

评论列表(0)

  1. 暂无评论