我已将Angular库升级到Angular9。但是,当我尝试在另一个Angular 9项目中使用该库nativescript-ui-sidedrawer时,会出现如下错误:
目标入口点“ side-drawer-directives”中的ERROR缺少依赖项: -./..
Package.json:
{
"nativescript": {
"id": "org.nativescript.NativescriptChallenge",
"tns-android": {
"version": "6.5.0"
},
"tns-ios": {
"version": "6.5.0"
}
},
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"scripts": {
"ngcc": "ngcc --properties es2015 module main --first-only",
"postinstall": "npm run ngcc"
},
"dependencies": {
"@angular/animations": "~9.1.0",
"@angular/common": "~9.1.0",
"@angular/compiler": "~9.1.0",
"@angular/core": "~9.1.0",
"@angular/forms": "~9.1.0",
"@angular/platform-browser": "~9.1.0",
"@angular/platform-browser-dynamic": "~9.1.0",
"@angular/router": "~9.1.0",
"@nativescript/angular": "~9.0.0",
"@nativescript/theme": "~2.3.0",
"nativescript-ui-sidedrawer": "^8.0.1",
"reflect-metadata": "~0.1.12",
"rxjs": "^6.5.0",
"tns-core-modules": "~6.5.0",
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular/compiler-cli": "~9.1.0",
"@nativescript/schematics": "^1.0.0",
"@ngtools/webpack": "~9.1.0",
"@schematics/angular": "^9.1.7",
"nativescript-dev-webpack": "~1.5.0",
"tns-platform-declarations": "~6.5.0",
"tslint": "^6.1.2",
"typescript": "~3.8.3"
},
"gitHead": "3153594d609d66fab71745c881d617ac1328ea1b",
"readme": "NativeScript Application"
}
预先感谢
答案 0 :(得分:2)
您是否尝试过使用此处提供的ngcc.config.js
示例:
https://github.com/NativeScript/nativescript-angular/wiki/Updating-and-developing-for-@nativescript-angular-v9-with-Ivy-or-without#problem-2
简而言之,尝试将ngcc.config.js更新为此,然后清理并再次运行:
module.exports = {
"packages": {
"@nativescript/angular": {
entryPoints: {
".": {
override: {
main: "./index.js",
typings: "./index.d.ts",
},
ignoreMissingDependencies: true,
}
},
ignorableDeepImportMatchers: [
/zone.js\//,
/tns-core-modules\//,
/@nativescript\/core\//
]
},
"nativescript-datetimepicker": {
entryPoints: {
".": {
override: {
main: "./index.js",
typings: "./index.d.ts",
},
ignoreMissingDependencies: true,
},
"angular": {
override: {
main: "./index.js",
typings: "./index.d.ts",
},
ignoreMissingDependencies: true,
}
},
ignorableDeepImportMatchers: [
/tns-core-modules\//,
/@nativescript\/core\//,
/@nativescript\/angular\//
]
},
"nativescript-ui-sidedrawer": {
entryPoints: {
"angular": {
override: {
main: "./side-drawer-directives.js",
typings: "./side-drawer-directives.d.ts",
},
ignoreMissingDependencies: true,
}
},
ignorableDeepImportMatchers: [
/tns-core-modules\//,
/@nativescript\/core\//,
/@nativescript\/angular\//
]
},
"nativescript-ui-listview": {
entryPoints: {
"angular": {
override: {
main: "./listview-directives.js",
typings: "./listview-directives.d.ts",
},
ignoreMissingDependencies: true,
}
},
ignorableDeepImportMatchers: [
/tns-core-modules\//,
/@nativescript\/core\//,
/@nativescript\/angular\//
]
}
}
}