Express and Node.js Training from StrongLoop

This document might be outdated relative to the documentation in English. For the latest updates, please refer to the documentation in English.

O’rnatish

Avval, agar ish direktoryasini yaratmagan bo’lsangiz, uni yarating va ish direktoriyasiga aylantiring.


$ mkdir myapp
$ cd myapp

Agar sizning direktoriyangizda package.json fayli mavjud bo’lmasa, uni npm init buyrug’i orqali yarating.


$ npm init

Expressni dastur direktoriyangizga o’rnating va uning kerakli modullarini saqlab qo’ying:


$ npm install express --save

Expressni vaqtinchalik o’rnatish uchun va uning kerakli modullarni saqlab qo’ymaslik uchun --save qo’shimchasini olib tashlang::


$ npm install express

Agar --save orqali modullarni o’rnatsangiz u package.json faylidagi dependencies ro’yxatidagi qo’shiladi. Dastur direktoriyasida npm install buyurug’ini bajarsangiz, dasturning barcha kerakli modullarni avtomatik tarzda o’rnatib beradi.