Node.js 如何更改npm正在使用的节点版本

Node.js 如何更改npm正在使用的节点版本,node.js,npm,Node.js,Npm,如何更改npm正在使用的节点版本 我已经安装了node 6.11.2 $ node -v v6.11.2 但当我使用npm时,它正在检测节点v4.2.6 $ npm info npm ERR! Linux 4.4.0-93-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "info" npm ERR! node v4.2.6 npm ERR! npm v3.5.2 npm ERR! code E404 npm ERR! 404

如何更改npm正在使用的节点版本

我已经安装了node 6.11.2

$ node -v
v6.11.2
但当我使用npm时,它正在检测节点v4.2.6

$ npm info
npm ERR! Linux 4.4.0-93-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "info"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/html5-webpack-template
npm ERR! 404 
npm ERR! 404  'html5-webpack-template' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/workspace/standards-playground/src/main/webapp/npm-debug.log

首先使用下面的命令列出所有安装的版本

nvm ls
之后使用下面的命令

nvm use `<version>`
nvm使用``

您可以按照(nvm)的说明进行安装。

您是如何安装的?@Dave Newton首先,我只是安装了ubuntu附带的npm的默认安装。之后,我手动安装了node的最后一个版本,并添加了更新替代方案