3 ms·
If your NPM installs are mysteriously slow in Docker, try adding this line before 'npm install': RUN npm config set registry https://registry.npmjs.org/ https:
by rhinoceraptor 11y ago
If your NPM installs are mysteriously slow in Docker, try adding this line before 'npm install':
RUN npm config set registry https://registry.npmjs.org/ https://registry.npmjs.org/
I don't know why it works, but it does.
- opendomain 11y agoCan anyone tell me what this does? This looks like a configuration files in JSON, but why do these setting make it work in docker? If my docker image size is different, which parameter in this would I change?
- bhanu423 11y agoWell this just tells the npm client to download the modules from official registry which is "https://registry.npmjs.org" https://registry.npmjs.org". Extra info: If you want even faster downloads within an organization(or wherever recurring npm install might occur), I would recommend setting up a local lazy mirror. PS: I maintain one such lazy npm mirror app-https://github.com/bhanuc/alphonso https://github.com/bhanuc/alphonso . It only stores the modules that has been requested and makes subsequent installs much faster.