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
Add a comment
|
1 Answer
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.
2 Comments
Daniel Kobe
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?
Steven Schobert
You shouldn't need to tell your users anything. In production systems where
NODE_ENV=production is set, the devDependencies will be skipped.