آموزش نصب NodeJS و Express برروی CentOS
آموزش نصب NodeJS و Express برروی CentOS
این اموزش به شما نشان میدهد که چگونه Node.js و Express.js برروی CentOS 6 (یا CentOS 7) نصب کنید شما میتوانید از Node.js برای ساخت سریع برنامه های وب با JavaScript استفاده کنید.نصب بسیار آسان است فقط مراحل زیر را دنبال کنید بیشتر کار توسط YUM package manager برای شما انجام شده است
1. Download Node.js
cd /tmp
curl -sL https://rpm.nodesource.com/setup | bash
2. Install Node.js
yum install -y nodejs
3. Install build tools
yum install gcc-c++ openssl-devel make
4. Install Express.js
npm install -g express-generator
5. Create a non-privileged user
useradd username passwd username
6. Create a project
express expressproject cd expressproject npm install
If all went well, you should see something similar to this:
> expressproject@0.0.0.0 start /exampleuser/expressproject > node ./bin/www
To fully test it, launch your web-browser and type the IP address of your VPS at port 3000 in the URL bar. It should look similar to this (replace 0.0.0.0 with your VPS IP):
http://0.0.0.0:3000
When you navigate to that URL, you will see the message Welcome to Express
on the page.