在安装cordova plugin
并使用“ npm audit fix
”之后,我卡在了问题上。
现在,如果我想尝试serve my app
,我会收到此消息:
[ng]发生未处理的异常:找不到模块 '@ angular / compiler-cli / ngcc'[ng]参见 的“ C:\ Users \ Jorden \ AppData \ Local \ Temp \ ng-1VnycD \ angular-errors.log” 进一步的细节。
[错误] ng意外关闭(退出代码127)。
离子CLI将退出。请检查上面的任何输出是否有错误 详细信息。
我尝试了许多发现的解决方案,但是这些解决方案都不适合我。
这里是angular-errors.log
:
[错误]错误:找不到模块'@ angular / compiler-cli / ngcc'
在Function.Module._resolveFilename(internal / modules / cjs / loader.js:582:15)
在Function.Module._load(internal / modules / cjs / loader.js:508:25)
在Module.require(internal / modules / cjs / loader.js:637:17)
在要求时(internal / modules / cjs / helpers.js:22:18)
在对象。 (C:\ Users \ Jorden \ Desktop \ Ionic \ myApp \ node_modules @ ngtools \ webpack
\ src \ ngcc_processor.js:10:16)
在Module._compile(内部/模块/cjs/loader.js:701:30)
在Object.Module._extensions..js(internal / modules / cjs / loader.js:712:10)
在Module.load(internal / modules / cjs / loader.js:600:32)
在tryModuleLoad(internal / modules / cjs / loader.js:539:12)
在Function.Module._load(internal / modules / cjs / loader.js:531:3)
在Module.require(internal / modules / cjs / loader.js:637:17)
在要求时(internal / modules / cjs / helpers.js:22:18)
在对象。 (C:\ Users \ Jorden \ Desktop \ Ionic \ myApp \ node_modules @ ngtools \ webpack \ src \ angular_compiler_plugin.js:23:26)
在Module._compile(内部/模块/cjs/loader.js:701:30)
在Object.Module._extensions..js(internal / modules / cjs / loader.js:712:10)
在Module.load(internal / modules / cjs / loader.js:600:32)
还有我的 package.json :
{“ name”:“ myApp”,“ version”:“ 0.0.1”,“ author”:“ Ionic
框架”,“主页”:“ https://ionicframework.com/”,“脚本”:
{
“ ng”:“ ng”,
“ start”:“ ng serve”,
“ build”:“ ng build”,
“ test”:“ ng test”,
“ lint”:“ ng lint”,
“ e2e”:“ ng e2e”},“ private”:true,“ dependencies”:{
“ @ angular / common”:“ ^ 7.2.2”,
“ @ angular / core”:“ ^ 7.2.2”,
“ @ angular / forms”:“ ^ 7.2.2”,
“ @ angular / http”:“ ^ 7.2.2”,
“ @ angular / platform-browser”:“ ^ 7.2.2”,
“ @ angular / platform-browser-dynamic”:“ ^ 7.2.2”,
“ @ angular / router”:“ ^ 7.2.2”,
“ @ ionic-native / core”:“ ^ 5.0.0”,
“ @ ionic-native / in-app-browser”:“ ^ 5.18.0”,
“ @ ionic-native / social-sharing”:“ ^ 5.14.0”,
“ @ ionic-native / splash-screen”:“ ^ 5.14.0”,
“ @ ionic-native / status-bar”:“ ^ 5.0.0”,
“ @ ionic / angular”:“ ^ 4.1.0”,
“ @ ionic / storage”:“ ^ 2.2.0”,
“ cordova-android”:“ ^ 8.1.0”,
“ cordova-browser”:“ 6.0.0”,
“ cordova-ios”:“ 5.1.1”,
“ cordova-plugin-inappbrowser”:“ ^ 3.1.0”,
“ cordova-plugin-splashscreen”:“ ^ 5.0.2”,
“ cordova-plugin-x-socialsharing”:“ ^ 5.6.0”,
“ cordova-sqlite-storage”:“ ^ 3.3.0”,
“ core-js”:“ ^ 2.5.4”,
“ es6-promise-plugin”:“ ^ 4.2.2”,
“ rxjs”:“〜6.5.1”,
“ tslib”:“ ^ 1.9.0”,
“ woocommerce-api”:“ ^ 1.4.2”,
“ zone.js”:“〜0.8.29”},“ devDependencies”:{
“ @ angular-devkit / architect”:“ ^ 0.803.21”,
“ @ angular-devkit / build-angular”:“ ^ 0.803.21”,
“ @ angular-devkit / core”:“ ^ 7.3.9”,
“ @ angular-devkit / schematics”:“ ^ 8.3.21”,
“ @ angular / cli”:“ ^ 8.3.21”,
“ @ angular / compiler”:“〜7.2.2”,
“ @ angular / compiler-cli”:“〜7.2.2”,
“ @ angular / language-service”:“〜7.2.2”,
“ @ ionic / angular-toolkit”:“〜1.5.1”,
“ @ types / jasmine”:“〜2.8.8”,
“ @ types / jasminewd2”:“〜2.0.3”,
“ @ types / node”:“ ^ 12.6.8”,
“ codelyzer”:“〜4.5.0”,
“ cordova-plugin-device”:“ ^ 2.0.2”,
“ cordova-plugin-ionic-keyboard”:“ ^ 2.2.0”,
“ cordova-plugin-ionic-webview”:“ ^ 4.1.3”,
“ cordova-plugin-statusbar”:“ ^ 2.4.2”,
“ cordova-plugin-whitelist”:“ ^ 1.3.3”,
“茉莉花芯”:“〜2.99.1”,
“ jasmine-spec-reporter”:“〜4.2.1”,
“业力”:“〜4.1.0”,
“ karma-chrome-launcher”:“〜2.2.0”,
“ karma-coverage-istanbul-reporter”:“〜2.0.1”,
“业力茉莉花”:“〜1.1.2”,
“ karma-jasmine-html-reporter”:“ ^ 0.2.2”,
“量角器”:“〜5.4.0”,
“ ts-node”:“〜8.3.0”,
“ tslint”:“〜5.17.0”,
“ typescript”:“〜3.1.6”},“ description”:“一个离子项目”,“ cordova”:{
“插件”:{
“ cordova-plugin-splashscreen”:{},
“ cordova-sqlite-storage”:{},
“ cordova-plugin-x-socialsharing”:{},
“ cordova-plugin-whitelist”:{},
“ cordova-plugin-statusbar”:{},
“ cordova-plugin-device”:{},
“ cordova-plugin-ionic-webview”:{},
“ cordova-plugin-ionic-keyboard”:{},
“ cordova-plugin-inappbrowser”:{}
},
“平台”:[
“ ios”,
“ android”,
“浏览器”
]}}
希望你们能帮助我:)
答案 0 :(得分:0)
对于IONIC 4,以下降级对我有用。
npm i @angular-devkit/build-angular@0.803.25
npm i @angular-devkit/build-angular@0.803.24