我有这个程序需要 nodejs 才能运行。因此,当我安装 nodejs 并测试它时,它不起作用。这正是我所做的:
multiplemark@multiplemark-OptiPlex-GX280:~$ sudo -s
[sudo] password for multiplemark:
root@multiplemark-OptiPlex-GX280:~# apt-get install nodejs && npm
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libmaven-clean-plugin-java libplexus-compiler-manager-java
libmaven-filtering-java libmaven-shared-io-java libax25
libmaven-jar-plugin-java libmaven-install-plugin-java
libplexus-compiler-api-java libmaven-file-management-java
libplexus-compiler-java libmaven-archiver-java
libmaven-resources-plugin-java libc-ares-dev node-node-uuid libssl-dev
libssl-doc libmaven-dependency-tree-java openbsd-inetd zlib1g-dev
libplexus-compiler-javac-java libv8-dev libmaven-shade-plugin-java libev-dev
libplexus-digest-java libmaven-compiler-plugin-java
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
nodejs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/680 kB of archives.
After this operation, 2,473 kB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 186254 files and directories currently installed.)
Unpacking nodejs (from .../nodejs_0.6.12~dfsg1-1ubuntu1_i386.deb) ...
Processing triggers for doc-base ...
Processing 1 added doc-base file...
Processing triggers for man-db ...
Setting up nodejs (0.6.12~dfsg1-1ubuntu1) ...
update-alternatives: using /usr/bin/node to provide /usr/bin/js (js) in auto mode.
root@multiplemark-OptiPlex-GX280:~# nodejs
No command 'nodejs' found, did you mean:
Command 'nodefs' from package 'noweb' (main)
nodejs: command not found
root@multiplemark-OptiPlex-GX280:~#
答案1
启动 nodejs 的正确命令是node