linux 安装 nodejs 妖狐艹你老母 2022-08-27 10:51 128阅读 0赞 **1,下载Node.js:** 官方下载页面,http://www.nodejs.org/download/,linux推荐用**Source Code** wget http://nodejs.org/dist/v0.10.28/node-v0.10.28.tar.gz **2,解压:** tar -zxvf node-v0.6.4.tar.gz **3,安装:** cdnode-v0.6.4.tar ./configure make && make install **4,验证安装是否成功:** node -v ![SouthEast][] 安装成功。当前版本0.10.28 **5,准备测试脚本:** 放在网站目录,如/var/www/html/nodejs/hello.js ![SouthEast 1][] **6,运行脚本:** **node /var/www/html/nodejs/hello.js** **![Image 1][]** http://116.76.32.4:1337/可以看到运行结果。 ![SouthEast 2][] 注意:监听ip写本机ip,不是外网ip.(如果监听127.0.0.1,外网无法访问) [SouthEast]: /images/20220824/92880cdc99ae42e1ae6ec12dafe6fd95.png [SouthEast 1]: /images/20220824/40bce597907a4d00a1bbd95b982d5f26.png [Image 1]: [SouthEast 2]: /images/20220824/c5d3403bd34d4c70a2b5539f908ea250.png
还没有评论,来说两句吧...