官术网_书友最值得收藏!

Getting the dependent modules in place

Before we start to write any Node.js code, we need to get our dependencies in place by using npm. Since this is a basic app, we will be using it to test our Node.js connectivity with the MongoDB server. So, the only dependent module that we need is the native MongoDB client for Node.js. We can easily install that by executing the following command:

    $ npm install MongoDB --save

After npm installs the MongoDB driver, you can list the contents of the directory and you will notice that a new folder was created, node_modules. This is where, surprisingly enough, all Node modules are stored whenever you install them from npm. Inside the node_modules folder, there should be a single folder named MongoDB. Also, you will notice that the package.json file of our sample application will be updated by this new dependency entry.

主站蜘蛛池模板: 自治县| 长岛县| 山阴县| 花垣县| 富裕县| 含山县| 徐汇区| 芜湖市| 吉安县| 许昌市| 华蓥市| 炉霍县| 黄浦区| 沂水县| 台州市| 秦安县| 全椒县| 山东| 海城市| 永宁县| 文山县| 亳州市| 刚察县| 利川市| 应用必备| 上高县| 南川市| 阿城市| 双江| 汤阴县| 深水埗区| 思南县| 蒲江县| 上思县| 贡嘎县| 贡觉县| 大兴区| 新安县| 襄樊市| 罗源县| 鹿泉市|