Cov txheej txheem:

Kuv yuav khiav node js ntawm Ubuntu Server li cas?
Kuv yuav khiav node js ntawm Ubuntu Server li cas?

Video: Kuv yuav khiav node js ntawm Ubuntu Server li cas?

Video: Kuv yuav khiav node js ntawm Ubuntu Server li cas?
Video: Merging PDFs with Python! 2024, Kaum ib hlis
Anonim

Txhawm rau nruab qhov tshwj xeeb nodejs version, Mus saib peb cov lus qhia Nruab Ib Nodejs Version nrog NVM

  1. Kauj ruam 1 – Ntxiv Node . js PPA. Node .
  2. Kauj ruam 2 – Nruab Node . js ntawm Ubuntu . Koj tuaj yeem ua tiav ntxiv Node .
  3. Kauj Ruam 3 – Tshawb xyuas Node . js thiab NPM Version.
  4. Kauj ruam 4 – Tsim Demo Web Server (Optional) Qhov no yog ib kauj ruam xaiv tau.

Ntxiv mus, kuv yuav ua li cas khiav lub node js server?

Cov kauj ruam

  1. Qhib lub qhov rais davhlau ya nyob twg (Mac) lossis lub qhov rai hais kom ua (Windows), thiab taw qhia (cd) mus rau ionic-tutorial / server directory.
  2. Nruab lub server dependencies: npm nruab.
  3. Pib lub server: node server. Yog tias koj tau txais qhov yuam kev, xyuas kom koj tsis muaj lwm tus neeg rau zaub mov mloog ntawm chaw nres nkoj 5000.

Ib yam li ntawd, kuv yuav siv lub node JS li cas? Deploying Node Applications

  1. Kauj ruam 1: Tsim cov ntaub ntawv "package.json" siv cov lus txib nram qab no npm init.
  2. Kauj ruam 2: Tsim cov ntaub ntawv hu ua "app.js" hauv koj qhov project folder.
  3. Kauj ruam 3: Tsim ib cov ntaub ntawv html “head.html”
  4. Kauj ruam 4: Tsim lwm cov ntaub ntawv html “tail.html”
  5. KAUJ RUAM 5: Qhib "app.js" cov ntaub ntawv tsim nyob rau hauv kauj ruam 2 thiab luam paste cov cai hauv qab no hauv nws.

Kuj kom paub, Kuv yuav ua li cas rau nruab qhov tseeb ntawm JS?

Hloov Kho Node Siv Tus Thawj Tswj Pob Khiav npm -v kom pom cov version koj muaj, ces npm nruab [email tiv thaiv] tseeb -g to nruab tus tshiab tshaj plaws npm update. Khiav npm -v dua yog tias koj xav kom npm hloov kho kom raug. Rau nruab tus tseeb tso, siv n tseeb . Xwb, koj tuaj yeem khiav n #.

Yog node js yog Web server?

Node . js yog Javascript run-time ib puag ncig tsim ntawm Chrome's V8 Javascript engine. Nws los nrog http module uas muab cov txheej txheem ua haujlwm thiab cov chav kawm rau kev tsim HTTP server . Rau qhov yooj yim HTTP no server , peb kuj tseem yuav siv cov ntaub ntawv kaw lus, txoj hauv kev thiab url, txhua yam uas yog haiv neeg Node.

Pom zoo: