簡體   English   中英

Visual Studio 2015 Node.js工具NPM版本

[英]Visual Studio 2015 Node.js tools npm version

我想在Visual Studio 2015中使用最新的npm。我已經從Visual Studio安裝程序安裝了Joyent Node。 我知道可以單獨安裝Node.js,但似乎與此有關,因此我們嘗試以“ Microsoft Way”的方式進行操作。 我還安裝了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交互式窗口在這里是否有任何相關性? 謝謝!

轉到Tools -> Options -> Projects and Solutions -> External Web Tools然后將路徑添加到您的節點安裝。 然后將其在依賴項列表中上移。

在Node.js命令提示符中運行npm-windows-upgrade並將其與path選項一起添加,並在Visual Studio 2015中將路徑輸出添加到我(上面)中,從而為我修復了該問題。

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

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM