我在利用以下方式安装后,
$ sudo apt-get install python-software-properties
$ curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
$ sudo apt-get install nodejs
发现检测node版本还是7.0.0(我以前的版本),用 nodejs -v反而是最新的7.10.1.这两者究竟有什么区别呢?
我在利用以下方式安装后,
$ sudo apt-get install python-software-properties
$ curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
$ sudo apt-get install nodejs
发现检测node版本还是7.0.0(我以前的版本),用 nodejs -v反而是最新的7.10.1.这两者究竟有什么区别呢?
下源码自己编译嘛,印象中它什么依赖的。通过 --prefix
指定目录,后面使用绝对路径使用 node
命令就好了。
node
和 nodejs
就是两个不同的可执行文件啊。
whereis node
whereis nodejs
能看到这两个可执行命令到底在什么地方。
另外,如果你想执行在 bin
目录中的文件,应该输入 ./node -v
,而不是 node -v
。
10 回答11.1k 阅读
5 回答4.8k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答2.7k 阅读✓ 已解决
3 回答5.1k 阅读✓ 已解决
3 回答1.9k 阅读✓ 已解决
4 回答2.5k 阅读✓ 已解决
node安装可以用二进制的源码安装(在官网下载https://nodejs.org/en/download/),我下的是Linux Binaries (x86/x64) 64bit版,放到你要的地方,解压后配置下环境变量就可以使用,主要是可以下到新版的node