nodejs quick install

nodejs 在linux安裝如果不透過安裝包或是yum的包管理來安裝,最快的方式是直接從官方網站抓binary dist,以下是在CentOS 6.9測試

https://nodejs.org/dist/latest-v10.x/
Linux: https://nodejs.org/dist/latest-v10.x/node-v10.17.0-linux-x64.tar.gz

tar xf node-v10.17.0-linux-x64.tar.gz

將 bin/node copy到 /usr/local/bin

cp node /usr/local/bin/

install npm 解壓縮的binary包有帶npm,用這個npm來抓取最新的npm安裝到系統

./npm -g install npm

如果只是拿nodejs來執行的話,npm並不需要裝,只需要node執行檔。在壓縮包裏有 include,那是需要build binary addon時會用到,可直接複製到 /usr/local/include

cp -r include/node/ /usr/local/include/

This entry was posted in nodejs. Bookmark the permalink.

Leave a Reply