Linked Questions
13 questions linked to/from How do you prevent install of "devDependencies" NPM modules for Node.js (package.json)?
2999 votes
18 answers
1.1m views
What's the difference between dependencies, devDependencies, and peerDependencies in NPM package.json file?
This documentation answers my question very poorly. I didn't understand those explanations. Can someone say in simpler words? Maybe with examples if it's hard to choose simple words? Also added ...
225 votes
1 answer
243k views
Should the package-lock.json file be added to .gitignore? [duplicate]
To lock the versions of dependencies that are installed over a project, the command npm install creates a file called package-lock.json. This was made since Node.js v8.0.0 and npm v5.0.0, as several ...
27 votes
3 answers
105k views
Do I need to run `npm run prod` on production?
Laravel ships with a package.json file for npm. The default package.json only ships with devDependencies. npm run development is used to bundle all dependencies with web pack into a single file on ...
7 votes
1 answer
16k views
reduce size of node_modules for production
I created node_modules for uploading addon to online site from localhost with help of ngrok and using npm install in CommandPrompt. But the created node_modules folder size was 78mb. In that case i ...
2 votes
1 answer
6k views
nodejs npm install platform specific packages
My nodejs app runs on Raspberry Pi and uses a SPI interface. SPI is not available on windows. The npm package I am using fails to install on windows as I would expect. I would like to develop and do ...
1 vote
1 answer
3k views
Why does the npm package I created have a node_modules folder in it when installing it as dependency for another module?
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,...
2 votes
1 answer
4k views
Node.js cannot find module, despite module being installed
I build my application locally into a dist folder; package.json is also copied over npm install --production is run in the dist folder dist folder is then zipped up Zip is uploaded to server, where it ...
2 votes
1 answer
2k views
How to only install production dependencies and then some, but without any development dependencies?
Given the following Dockerfile and package.json, how do I get my image to only have what is defined as production dependencies in the package.json and the one additional dependency defined in the RUN -...
5 votes
2 answers
589 views
docker production code build
When creating production build with docker what is the strategy people uses about compiling and bundling the code. So outside the docker world, I would create a build (using some sort of npm command) ...
1 vote
0 answers
1k views
npm production install still installing dev dependencies
I'm trying to perform a Docker node/ts project. I don't want dev dependencies, for obvious reasons. When I run npm --production install or npm install --omit-dev or npm --production install --omit-dev,...
0 votes
1 answer
372 views
Separate dependencies between test, prod, and integration tests (Nextj.js, cypreess) to avoid installing unnecessary packages
Currently I am running into long installation process because cypress is in my dev dependencies, and when I build the following docker image: # Install dependencies only when needed FROM node:14.8.0-...
0 votes
2 answers
114 views
Need some clarification on using node_modules
Should I have to upload node_modules in production when I used --save when installing some package from NPM? They say that the packages that I have installed using --save is required to run the ...
0 votes
0 answers
47 views
How to prevent unit test libraries download when a production build is made using c# and dotnet cli?
In another languages, when a build for production is performed, there are configurations to avoid libraries or dependencies not related to the build like: unit test, code coverage, etc nodes js npm ...