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

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.

主站蜘蛛池模板: 酒泉市| 和平区| 江油市| 翁源县| 凤翔县| 锡林浩特市| 金沙县| 伊宁市| 南京市| 犍为县| 久治县| 碌曲县| 张北县| 宁德市| 池州市| 寿宁县| 抚顺县| 平潭县| 平潭县| 石河子市| 临潭县| 宝兴县| 老河口市| 买车| 庄浪县| 祁阳县| 锡林郭勒盟| 淳安县| 通州区| 越西县| 犍为县| 高邑县| 中方县| 福海县| 新巴尔虎右旗| 洛扎县| 光泽县| 阿克| 大洼县| 巴南区| 靖江市|