Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7503835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:22:10+00:00 2026-05-29T21:22:10+00:00

I have this in my package.json file (shortened version): { name: a-module, version: 0.0.1,

  • 0

I have this in my package.json file (shortened version):

{
  "name": "a-module",
  "version": "0.0.1",
  "dependencies": {
    "coffee-script":      ">= 1.1.3"
  },
  "devDependencies": {
    "stylus":             ">= 0.17.0"
  }
}

I am using NPM version 1.1.1 on Mac 10.6.8.

When I run the following command from the project root, it installs both the dependencies and devDependencies:

npm install

I was under the impression that this command installed the devDependencies:

npm install --dev

How do I make it so npm install only installs dependencies (so production environment only gets those modules), while something like npm install --dev installs both dependencies and devDependencies?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:22:11+00:00Added an answer on May 29, 2026 at 9:22 pm

    The npm install command will install the devDependencies along other dependencies when run inside a package directory, in a development environment (the default).

    In version 8.x and above use --omit=dev flag to install only regular dependencies:

    npm install --omit=dev
    

    This will install only dependencies, and not devDependencies, regardless of the value of the NODE_ENV environment variable.

    If you use 6.x or an earlier version, you need to use the --only=prod flag instead.

    Note:
    Before v3.3.0 of npm (2015-08-13), the option was called --production, i.e.

    npm install --production
    

    You may also need --no-optional flag.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this package.json file: { name: application-name , version: 0.0.1 , private: true
I have this .bat script which I use to maven package my application. Problem
Okay so, I have this project structure: package A.B class SuperClass (this class is
I have this procedure i my package: PROCEDURE pr_export_blob( p_name IN VARCHAR2, p_blob IN
I have a base class like this: package MyClass; use vars qw/$ME list of
We have written a software package for a particular niche industry. This package has
I have a standalone enum type defined, something like this: package my.pkg.types; public enum
We have some code kicking around that uses this old internal Sun package for
I have a JSON String like this $test='{var1:null,var3:null,status:{code:150,message:blah blah}}'; I want to access the
I have this code: package graphics { import flash.display.Sprite; import flash.events.*; public class Ball

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.