在我的package.json中,除其他外,我还有以下条目:
"devDependencies": {
"@types/angular": "1.6.56",
"@types/angular-resource": "1.5.15"
...在node_modules/@types/angular-resource/node_modules/@types/angular/package.json中:
"name": "@types/angular",
"version": "1.6.55"那么这些版本之间有错配吗?角资源将此作为依赖项:
"dependencies": {
"@types/angular": "*"
}所以它和每个版本都匹配。但是,为什么当我指定1.6.56时需要1.6.55呢?
我不确定这是否是我在运行tsc时问题的根本原因:
error TS2694: Namespace 'angular' has no exported member 'resource'.如果是的话,我怎样才能解决这个问题?
发布于 2019-10-23 07:35:11
解决方案是删除node_modules文件夹,并再次使用npm /install手动添加依赖项,突然v1.6.55就消失了。仅删除node_modules文件夹和/或yarn.lock是不够的。
https://stackoverflow.com/questions/58299459
复制相似问题