npm install multiple package names

后端 未结 3 893
天命终不由人
天命终不由人 2020-12-15 03:10

What does it do when I run this command:

npm install --save-dev package1 package2

It is definitely not installing multiple packages, but it

相关标签:
3条回答
  • 2020-12-15 03:30

    It is definitely not installing multiple packages

    Why? You're installing package1 and package2 and marking them as devDependencies with --save-dev.

    As stated in the documentation, you may combine multiple arguments, and even multiple types of arguments. In your case, you're combining 2 package names published on the registry.

    0 讨论(0)
  • 2020-12-15 03:31

    npm install -save module1 module2

    Example: npm install -save morgan chalk errorhandler lusca dotenv path mongoose

    The above command will install the latest versions of morgan, chalk, errorhandler, lusca, dotenv, path and mongoose.

    0 讨论(0)
  • 2020-12-15 03:43

    Save as dependencies:

    npm i package1 package2
    

    Save as dev-dependencies:

    npm i -D package1 package2
    
    npm i --save-dev package1 package2
    
    0 讨论(0)
提交回复
热议问题