File tree Expand file tree Collapse file tree 3 files changed +48
-3
lines changed Expand file tree Collapse file tree 3 files changed +48
-3
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,28 @@ This resulted in some shifts in its functionality:
173173- The ` --shell ` option is replaced with ` --script-shell ` , but maintained
174174 in the ` npx ` executable for backwards compatibility.
175175
176+ ### A note on caching
177+
178+ The npm cli utilizes its internal package cache when using the package
179+ name specified. You can use the following to change how and when the
180+ cli uses this cache. See [ ` npm cache ` ] ( /commands/npm-cache ) for more on
181+ how the cache works.
182+
183+ #### prefer-online
184+
185+ Forces staleness checks for packages, making the cli look for updates
186+ immediately even if the package is already in the cache.
187+
188+ #### prefer-offline
189+
190+ Bypasses staleness checks for packages. Missing data will still be
191+ requested from the server. To force full offline mode, use ` offline ` .
192+
193+ #### offline
194+
195+ Forces full offline mode. Any packages not locally cached will result in
196+ an error.
197+
176198### See Also
177199
178200* [ npm run-script] ( /commands/npm-run-script )
Original file line number Diff line number Diff line change @@ -71,9 +71,32 @@ Generate it without having it ask any questions:
7171$ npm init -y
7272```
7373
74+ ### A note on caching
75+
76+ The npm cli utilizes its internal package cache when using the package
77+ name specified. You can use the following to change how and when the
78+ cli uses this cache. See [ ` npm cache ` ] ( /commands/npm-cache ) for more on
79+ how the cache works.
80+
81+ #### prefer-online
82+
83+ Forces staleness checks for packages, making the cli look for updates
84+ immediately even if the package is already in the cache.
85+
86+ #### prefer-offline
87+
88+ Bypasses staleness checks for packages. Missing data will still be
89+ requested from the server. To force full offline mode, use ` offline ` .
90+
91+ #### offline
92+
93+ Forces full offline mode. Any packages not locally cached will result in
94+ an error.
95+
7496### See Also
7597
7698* [ init-package-json module] ( http://npm.im/init-package-json )
7799* [ package.json] ( /configuring-npm/package-json )
78100* [ npm version] ( /commands/npm-version )
79101* [ npm scope] ( /using-npm/scope )
102+ * [ npm exec] ( /commands/npm-exec )
Original file line number Diff line number Diff line change @@ -110,13 +110,13 @@ on how the cache works.
110110
111111#### prefer-online
112112
113- Forced staleness checks for cached searches, making the cli look for
113+ Forces staleness checks for cached searches, making the cli look for
114114updates immediately even for fresh search results.
115115
116116#### prefer-offline
117117
118- Bypasses staleness checks for cached. Missing data will still be
119- requested from the server. To force full offline mode, use ` offline ` .
118+ Bypasses staleness checks for cached searches . Missing data will still
119+ be requested from the server. To force full offline mode, use ` offline ` .
120120
121121#### offline
122122
You can’t perform that action at this time.
0 commit comments