node.js - "npm --save install <module>" without actually installing the module -


for development setup, i'm using node.js inside docker container. i'm placing node_modules folder in docker image avoid potential problems caused architectural differences between non-linux host , docker engine. whenever add module, rebuild image, process invokes npm install within container. add dependency package.json, run npm --save install <module> on host computer since that's i'm editing files. installs module onto host computer doesn't need it. it's waste of time , bandwidth.

i manually edit package.json, that's error-prone , requires looking module's version number. there way make change through npm while avoiding unneeded installation?

when docker container running can run npm install inside container:

docker exec -ti <container id or name> npm install --prefix ./path/to/your/app <package> --save 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -