我想在 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 交互窗口在这里有什么相关性吗?谢谢!