简体   繁体   English

Visual Studio 2015 Node.js工具NPM版本

[英]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.

相关问题 Visual Studio 2015 Node.js工具-无法安装mongodb 2.x软件包-260个文件名长度 - Visual Studio 2015 Node.js Tools - Cannot install mongodb 2.x package - 260 filename length 在Visual Studio中安装gulp插件期间,node.js和npm版本不正确 - Incorrect version of node.js and npm during gulp plugins installation in visual studio 结合使用Dust.js和Visual Studio的Node.js工具 - Using Dust.js with Node.js Tools for Visual Studio Visual Studio 2015-Node.js的多个实例 - Visual Studio 2015 - Multiple Instances of Node.js Jade缩进不一致,用于Visual Studio的Express和Node.js工具 - Jade indentation inconsistency, Express and Node.js Tools for Visual Studio Visual Studio的Node.js工具总是在异常时停止 - Node.js tools for Visual Studio always stops on exceptions 在Visual Studio的Node.js工具中调试多线程应用程序 - Debugging multithreaded applications in Node.js Tools for Visual Studio 有没有办法在Visual Studio的Node.js工具上打开控制台窗口? - Is there a way to open the Console window on Node.js tools for Visual Studio? 如何使用Visual Studio 2013和Node Tools NTVS调试node.js应用程序 - How to debug node.js application with Visual Studio 2013 and Node Tools NTVS 语法突出显示不适用于Visual Studio 2015 Update 3中的Node.js Vash视图文件 - Syntax highlighting not working for Node.js Vash view files in Visual Studio 2015 Update 3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM