【问题标题】:Visual Studio 2015 Node.js tools npm versionVisual Studio 2015 Node.js 工具 npm 版本
【发布时间】:2016-03-10 16:01:44
【问题描述】:

我想在 Visual Studio 2015 中使用最新的 npm。我已经从 Visual Studio 安装程序安装了 Joyent Node。我知道可以单独安装 Node.js,但我们似乎对此有问题,所以我们正试图以“微软方式”做事。我还安装了适用于 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

但是,如果我使用“Node.js 命令提示符”并运行:

npm -g install npm 

它更新 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

如果我回到 Visual Studio 2015 Node.js 交互式窗口并运行 .npm,我会看到版本没有更改,即使重新启动 VS 也是如此。但是,我遇到了其他用户报告的长文件名问题并且没有问题,所以我相信实际上正在使用 npm 3.8.0,但我不能确定。如何让 Visual Studio 2015 使用最新的 npm 以避免长文件名问题? Node.js 交互窗口在这里有什么相关性吗? 谢谢!

【问题讨论】:

    标签: node.js npm visual-studio-2015 joyent node.js-tools


    【解决方案1】:

    转到Tools -&gt; Options -&gt; Projects and Solutions -&gt; External Web Tools 并添加节点安装路径。然后将其在依赖项列表中上移。

    【讨论】:

    • 我忘了提,我已经听从了这方面的建议。这是我的列表中的顺序:C:\Program Files (x86)\nodejs, .\node_modules\.bin, $(PATH), $(DevEnvDir)\Extensions\Microsoft\Web Tools\External, $(DevEnvDir) \Extensions\Microsoft\Web Tools\External\git
    【解决方案2】:

    在 Node.js 命令提示符下运行 npm-windows-upgrade 并使用路径选项添加它并在 Visual Studio 2015(上)中为​​我修复了路径输出。

    http://www.triplet.fi/blog/npm-3-will-bring-brighter-future-for-windows-users/

    https://github.com/felixrieseberg/npm-windows-upgrade

    【讨论】:

      猜你喜欢
      • 2018-12-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多