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

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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?
You shouldn't need to tell your users anything. In production systems where NODE_ENV=production is set, the devDependencies will be skipped.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.