What does the npm -i flag mean?

前端 未结 2 1072
庸人自扰
庸人自扰 2021-01-31 00:55

What\'s does the \"i\" flag do in npm?

I saw it used like this:

npm i backbone.marionette

I looked in the npm documentation and searched fo

相关标签:
2条回答
  • 2021-01-31 01:33

    the i flag is for install. From documentation:

    npm install
    npm install <pkg>
    npm install <pkg>@<tag>
    npm install <pkg>@<version>
    npm install <pkg>@<version range>
    npm install <folder>
    npm install <tarball file>
    npm install <tarball url>
    npm install <git:// url>
    npm install <github username>/<github project>
    
    Can specify one or more: npm install ./foo.tgz bar@stable /some/folder
    If no argument is supplied and ./npm-shrinkwrap.json is 
    present, installs dependencies specified in the shrinkwrap.
    Otherwise, installs dependencies from ./package.json.
    

    Refer official document for more information here

    0 讨论(0)
  • 2021-01-31 01:35

    The i is npm-install alias which is mentioned in https://docs.npmjs.com/cli/install.

    You can use it with all npm-install flags. For example below will install angular-js amd live server by using npm i

    npm i angular2@2.0.0-alpha.45 --save --save-exact
    npm i live-server --save-dev
    
    0 讨论(0)
提交回复
热议问题