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

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.

主站蜘蛛池模板: 龙岩市| 阜南县| 南澳县| 柳州市| 岑溪市| 福海县| 咸宁市| 正宁县| 胶州市| 曲阳县| 平舆县| 白河县| 余干县| 临澧县| 勐海县| 营口市| 惠东县| 青海省| 肥城市| 鄂州市| 碌曲县| 和田县| 青铜峡市| 静海县| 缙云县| 呼伦贝尔市| 阜平县| 黔西| 福海县| 醴陵市| 桦甸市| 攀枝花市| 通山县| 耿马| 涟源市| 临泽县| 德庆县| 司法| 龙州县| 酉阳| 正阳县|