简体   繁体   中英

Unable to run angular program

When I run ng serve I am facing error like:

ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'zone.js/dist/zone' Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ ** i 「wdm」: Failed to compile.

Link for the error image: https://ibb.co/6bWBYps

In the polyfill.ts folder, change the import from

import 'zone.js/dist/zone';  // Included with Angular CLI.

To This:

import 'zone.js';

Read more on the package here: https://www.npmjs.com/package/zone.js?activeTab=readme

Note: This is using Angular 9 and "zone.js": "~0.8.26"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM