在 Linux 中安装 Node.js 后出错
Error after installing Node.js in Linux
在我的 Linux 机器中键入 $ node - version 后出现以下错误:
Error: unrecognized flag -
Try --help for options
module.js:340
throw err;
^
Error: Cannot find module '/home/ojas/version'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:935:3
我在安装时使用了以下命令:
$ sudo apt-get install python-software-properties
$ curl -sL https://deb.nodesource.com/setup | sudo bash -
$ sudo apt-get update
$ sudo apt-get install nodejs
需要指出两点:
- 可执行文件在 Ubuntu.
中被称为 nodejs
而不是 node
- 标志是 --version
~$ nodejs --version
v0.10.25
在我的 Linux 机器中键入 $ node - version 后出现以下错误:
Error: unrecognized flag -
Try --help for options
module.js:340
throw err;
^
Error: Cannot find module '/home/ojas/version'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:935:3
我在安装时使用了以下命令:
$ sudo apt-get install python-software-properties
$ curl -sL https://deb.nodesource.com/setup | sudo bash -
$ sudo apt-get update
$ sudo apt-get install nodejs
需要指出两点:
- 可执行文件在 Ubuntu.
中被称为 nodejs
而不是 node
- 标志是 --version
~$ nodejs --version
v0.10.25