内部版本:找不到“节点"的类型定义文件 [英] Build:Cannot find type definition file for 'node'

查看:349
本文介绍了内部版本:找不到“节点"的类型定义文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VS 2015社区版(在家),npm 3.10,Angular 2 我试图在ASP.Net MVC 5应用程序中获取Angular2安装程序.我开始使用的模板使用了较旧的Angular版本,因此我更新了包引用.

VS 2015 community edition (at home), npm 3.10, Angular 2 Im trying to pull get Angular2 setup within an ASP.Net MVC 5 app. The template I started with used an older version of Angular, so I updated the package references.

构建时,列表中的第一个错误是:
内部版本:找不到节点"的类型定义文件
此后还有许多其他错误,但我认为大多数错误是由于第一个问题引起的.

When I build, the first error in the list is:
Build:Cannot find type definition file for 'node'
There are dozens of other errors after that but Im assuming most are due to this first issue.

这是package.json和types.json

Here is the package.json and typings.json

package.json

package.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"
  }
}

typings.json

typings.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"
  }
}

如果仅尝试更新键入内容,我会收到这些消息

If I try to update just the typings, I get these messages

*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_modules文件夹,然后再次运行npm install清除所有内容.当我将项目文件夹移动到系统上的另一个位置时,这似乎最经常发生.

[ update ]
cleaning out my node_modules folder, then running npm install again cleared things up. This seems to happen most often when I move a project folder to another location on my system.

推荐答案

我在通过Visual Studio更新软件包时遇到了一些问题.从现在开始,我总是使用Powershell控制台更新或添加软件包.

I had several problems updating packages through visual studio. From now i always update or add packages with the powershell console.

启动PowerShell并导航到package.json所在的文件夹,然后运行npm install安装完成后重新启动Visual Studio.

Start PowerShell and navigate to the folder where package.json is located and then run npm install Restart visual studio after the installation is done.

您也可以尝试删除您的node_modules文件夹,然后运行npm install

You can also try to delete your node_modules folder then run npm install

希望这可以解决您的问题.

Hope this will solve your problems.

这篇关于内部版本:找不到“节点"的类型定义文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆