node.js - 更新 npm 到 @angular 2 不可用

标签 node.js visual-studio-2015 npm angular

我想从 angular 2 Beta 15 升级到 angular 2 RC1。

我正在使用 Visual Studio 2015。

在我的 Visual Studio 中的 npm package.json 中,我这样做:

 "dependencies": {
    "@angular/core": "Unavailable",
}

但我没空。

然后我做了一些更新:

I updated my nodejs to v6.1.0.
I updated my npm to v3.8.9.

它在 Visual Studio 2015 中仍然显示不可用。

我还能做些什么来让它发挥作用?

更新

按照@David Pine 的建议我得到了这个错误:

====Executing command 'npm install'====


npm WARN package.json ASP.NET@0.0.0 No description
npm WARN package.json ASP.NET@0.0.0 No repository field.
npm WARN package.json ASP.NET@0.0.0 No README data
npm http GET https://registry.npmjs.org/angular/core
npm http 404 https://registry.npmjs.org/angular/core
npm ERR! 404 Not Found
npm ERR! 404 
npm ERR! 404 'angular/core' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'ASP.NET'
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\\\node\\node" "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\TGB.2016\TGB.Web
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.9
npm ERR! code E404

====npm command completed with exit code 1====

更新 2

我还在我的 Visual Studio 选项中添加了正确的 nodejs 路径,请参阅:

http://ryanhayes.net/synchronize-node-js-install-version-with-visual-studio-2015/

最佳答案

确保 Node.js 位于 Visual Studio 中外部网络工具路径的顶部,详细信息 here .

我发现 Visual Studio 2015 在与 npm 集成方面可能不可靠。不要依赖 VS 为您更新它,而是打开 package.json 并手动输入您要查找的版本。

代替:

"dependencies": {
    "@angular/core": "Unavailable",
}

输入:

"dependencies": {
    "@angular/core": "2.0.0-rc.1",
}

关于node.js - 更新 npm 到 @angular 2 不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37194617/

相关文章:

javascript - 通过文件://from Vue-cli template打开index.html

angularjs - 如何创建新的应用程序项目而不需要一次又一次下载和安装 npm 模块?

maven - 将 lib maven 导入 npm package.json

visual-studio - 让 Visual Studio 2015 识别 Doxygen 注释

javascript - 如何从 nodejs aws s3 getObject 回调数据中检索元数据?

node.js - 无法将 hapi-swagger 注册到 hapi rest api 最新版本 17

javascript - 是否可以通过 Node js 服务器将 sip 请求转发到另一个 asterisk 服务器?

visual-studio-2015 - 无法将自动化测试与测试用例相关联

visual-studio-2015 - 为什么 ASP.NET Core 解决方案在迁移到 Visual Studio 2017 后会下降?

node.js - NodeJS中promise如何通过多层回调解析所有数据