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

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.

主站蜘蛛池模板: 成武县| 保康县| 福建省| 宜州市| 当涂县| 灵石县| 陇南市| 涟源市| 黑河市| 台南市| 安西县| 新密市| 疏附县| 农安县| 陈巴尔虎旗| 石城县| 曲阳县| 湖北省| 武功县| 额尔古纳市| 桃江县| 前郭尔| 北票市| 江达县| 建德市| 郎溪县| 潜山县| 枞阳县| 商南县| 新闻| 望江县| 牡丹江市| 新丰县| 田阳县| 凌云县| 西乡县| 梁平县| 信宜市| 舟山市| 潢川县| 扬州市|