最佳答案
VS 2015社区版(在家) ,npm 3.10,角2 我试图拉 Angular2安装在一个 ASP.Net MVC 5应用程序。我开始使用的模板使用了老版本的 Angular,所以我更新了包引用。
生成时,列表中的第一个错误是:
生成: 无法找到“节点”的类型定义文件
在那之后还有许多其他的错误,但是我假设大多数是由于这第一个问题。
这是 package.json 和 typeings.json
包裹 Json
{
"version": "1.0.0",
"name": "aspnet",
"private": true,
"scripts": {
"postinstall": "typings install",
"typings": "typings"
},
"dependencies": {
"@angular/common": "~4.0.0",
"@angular/compiler": "~4.0.0",
"@angular/core": "~4.0.0",
"@angular/forms": "~4.0.0",
"@angular/http": "~4.0.0",
"@angular/platform-browser": "~4.0.0",
"@angular/platform-browser-dynamic": "~4.0.0",
"@angular/router": "~4.0.0",
"angular-in-memory-web-api": "~0.3.0",
"systemjs": "0.19.40",
"core-js": "^2.4.1",
"rxjs": "5.0.1",
"zone.js": "^0.8.4",
"bootstrap": "^3.3.7"
},
"devDependencies": {
"@types/core-js": "^0.9.41",
"gulp": "^3.9.1",
"gulp-clean": "^0.3.2",
"gulp-concat": "^2.6.1",
"gulp-tsc": "^1.3.1",
"gulp-typescript": "^3.1.6",
"path": "^0.12.7",
"typescript": "~2.1.0",
"typings": "~2.1.1"
}
}
打字 Json
{
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160725163759",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
"node": "registry:dt/node#6.0.0+20160909174046"
}
}
如果我尝试更新只是打字,我得到这些消息
*typings WARN deprecated 11/21/2016: "registry:dt/node#6.0.0+20160909174046" is deprecated (updated, replaced or removed)
typings WARN deprecated 9/14/2016: "registry:dt/core-js#0.0.0+20160725163759" is deprecated (updated, replaced or removed)
typings WARN deprecated 10/25/2016: "registry:dt/jasmine#2.2.0+20160621224255" is deprecated (updated, replaced or removed)*
[ 更新]
清理我的 node _ module 文件夹,然后运行 npm install 再次清理了事情。当我将一个项目文件夹移动到系统上的另一个位置时,这种情况似乎最常发生。