[英]Visual Studio 2015 Node.js tools npm version
I would like to use the latest npm within Visual Studio 2015. I've installed Joyent Node from the Visual Studio installer. 我想在Visual Studio 2015中使用最新的npm。我已经从Visual Studio安装程序安装了Joyent Node。 I understand one can install Node.js seperately but we seem to have issues with that so we are trying to do things the "Microsoft Way". 我知道可以单独安装Node.js,但似乎与此有关,因此我们尝试以“ Microsoft Way”的方式进行操作。 I have also installed the Node.js Tools 1.1 for Visual Studio 2015. Within the node.js interactive window within Visual Studio, running .npm gives me the following: 我还安装了Visual Studio 2015的Node.js工具1.1。在Visual Studio的node.js交互式窗口中,运行.npm可得到以下信息:
Specify configs in the ini-formatted file:
C:\Users\MyUsername\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@2.7.4 C:\Program Files (x86)\nodejs\node_modules\npm
successfully completed
However, if I use the "Node.js command prompt" and run: 但是,如果我使用“ Node.js命令提示符”并运行:
npm -g install npm
It updates npm and running npm command I get the following: 它更新npm并运行npm命令,我得到以下信息:
Specify configs in the ini-formatted file:
C:\Users\MyUsername\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@3.8.0 C:\Users\MyUsername\AppData\Roaming\npm\node_modules\npm
If I got back to Visual Studio 2015 Node.js Interactive Window and run .npm, I see the version hasn't changed, even with a VS restart. 如果我回到Visual Studio 2015 Node.js交互式窗口并运行.npm,我发现即使VS重新启动,版本也没有改变。 However, I had a long filename issue as reported by other users and not had the issue so I believe that npm 3.8.0 is actually being used but I can't be sure. 但是,我遇到了其他用户报告的长文件名问题,而没有遇到此问题,因此我认为实际上正在使用npm 3.8.0,但不能确定。 How can I get Visual Studio 2015 to use the latest npm so I can avoid the long file name problem? 如何使Visual Studio 2015使用最新的npm,以便避免长文件名问题? Does the Node.js Interactive Window have any relevance here? Node.js交互式窗口在这里是否有任何相关性? Thanks! 谢谢!
Go to Tools -> Options -> Projects and Solutions -> External Web Tools
and add path to your node install. 转到Tools -> Options -> Projects and Solutions -> External Web Tools
然后将路径添加到您的节点安装。 Then move it up in the list of dependencies. 然后将其在依赖项列表中上移。
Running npm-windows-upgrade within the Node.js command prompt and adding it with the path option with the path output in Visual Studio 2015 (above) fixed it for me. 在Node.js命令提示符中运行npm-windows-upgrade并将其与path选项一起添加,并在Visual Studio 2015中将路径输出添加到我(上面)中,从而为我修复了该问题。
http://www.triplet.fi/blog/npm-3-will-bring-brighter-future-for-windows-users/ http://www.triplet.fi/blog/npm-3-will-bring-brighter-future-for-windows-users/
https://github.com/felixrieseberg/npm-windows-upgrade https://github.com/felixrieseberg/npm-windows-upgrade
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.