Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

cordova - An unhandled exception occurred: Cannot find module '@angular-devkit

I'm a beginner, trying to make an app using Ionic-Cordova. When I type "ionic cordova build android", I get this error:

[error] Error: Cannot find module '@angular-devkit/build-angular/src/angular-cli- 
files/models/webpack-configs/utils'
Require stack:
C:UsersHphavadurumu
ode_modules@ionicangular-toolkituildersutilsindex.js
C:UsersHphavadurumu
ode_modules@ionicangular-toolkituilderscordova-buildindex.js
C:UsersHphavadurumu
ode_modules@angular-devkitarchitect
ode
ode-modules-architect-host.js
C:UsersHphavadurumu
ode_modules@angular-devkitarchitect
odeindex.js
C:UsersHphavadurumu
ode_modules@angularclimodelsarchitect-command.js
C:UsersHphavadurumu
ode_modules@angularclicommands
un-impl.js
C:UsersHphavadurumu
ode_modules@angular-devkitschematicsoolsexport-ref.js
C:UsersHphavadurumu
ode_modules@angular-devkitschematicsoolsindex.js
C:UsersHphavadurumu
ode_modules@angularcliutilitiesjson-schema.js
C:UsersHphavadurumu
ode_modules@angularclimodelscommand-runner.js
C:UsersHphavadurumu
ode_modules@angularclilibcliindex.js
C:UsersHphavadurumu
ode_modules@angularclilibinit.js
C:UsersHphavadurumu
ode_modules@angularcliin
g
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:UsersHphavadurumu
ode_modules@ionicangular- 
toolkituildersutilsindex.js:3:17)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)* 

I read that the error might be related to the missing node_modules folder, but it's not missing in my project. I've also tried to uninstall-reinstall the Npm, it didn't work either.

Thanks in advance.

EDIT Here is my package.json file:

"private": true,
"dependencies": {
"@angular/common": "~10.0.0",
"@angular/core": "~10.0.0",
"@angular/forms": "~10.0.0",
"@angular/platform-browser": "~10.0.0",
"@angular/platform-browser-dynamic": "~10.0.0",
"@angular/router": "~10.0.0",
"@ionic-native/core": "^5.0.0",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/status-bar": "^5.0.0",
"@ionic/angular": "^5.0.0",
"rxjs": "~6.5.5",
"tslib": "^2.0.0",
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.1101.0",
"@angular/cli": "~10.0.5",
"@angular/compiler": "~10.0.0",
"@angular/compiler-cli": "~10.0.0",
"@angular/language-service": "~10.0.0",
"@ionic/angular-toolkit": "^2.3.0",
"@ionic/lab": "3.2.10",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"cordova-android": "^9.0.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.2.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~3.3.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.9.5"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
  "cordova-plugin-whitelist": {},
  "cordova-plugin-statusbar": {},
  "cordova-plugin-device": {},
  "cordova-plugin-splashscreen": {},
  "cordova-plugin-ionic-webview": {
    "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
  },
  "cordova-plugin-ionic-keyboard": {}
 },
 "platforms": [
  "android"
question from:https://stackoverflow.com/questions/65835238/an-unhandled-exception-occurred-cannot-find-module-angular-devkit

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...