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

Dependencies and devDependencies

You have all your dependencies installed now. You start working and during the development process, you may need some other dependencies to improve your code. You just need to run the NPM CLI to get the new dependency, but this will not be present in your package.json file! It can be very dangerous, because if you don't have the list of libraries or dependencies you need for your project, when you want to run it in a different machine, your code will fail, because the dependency is not installed in that machine.

We can ensure that the new package name will be added to our dependencies' list, adding the –-save or –-save-dev flag. The first will add the package name to the dependencies' section of the package.json file. This means that the dependency is mandatory for the application itself and should be installed before running or deploying the application. On the other hand, we have the devDependencies' part, where there will be only the dependencies used for our development process:

$ npm install <package_name> --save

Now, we are ready to start developing JavaScript applications. In the next section, you will make use of NPM to install the Aurelia command-line tool required to create new Aurelia projects, but let's continue exploring the Aurelia framework.

主站蜘蛛池模板: 藁城市| 福州市| 博湖县| 托克逊县| 马山县| 米泉市| 靖安县| 福贡县| 东宁县| 驻马店市| 天全县| 从化市| 仙桃市| 西丰县| 高台县| 乐山市| 玉环县| 公主岭市| 景泰县| 前郭尔| 平利县| 中方县| 凤台县| 柳州市| 重庆市| 山东| 丰县| 高安市| 云霄县| 赣榆县| 台安县| 历史| 惠水县| 广东省| 连江县| 七台河市| 苗栗县| 诸城市| 阿拉尔市| 嵩明县| 星子县|