我想从 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/