由@alexzuza解决。请参阅他下面的答案-大力支持!
基本上,从ng2-opd-popup文件夹中删除node_modules文件夹,并编辑src/tsconfig.app.json
以匹配路径。另请参阅注释以获取rimraf设置的链接,以自动排除使用npm install安装node_modules。
我遇到了这个错误:
错误:在静态解析符号值时遇到错误。调用函数'makeDecorator',不支持函数调用。考虑将该函数或lambda替换��对导出函数的引用
此处找到的解决方案不起作用-我正在运行angular v. 4.3。
package.json:
PopupModule.forRoot(),
tsconfig.json:
"paths": {
"@angular/*": ["node_modules/@angular/*"]
},
tsconfig.json:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": ".",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"paths": {
"@angular/common": ["../node_modules/@angular/common"],
"@angular/compiler": ["../node_modules/@angular/compiler"],
"@angular/core": ["../node_modules/@angular/core"],
"@angular/forms": ["../node_modules/@angular/forms"],
"@angular/platform-browser": ["../node_modules/@angular/platform-browser"],
"@angular/platform-browser-dynamic": ["../node_modules/@angular/platform-browser-dynamic"],
"@angular/router": ["../node_modules/@angular/router"],
"@angular/http": ["../node_modules/@angular/http"]
},
"lib": [
"es2017",
"dom"
]
}
}
tsconfig.app.json:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": ".",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"paths": {
"@angular/*": ["../node_modules/@angular/*"]
},
"lib": [
"es2017",
"dom"
]
}
}
我正在尝试使用的包:ng2-opd-popup
有人有解决方案吗?或者还有更好的包可以使用吗?
ng2-opd-popup
上,不幸的是。您可以手动复制 TypeScript 代码到本地项目中进行构建。要修复该模块,他们必须在构建过程中从dependencies
中删除@angular/*
。可能还有其他方法来解决它,但我不确定。 - Explosion Pills