angular2 업그레이드 angular6 과정에서 발생한 문제
ERROR in ./src/vendor.browser.ts
Module not found: Error: Can't resolve '@angular/core' in 'E:\mya4p\gtLbA4p\angular2-webpack-starter\src'
@ ./src/vendor.browser.ts 10:0-24
ERROR in ./src/vendor.browser.ts
Module not found: Error: Can't resolve '@angular/common' in 'E:\mya4p\gtLbA4p\angular2-webpack-starter\src'
@ ./src/vendor.browser.ts 11:0-26
ERROR in ./src/vendor.browser.ts
Module not found: Error: Can't resolve '@angular/forms' in 'E:\mya4p\gtLbA4p\angular2-webpack-starter\src'
@ ./src/vendor.browser.ts 12:0-25
ERROR in ./src/vendor.browser.ts
Module not found: Error: Can't resolve '@angular/http' in 'E:\mya4p\gtLbA4p\angular2-webpack-starter\src'
@ ./src/vendor.browser.ts 13:0-24
ERROR in ./src/vendor.browser.ts
Module not found: Error: Can't resolve '@angular/router' in 'E:\mya4p\gtLbA4p\angular2-webpack-starter\src'
@ ./src/vendor.browser.ts 14:0-26
ERROR in ./src/vendor.browser.ts
Module not found: Error: Can't resolve '@angularclass/hmr' in 'E:\mya4p\gtLbA4p\angular2-webpack-starter\src'
@ ./src/vendor.browser.ts 16:0-28
ERROR in ./src/main.browser.ts
Module not found: Error: Can't resolve '@angularclass/hmr' in 'E:\mya4p\gtLbA4p\angular2-webpack-starter\src'
@ ./src/main.browser.ts 7:12-40
ERROR in ./src/polyfills.browser.ts
Module not found: Error: Can't resolve 'zone.js/dist/zone' in 'E:\mya4p\gtLbA4p\angular2-webpack-starter\src'
@ ./src/polyfills.browser.ts 27:0-28
ERROR in ./src/polyfills.browser.ts
Module not found: Error: Can't resolve 'zone.js/dist/long-stack-trace-zone' in 'E:\mya4p\gtLbA4p\angular2-webpack-starter\src'
@ ./src/polyfills.browser.ts 35:4-49
ERROR in ./src/vendor.browser.ts
Module not found: Error: Can't resolve 'rxjs/add/operator/map' in 'E:\mya4p\gtLbA4p\angular2-webpack-starter\src'
@ ./src/vendor.browser.ts 18:0-32
ERROR in ./src/vendor.browser.ts
Module not found: Error: Can't resolve 'rxjs/add/operator/mergeMap' in 'E:\mya4p\gtLbA4p\angular2-webpack-starter\src'
@ ./src/vendor.browser.ts 19:0-37
ERROR in ./src/app/environment.ts
Module not found: Error: Can't resolve '@angular/core' in 'E:\mya4p\gtLbA4p\angular2-webpack-starter\src\app'
@ ./src/app/environment.ts 5:13-37
@ ./src/main.browser.ts
ERROR in ./src/app/app.module.ts
Module not found: Error: Can't resolve '@angular/core' in 'E:\mya4p\gtLbA4p\angular2-webpack-starter\src\app'
@ ./src/app/app.module.ts 2:13-37
@ ./src/app/index.ts
@ ./src/main.browser.ts
ERROR in ./src/app/app.module.ts
Module not found: Error: Can't resolve '@angular/forms' in 'E:\mya4p\gtLbA4p\angular2-webpack-starter\src\app'
@ ./src/app/app.module.ts 4:14-39
@ ./src/app/index.ts
@ ./src/main.browser.ts
ERROR in [default]
Cannot find type definition file for 'hammerjs'.
ERROR in [default]
Cannot find type definition file for 'jasmine'.
ERROR in [default]
Cannot find type definition file for 'node'.
ERROR in [default]
Cannot find type definition file for 'protractor'.
ERROR in [default]
Cannot find type definition file for 'selenium-webdriver'.
해결 방법
npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest typescript@latest --save
사실 업그레이드 과정에서 이 외에도 많은 문제가 발생했습니다. 마지막에 저는 돈의angular/cli를 해제하고 6.0 버전의cli를 다시 설치하여 프로젝트에 대한 의존을 다시 구축했습니다.UI 프레임워크 ng-zorro-antd를 도입했을 때 오류가 발생했습니다. 오류 2
ERROR in ./node_modules/ng-zorro-antd/src/ng-zorro-antd.less (./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/less-loader/dist/cjs.js??ref--15-3!./node_modules/ng-zorro-antd/src/ng-zorro-antd.less)
Module build failed:
// https://github.com/ant-design/ant-motion/issues/44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
in E:\projects\my-project
ode_modules
g-zorro-antd\src\style\color\bezierEasing.less (line 110, column 0)
해결 방법은 @angular/cli 6.0 버전을 구축할 때 less3.0을 다운로드했지만 less3.0은 자바스크립트 Enabled 옵션을 지원하지 않기 때문에 less2.7 버전 오류3로 다운받습니다.
ERROR in node_modules/@angular/cdk/overlay/typings/overlay-ref.d.ts(11,10): error TS2305: Module '"E:/projects/my-project/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@angular/cdk/overlay/typings/overlay-ref.d.ts(12,10): error TS2305: Module '"E:/projects/my-project/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/cdk/overlay/typings/position/connected-position-strategy.d.ts(12,10): error TS2305: Module '"E:/projects/my-project/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@angular/cdk/scrolling/typings/scroll-dispatcher.d.ts(10,10): error TS2305: Module '"E:/projects/my-project/node_modules/rxjs/Subscription"' has no exported member 'Subscription'.
node_modules/@angular/cdk/scrolling/typings/scroll-dispatcher.d.ts(11,10): error TS2305: Module '"E:/projects/my-project/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@angular/cdk/scrolling/typings/scrollable.d.ts(9,10): error TS2305: Module '"E:/projects/my-project/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@angular/cdk/scrolling/typings/viewport-ruler.d.ts(10,10): error TS2305: Module '"E:/projects/my-project/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/ng-zorro-antd/src/anchor/nz-anchor.component.d.ts(2,10): error TS2305: Module '"E:/projects/my-project/node_modules/rxjs/Subscription"' has no exported member 'Subscription'.
node_modules/ng-zorro-antd/src/auto-complete/nz-autocomplete.component.d.ts(2,10): error TS2305: Module '"E:/projects/my-project/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/ng-zorro-antd/src/carousel/nz-carousel.component.d.ts(2,10): error TS2305: Module '"E:/projects/my-project/node_modules/rxjs/Subscription"' has no exported member 'Subscription'.
해결 방법은 npm install --save rxjs를 실행해야 합니다 [email protected]상세히 보다https://github.com/NG-ZORRO/ng-zorro-antd/issues/1442rxjs-compat는 rxjs 5와 호환됩니다.x 오류4
npm ERR! path C:\Users\Administrator\AppData\Roaming
pm
g
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall open
npm ERR! Error: EPERM: operation not permitted, open 'C:\Users\Administrator\AppData\Roaming
pm
g'
npm ERR! { Error: EPERM: operation not permitted, open 'C:\Users\Administrator\AppData\Roaming
pm
g'
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, open 'C:\Users\Administrator\AppData\Roaming
pm
g'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'C:\\Users\\Administrator\\AppData\\Roaming\
pm\
g' },
npm ERR! stack: 'Error: EPERM: operation not permitted, open \'C:\\Users\\Administrator\\AppData\\Roaming\
pm\
g\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'C:\\Users\\Administrator\\AppData\\Roaming\
pm\
g' }
이 오류는angular/cli를 다운로드할 때 발생하는 해결 방법이 관리자로 실행되는지 안 되는지 마지막으로 파라미터를 추가하면 OK npm install-g @angular/cli-no-optiona
마지막으로 같은 업그레이드 과정에서 문제가 발생한 당신에게 어떤 기술 버전을 업그레이드할 때 이 기술의github에 관심을 가져야 한다는 조언을 드립니다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.