devDependencies not being installed with npm install command

I’m having trouble on my Windows machine where running npm install only installs regular dependencies but skips the devDependencies section completely. From what I know, it should install both types by default.

When I use npm install --dev, the devDependencies get installed properly. I’m confused about why the standard npm install command isn’t working as expected.

Could there be an issue with my package.json configuration? Here’s what it looks like:

{
  "name": "webpack-starter",
  "version": "1.0.0",
  "private": true,
  "devDependencies": {
    "webpack": "^4.2.0",
    "babel-loader": "^8.0.2",
    "css-loader": "^2.1.0",
    "style-loader": "^0.23.1",
    "mini-css-extract-plugin": "^0.5.0"
  },
  "dependencies": {
    "lodash": "^4.17.11"
  }
}

What might be causing this behavior and how can I resolve it?

Windows permission issues can mess with npm behavior, especially for different dependency types. I hit this exact problem on a Vue project where corporate antivirus was blocking installs. Run command prompt as admin and try npm install again. Also check for .npmrc files in your project folder or home directory - they might have --production or --only=production settings that are causing this. Your npm version could be the culprit too. Older versions had devDependencies bugs on Windows. Run npm --version and update if you’re below 6.x. Since --dev works, npm’s reading your package.json fine - something’s just filtering out devDependencies during normal installs.

make sure your NODE_ENV ain’t set to production, since npm ignores devDependencies in that case. I went through the same thing last month and it was super frustrating lol

Check your npm config first - run npm config list to see what’s set. Leftover configs from old projects or global settings mess this up all the time. I hit the same thing on a React project where old config was still cached.

Try clearing everything: npm cache clean --force, delete node_modules and package-lock.json, then npm install fresh.

Since --dev works but regular install doesn’t, it’s definitely a config issue. Your package.json looks fine. The --dev flag is deprecated anyway, so that’s another clue pointing to config problems.