npm install --offline

Category: Node.js & npm/yarn

npm install --offline

Install dependencies from the local cache only

Forces npm to resolve everything from its cache and fail if any package is missing, instead of hitting the registry. Ideal for air-gapped machines or when the network is flaky. Prime the cache beforehand with npm install --prefer-offline.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.