Programming/JavaScript & TypeScript
(Angular) Error - You can check this with `npm ls @ngtools/webpack`, and then remove the extra copies. 해결법
Bonita SY
2019. 1. 17. 15:48
728x90
○ ng build 또는 ng serve시 에러
ERROR in ./src/polyfills.ts
Module build failed: Error: Angular Compiler was detected but it was an instance of the wrong class.
This likely means you have several @ngtools/webpack packages installed. You can check this with `npm ls @ngtools/webpack`, and then remove the extra copies.
○ npm ls @ngtools/webpack 입력
+-- @angular/cli@1.6.3
| `-- @ngtools/webpack@1.9.3
`-- @ngtools/webpack@1.10.2
○ 해결방법
1.
rm -rf node_modules
2.
rm -rf package-lock.json
3.
npm cache clean -f
4.
npm install
5.
ng build
npm start
정상 동작!!
728x90