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

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.

主站蜘蛛池模板: 日照市| 宁南县| 布尔津县| 扬州市| 拉萨市| 锡林郭勒盟| 顺平县| 栾川县| 平泉县| 益阳市| 巴林右旗| 邵东县| 皋兰县| 吕梁市| 民权县| 崇左市| 通州区| 卫辉市| 驻马店市| 梅州市| 商洛市| 阳曲县| 麦盖提县| 南皮县| 石台县| 尤溪县| 韶关市| 全州县| 沐川县| 荥阳市| 新沂市| 湟中县| 陆川县| 凤阳县| 滦平县| 南溪县| 望都县| 海南省| 苏尼特左旗| 昌乐县| 巴彦淖尔市|