Newly created angular project has errors

for some unknown reason a freshly generated angular 14.1 project does not work. it seems like npm i will download corrupt libs. deleting node_modules won’t help.. the file (node_modules/@types/node/stream/web.d.ts) in my existing projects looks differently.. i wasn’t able to find anything similar on the internet… any idea? thanks!

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Error: node_modules/@types/node/stream/web.d.ts:484:13 - error TS2502: 'ReadableByteStreamController' is referenced directly or indirectly in its own type annotation.
484 var ReadableByteStreamController: typeof globalThis extends
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/@types/node/stream/web.d.ts:503:13 - error TS2502: 'ReadableStreamBYOBReader' is referenced directly or indirectly in its own type annotation.
503 var ReadableStreamBYOBReader: typeof globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T }
~~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/@types/node/stream/web.d.ts:513:13 - error TS2502: 'ReadableStreamBYOBRequest' is referenced directly or indirectly in its own type annotation.
513 var ReadableStreamBYOBRequest: typeof globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T }
~~~~~~~~~~~~~~~~~~~~~~~~~
</code>
<code>Error: node_modules/@types/node/stream/web.d.ts:484:13 - error TS2502: 'ReadableByteStreamController' is referenced directly or indirectly in its own type annotation. 484 var ReadableByteStreamController: typeof globalThis extends ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error: node_modules/@types/node/stream/web.d.ts:503:13 - error TS2502: 'ReadableStreamBYOBReader' is referenced directly or indirectly in its own type annotation. 503 var ReadableStreamBYOBReader: typeof globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T } ~~~~~~~~~~~~~~~~~~~~~~~~ Error: node_modules/@types/node/stream/web.d.ts:513:13 - error TS2502: 'ReadableStreamBYOBRequest' is referenced directly or indirectly in its own type annotation. 513 var ReadableStreamBYOBRequest: typeof globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T } ~~~~~~~~~~~~~~~~~~~~~~~~~ </code>
Error: node_modules/@types/node/stream/web.d.ts:484:13 - error TS2502: 'ReadableByteStreamController' is referenced directly or indirectly in its own type annotation.

484         var ReadableByteStreamController: typeof globalThis extends
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/@types/node/stream/web.d.ts:503:13 - error TS2502: 'ReadableStreamBYOBReader' is referenced directly or indirectly in its own type annotation.

503         var ReadableStreamBYOBReader: typeof globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T }
                ~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/@types/node/stream/web.d.ts:513:13 - error TS2502: 'ReadableStreamBYOBRequest' is referenced directly or indirectly in its own type annotation.

513         var ReadableStreamBYOBRequest: typeof globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T }
                ~~~~~~~~~~~~~~~~~~~~~~~~~

5

I had the same issue and just solved it in the following way.
Set the skipLibCheck flag to true in the angularCompilerOptions inside your tsconfig.json file.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>{
"angularCompilerOptions": {
"skipLibCheck": true
}
}
</code>
<code>{ "angularCompilerOptions": { "skipLibCheck": true } } </code>
{
  "angularCompilerOptions": {
    "skipLibCheck": true
  }
}

This tells TypeScript to skip type checking for third-party libraries, which can help avoid circular reference issues.

1

Downgrade “@types/node” in devDependencies of package.json. “ng new” puts the latest version for this dependency which has breaking changes for a few older features.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>"devDependencies": {
...
"@types/node": "^20.3.2",
...
}
</code>
<code>"devDependencies": { ... "@types/node": "^20.3.2", ... } </code>
"devDependencies": {
    ...
    "@types/node": "^20.3.2",
    ...
  }

1

In my case i was able to solve it because i had the package-lock.json of the project that i just cloned, if you have it you could use npm ci instead of npm install to make sure you have all the dependencies as before

Try change angular version. Of course, the best solution would be to use the latest stable version (~18.2.1) if there is no reason to work with such an old one.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật