diff options
Diffstat (limited to 'deps/npm/html/doc/cli/npm-shrinkwrap.html')
-rw-r--r-- | deps/npm/html/doc/cli/npm-shrinkwrap.html | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html index 78b744222b..97aa961a26 100644 --- a/deps/npm/html/doc/cli/npm-shrinkwrap.html +++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html @@ -18,14 +18,14 @@ that you can control exactly which versions of each dependency will be used when your package is installed. The <code>package.json</code> file is still required if you want to use <code>npm install</code>.</p> <p>By default, <code>npm install</code> recursively installs the target's -dependencies (as specified in package.json), choosing the latest +dependencies (as specified in <code>package.json</code>), choosing the latest available version that satisfies the dependency's semver pattern. In some situations, particularly when shipping software where each change is tightly managed, it's desirable to fully specify each version of each dependency recursively so that subsequent builds and deploys do not inadvertently pick up newer versions of a dependency that satisfy the semver pattern. Specifying specific semver patterns in each -dependency's package.json would facilitate this, but that's not always +dependency's <code>package.json</code> would facilitate this, but that's not always possible or desirable, as when another author owns the npm package. It's also possible to check dependencies directly into source control, but that may be undesirable for other reasons.</p> @@ -47,7 +47,7 @@ but that may be undesirable for other reasons.</p> } </code></pre><p>and package C:</p> <pre><code>{ - "name": "C, + "name": "C", "version": "0.0.1" } </code></pre><p>If these are the only versions of A, B, and C available in the @@ -69,7 +69,7 @@ that he or she does not want to pull in newly published versions of C when B hasn't changed at all.</p> <p>In this case, A's author can run</p> <pre><code>npm shrinkwrap -</code></pre><p>This generates npm-shrinkwrap.json, which will look something like this:</p> +</code></pre><p>This generates <code>npm-shrinkwrap.json</code>, which will look something like this:</p> <pre><code>{ "name": "A", "version": "0.1.0", @@ -86,24 +86,24 @@ when B hasn't changed at all.</p> } </code></pre><p>The shrinkwrap command has locked down the dependencies based on what's currently installed in node_modules. When <code>npm install</code> -installs a package with a npm-shrinkwrap.json file in the package -root, the shrinkwrap file (rather than package.json files) completely +installs a package with an <code>npm-shrinkwrap.json</code> in the package +root, the shrinkwrap file (rather than <code>package.json</code> files) completely drives the installation of that package and all of its dependencies (recursively). So now the author publishes A@0.1.0, and subsequent installs of this package will use B@0.0.1 and C@0.0.1, regardless the -dependencies and versions listed in A's, B's, and C's package.json +dependencies and versions listed in A's, B's, and C's <code>package.json</code> files.</p> <h3 id="using-shrinkwrapped-packages">Using shrinkwrapped packages</h3> <p>Using a shrinkwrapped package is no different than using any other package: you can <code>npm install</code> it by hand, or add a dependency to your -package.json file and <code>npm install</code> it.</p> +<code>package.json</code> file and <code>npm install</code> it.</p> <h3 id="building-shrinkwrapped-packages">Building shrinkwrapped packages</h3> <p>To shrinkwrap an existing package:</p> <ol> <li>Run <code>npm install</code> in the package root to install the current versions of all dependencies.</li> <li>Validate that the package works as expected with these versions.</li> -<li>Run <code>npm shrinkwrap</code>, add npm-shrinkwrap.json to git, and publish +<li>Run <code>npm shrinkwrap</code>, add <code>npm-shrinkwrap.json</code> to git, and publish your package.</li> </ol> <p>To add or update a dependency in a shrinkwrapped package:</p> @@ -111,24 +111,24 @@ your package.</li> <li>Run <code>npm install</code> in the package root to install the current versions of all dependencies.</li> <li>Add or update dependencies. <code>npm install</code> each new or updated -package individually and then update package.json. Note that they +package individually and then update <code>package.json</code>. Note that they must be explicitly named in order to be installed: running <code>npm install</code> with no arguments will merely reproduce the existing shrinkwrap.</li> <li>Validate that the package works as expected with the new dependencies.</li> -<li>Run <code>npm shrinkwrap</code>, commit the new npm-shrinkwrap.json, and +<li>Run <code>npm shrinkwrap</code>, commit the new <code>npm-shrinkwrap.json</code>, and publish your package.</li> </ol> <p>You can use <a href="../cli/npm-outdated.html"><a href="../cli/npm-outdated.html">npm-outdated(1)</a></a> to view dependencies with newer versions available.</p> <h3 id="other-notes">Other Notes</h3> -<p>A shrinkwrap file must be consistent with the package's package.json +<p>A shrinkwrap file must be consistent with the package's <code>package.json</code> file. <code>npm shrinkwrap</code> will fail if required dependencies are not already installed, since that would result in a shrinkwrap that wouldn't actually work. Similarly, the command will fail if there are -extraneous packages (not referenced by package.json), since that would -indicate that package.json is not correct.</p> +extraneous packages (not referenced by <code>package.json</code>), since that would +indicate that <code>package.json</code> is not correct.</p> <p>Since <code>npm shrinkwrap</code> is intended to lock down your dependencies for production use, <code>devDependencies</code> will not be included unless you explicitly set the <code>--dev</code> flag when you run <code>npm shrinkwrap</code>. If @@ -164,5 +164,5 @@ contents rather than versions.</p> <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr> <tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr> </table> -<p id="footer">npm-shrinkwrap — npm@2.10.1</p> +<p id="footer">npm-shrinkwrap — npm@2.11.0</p> |