केवल जब मैं उत्पादन के लिए अपना ऐप बना रहा हूं, मुझे ionic cordova run android --prod
के बाद ionic-app-script
से build
चरण में Cannot find module '@angular/compiler-cli/ngtools2'
त्रुटि मिली है।
मेरे पास मेरी package.json
निर्भरता फ़ाइल है "@angular/compiler-cli": "^7.2.4",
और मेरे node_modules
फ़ोल्डर में देखकर मैं @angular/compiler-cli/ngtools2.js
देख सकता हूं
आयनिक-ऐप-स्क्रिप्ट इसे क्यों नहीं ढूंढ सकता?
पूर्ण त्रुटि:
$ ionic cordova run android --prod
> ionic-app-scripts build --prod --platform android
[10:08:45] ionic-app-scripts 3.2.2
[10:08:45] build prod started ...
[10:08:45] clean started ...
[10:08:45] clean finished in 24 ms
[10:08:45] copy started ...
[10:08:45] deeplinks started ...
[10:08:45] deeplinks finished in 84 ms
[10:08:45] ngc started ...
[10:08:47] ionic-app-script task: "build"
[10:08:47] Error: Cannot find module '@angular/compiler-cli/ngtools2'
Error: Cannot find module '@angular/compiler-cli/ngtools2'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at C:\Users\User\AppData\Roaming\npm\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:206:90
at <anonymous>
[ERROR] An error occurred while running subprocess ionic-app-scripts.
2 जवाब
मैंने अपनी देव निर्भरता को अद्यतन करने में उस समस्या को हल किया
"devDependencies": {
"@ionic/app-scripts": "^3.2.2",
"typescript": "~2.4.2"
},
अपना @angular/compiler-cli
संस्करण देखें। इसे कोणीय अन्य निर्भरताओं के साथ मिलान किया जाना चाहिए। मेरे मामले में, यह सीएलआई का उच्चतर संस्करण है।
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "^10.0.4",
"@angular/core": "5.2.11",
इसलिए, मैं इसे डाउनग्रेड करता हूं।
"@angular/compiler-cli": "5.2.11"
और यह पूरी तरह से काम करता है।
संबंधित सवाल
नए सवाल
ionic3
Ionic 3 Ionic का नया संस्करण है, एक खुला स्रोत SDK जो डेवलपर्स को मानक वेब तकनीकों (HTML, CSS और जावास्क्रिप्ट) का उपयोग करके मोबाइल एप्लिकेशन बनाने में सक्षम बनाता है। Ionic 3 को Angular4 और इसके बाद के संस्करण के साथ रखा गया है।