1

I just published my first npm package. When I install the package as dependency in my project, I open the project folder in node_modules and see that it also has a node_modules folder with one package, history in the folder. I don't have any regular dependencies for my project, only devDependencies so I don't understand why this is happening? You can see my package.json file and try installing the module from the github page here https://github.com/danielyaa5/react-contextulize

Daniel Kobe
  • 9,376
  • 15
  • 62
  • 109

1 Answers1

1

Running npm install will install devDependencies under many circumstances.

Try explicitly installing in production mode:

npm install --only=production

Here is a related answer with more info.

Community
  • 1
  • 1
Steven Schobert
  • 4,201
  • 3
  • 25
  • 34
  • This doesn't make any sense to me though, there must be another way where I don't have to tell my users to install it like this? – Daniel Kobe Nov 24 '16 at 23:33
  • You shouldn't need to tell your users anything. In production systems where `NODE_ENV=production` is set, the devDependencies will be skipped. – Steven Schobert Nov 24 '16 at 23:37