diff --git a/deps/npm/.travis.yml b/deps/npm/.travis.yml index 59fddd7f29..eff4750f3e 100644 --- a/deps/npm/.travis.yml +++ b/deps/npm/.travis.yml @@ -1,4 +1,5 @@ language: node_js +sudo: false node_js: - "5" - "4" @@ -11,7 +12,7 @@ env: before_install: - "npm config set spin false" - "npm install -g npm/npm#2.x" - - "sudo mkdir -p /var/run/couchdb" + - "mkdir -p /var/run/couchdb" script: "npm run-script test-all" notifications: slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8 diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index e1a88d3a99..2952381a70 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -329,3 +329,12 @@ ekmartin RafaΕ‚ Pocztarski Ashley Williams Mark Reeder +Tiago Rodrigues +Chris Rebert +Jeff McMahan +Scott Addie +Julian Simioni +Jimb Esser +Hal Henke +Alexis Campailla +Beau Gunderson diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index f5680c3d6f..9361445adc 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,124 @@ +### v2.14.16 (2016-01-21): + +Good to see you all again! It's been a while since we had an LTS release, and +the team continues to work hard to both get the issue tracker under control, and +get our test suite to be awesome and reliable. + +This is also the first LTS release of this year. + +We're gonna have an interesting time -- most of our focus this year will be +around stability and maintainability of the CLI, so you might actually end up +seeing a number of updates even over here, just for the sake of making sure +we're stable, that bugs get fixed, and tests have proper coverage. + +What better way to start this effort, then, than getting Travis tests green, fix +a few things here and there, and tweak a bunch of documentation? 😁 + +#### FIX ALL THE BUGS AND TWEAK ALL THE THINGS + +* [`24b13fb`](https://github.com/npm/npm/commit/24b13fbc57d34db1d5b0a37bcca122c00deba978) + [#11158](https://github.com/npm/npm/pull/11158) + Fix custom node-gyp env var quoting on Windows. + ([@orangemocha](https://github.com/orangemocha)) +* [`e2503f2`](https://github.com/npm/npm/commit/e2503f2be40157b05a9c500ec3b5d16090ffee50) + [#11142](https://github.com/npm/npm/pull/11142) + Fix race condition with `correctMkdir` in the cache directory. + ([@Jimbly](https://github.com/Jimbly)) + +* [`5c0e4c4`](https://github.com/npm/npm/commit/5c0e4c45a29d774ab729e86044377d4e5e424252) + [#10940](https://github.com/npm/npm/pull/10940) + Ignore failures replacing `package.json`. writeFileAtomic is not atomic in + Windows, it fails if the file is being accessed concurrently. + ([@orangemocha](https://github.com/orangemocha)) +* [`2c44d8d`](https://github.com/npm/npm/commit/2c44d8dc8c267d5e054d0175ce2f4750f0986463) + [#10903](https://github.com/npm/npm/pull/10903) + Add tests for `npm adduser --scope`. + ([@ekmartin](https://github.com/ekmartin)) +* [`4cb25d0`](https://github.com/npm/npm/commit/4cb25d0fed5c7792dfd1aec891380ecc1f8a5761) + [#10903](https://github.com/npm/npm/pull/10903) + Add a message informing users when they have been successfully logged in. + ([@ekmartin](https://github.com/ekmartin)) +* [`fe3ec6d`](https://github.com/npm/npm/commit/fe3ec6d6658262054c0c19c55373c21e84ab9f17) + [#10628](https://github.com/npm/npm/pull/10628) + Tell users how to open an issue with a package that has errored. + ([@trodrigues](https://github.com/trodrigues)) + +#### DOCS DOCS DOCS + +We got a TON of lovely documentation patches, too! Thanks all for submitting! + +* [`22482a1`](https://github.com/npm/npm/commit/22482a1f22079d72c3f8ca55c2f0c153bdd024c0) + [#11188](https://github.com/npm/npm/pull/11188) + Briefly explain what's included when you publish. + ([@beaugunderson](https://github.com/beaugunderson)) +* [`fa47724`](https://github.com/npm/npm/commit/fa4772438df0c66a19309dd1c1a3ce43cbee5461) + [#11150](https://github.com/npm/npm/pull/11150) + Advise use of `--depth Infinity` instead of `--depth 9999` in `npm update`. + ([@halhenke](https://github.com/halhenke)) +* [`248ddfe`](https://github.com/npm/npm/commit/248ddfe8f7ddd3318e14bf61de41cab4a638c8a3) + [#11130](https://github.com/npm/npm/pull/11130) + Nuke "using npm programmatically" section from README. The programmatic npm + API is unsupported, and is not guaranteed not to break in non-major versions. + Removing this section so newcomers aren't encouraged to discover or use it. + ([@ljharb](https://github.com/ljharb)) +* [`ae9c452`](https://github.com/npm/npm/commit/ae9c4521222d60ab4a69c19fee5e361c62f41fae) + [#11128](https://github.com/npm/npm/pull/11128) + Add link to local paths section indocs for `package.json`. + ([@orangejulius](https://github.com/orangejulius)) +* [`663a8c6`](https://github.com/npm/npm/commit/663a8c6b4b1647f9b86c15ef32e30023edc8c060) + [#11044](https://github.com/npm/npm/pull/11044) + Update default value documentation for the color option in npm's config. + ([@scottaddie](https://github.com/scottaddie)) +* [`5c1dda0`](https://github.com/npm/npm/commit/5c1dda0d3a18b2954872dba33fbc696ff0700ffe) + [#11037](https://github.com/npm/npm/pull/11037) + Correct the name property max length constraint verbiage. + ([@scottaddie](https://github.com/scottaddie)) +* [`8288365`](https://github.com/npm/npm/commit/8288365d08e97fa3a5b0d31703c015a8be49e07f) + [#10990](https://github.com/npm/npm/pull/10990) + Update folder docs to reflect that process.installPrefix was removed as of + 0.8.x. + ([@jeffmcmahan](https://github.com/jeffmcmahan)) +* [`61d63fa`](https://github.com/npm/npm/commit/61d63fa22c4f09742180c2de460a4ffb6c32738e) + [#10790](https://github.com/npm/npm/pull/10790) + Clarify that `npm install foo` is the same as `npm install foo@latest` now. + ([@cvrebert](https://github.com/cvrebert)) +* [`442c920`](https://github.com/npm/npm/commit/442c9207f375354c91d36df8711ba2d33e1c97f3) + [#10789](https://github.com/npm/npm/pull/10789) + Link over to `npm-dist-tag(1)` in `npm install` docs when they talk about the + `pkg@` syntax. + ([@cvrebert](https://github.com/cvrebert)) +* [`dca7a5e`](https://github.com/npm/npm/commit/dca7a5e2be3bfa306a870a123707d35c732406c0) + [#10788](https://github.com/npm/npm/pull/10788) + Link to tag docs in docs for `npm publish --tag`. + ([@cvrebert](https://github.com/cvrebert)) +* [`a72904e`](https://github.com/npm/npm/commit/a72904e8d4ab1d43ae8150fbe3f6468b0cbb1efd) + [#10787](https://github.com/npm/npm/pull/10787) + Explain why the `latest` tag matters. + ([@cvrebert](https://github.com/cvrebert)) +* [`9d0697a`](https://github.com/npm/npm/commit/9d0697a534046df7efda32170014041bbc1f4e7d) + [#10785](https://github.com/npm/npm/pull/10785) + Replace some quite marks in `npm dist-tag` docs for the sake of consistency. + ([@cvrebert](https://github.com/cvrebert)) + +#### I REALLY LIKE GREEN. CAN YOU TELL? + +So Travis is all green now on `npm@2`, thanks to the removal of nock and a few +other test suite tweaks. This is a fantastic step towards making sure we can all +have confidence in our test suite! πŸŽ‰ + +* [`64995be`](https://github.com/npm/npm/commit/64995be6d874356b15c136f9867302d805dfe1e9) [`75ab216`](https://github.com/npm/npm/commit/75ab2164cf79e28ac7f7ebe714f3c5aee99c6626) [`a9f6fe9`](https://github.com/npm/npm/commit/a9f6fe9dc558f17c4a7b9eb83329ac080f7df4b7) [`649c193`](https://github.com/npm/npm/commit/649c193adadf714c2819837f9372a29d724a5ec0) [`94cb05e`](https://github.com/npm/npm/commit/94cb05eaa9e5ad6675cf15c4ac0a44fbdde05900) [`6541690`](https://github.com/npm/npm/commit/65416907008061ac5a5f66b1630a57776803b526) [`255be6f`](https://github.com/npm/npm/commit/255be6f5bca9e3d216f3a5cbdf6714c6c9fcf132) [`9e84fa4`](https://github.com/npm/npm/commit/9e84fa43c49d04cf86ca1678e2a61412f5559cb9) [`8a587b0`](https://github.com/npm/npm/commit/8a587b0c1696ae7302891fa6355fc3e8670e00d3) [`bf812a5`](https://github.com/npm/npm/commit/bf812a54e497a573493346399798aa0b9373ac24) + [#10903](https://github.com/npm/npm/pull/10903) + Get rid of nock from tests, and get Travis green. + ([@zkat](https://github.com/zkat) and [@iarna](https://github.com/iarna)) +* [`70a5310`](https://github.com/npm/npm/commit/70a5310712c6666e753ca8f3bfff4a780ec6292d) + `npm-registry-couchapp@2.6.12`: + Better 0.8 compatibility, and ability to run in travis docker stuff. This + means the test suite should run a lot faster, too! + ([@iarna](https://github.com/iarna)) +* [`28fae39`](https://github.com/npm/npm/commit/28fae399212eda5554e6c0ffd8c9591144ab7b9d) + Get rid of sudo, for Travis! + ([@zkat](https://github.com/zkat)) + ### v2.14.15 (2015-12-10): Did you know that Bob Ross reached the rank of master sergeant in the US Air diff --git a/deps/npm/README.md b/deps/npm/README.md index 43b9da4e69..5e907a6b4b 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -138,52 +138,6 @@ must remove them yourself manually if you want them gone. Note that this means that future npm installs will not remember the settings that you have chosen. -## Using npm Programmatically - -Although npm can be used programmatically, its API is meant for use by the CLI -*only*, and no guarantees are made regarding its fitness for any other purpose. -If you want to use npm to reliably perform some task, the safest thing to do is -to invoke the desired `npm` command with appropriate arguments. - -The semantic version of npm refers to the CLI itself, rather than the -underlying API. _The internal API is not guaranteed to remain stable even when -npm's version indicates no breaking changes have been made according to -semver._ - -If you _still_ would like to use npm programmatically, it's _possible_. The API -isn't very well documented, but it _is_ rather simple. - -Eventually, npm will be just a thin CLI wrapper around the modules that it -depends on, but for now, there are some things that only the CLI can do. You -should try using one of npm's dependencies first, and only use the API if what -you're trying to do is only supported by npm itself. - -```javascript -var npm = require("npm") -npm.load(myConfigObject, function (er) { - if (er) return handlError(er) - npm.commands.install(["some", "args"], function (er, data) { - if (er) return commandFailed(er) - // command succeeded, and data might have some info - }) - npm.registry.log.on("log", function (message) { .... }) -}) -``` - -The `load` function takes an object hash of the command-line configs. -The various `npm.commands.` functions take an **array** of -positional argument **strings**. The last argument to any -`npm.commands.` function is a callback. Some commands take other -optional arguments. Read the source. - -You cannot set configs individually for any single npm function at this -time. Since `npm` is a singleton, any call to `npm.config.set` will -change the value for *all* npm commands in that process. - -See `./bin/npm-cli.js` for an example of pulling config values off of the -command line arguments using nopt. You may also want to check out `npm -help config` to learn about all the options you can set there. - ## More Docs Check out the [docs](https://docs.npmjs.com/), diff --git a/deps/npm/bin/node-gyp-bin/node-gyp.cmd b/deps/npm/bin/node-gyp-bin/node-gyp.cmd index 83ea8f5924..083c9c58a5 100755 --- a/deps/npm/bin/node-gyp-bin/node-gyp.cmd +++ b/deps/npm/bin/node-gyp-bin/node-gyp.cmd @@ -1,5 +1,5 @@ -if not defined npm_config_node_gyp ( - node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %* -) else ( - node %npm_config_node_gyp% %* -) +if not defined npm_config_node_gyp ( + node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %* +) else ( + node "%npm_config_node_gyp%" %* +) diff --git a/deps/npm/doc/cli/npm-dist-tag.md b/deps/npm/doc/cli/npm-dist-tag.md index 9213816514..06721bbae6 100644 --- a/deps/npm/doc/cli/npm-dist-tag.md +++ b/deps/npm/doc/cli/npm-dist-tag.md @@ -33,17 +33,30 @@ When installing dependencies, a preferred tagged version may be specified: This also applies to `npm dedupe`. -Publishing a package sets the "latest" tag to the published version unless the +Publishing a package sets the `latest` tag to the published version unless the `--tag` option is used. For example, `npm publish --tag=beta`. +By default, `npm install ` (without any `@` or `@` +specifier) installs the `latest` tag. + ## PURPOSE -Tags can be used to provide an alias instead of version numbers. For -example, `npm` currently uses the tag "next" to identify the upcoming -version, and the tag "latest" to identify the current version. +Tags can be used to provide an alias instead of version numbers. + +For example, a project might choose to have multiple streams of development +and use a different tag for each stream, +e.g., `stable`, `beta`, `dev`, `canary`. + +By default, the `latest` tag is used by npm to identify the current version of +a package, and `npm install ` (without any `@` or `@` +specifier) installs the `latest` tag. Typically, projects only use the `latest` +tag for stable release versions, and use other tags for unstable versions such +as prereleases. + +The `next` tag is used by some projects to identify the upcoming version. -A project might choose to have multiple streams of development, e.g., -"stable", "canary". +By default, other than `latest`, no tag has any special significance to npm +itself. ## CAVEATS diff --git a/deps/npm/doc/cli/npm-install.md b/deps/npm/doc/cli/npm-install.md index 16b31fa0da..3ae1f0aae3 100644 --- a/deps/npm/doc/cli/npm-install.md +++ b/deps/npm/doc/cli/npm-install.md @@ -25,7 +25,7 @@ A `package` is: * b) a gzipped tarball containing (a) * c) a url that resolves to (b) * d) a `@` that is published on the registry (see `npm-registry(7)`) with (c) -* e) a `@` that points to (d) +* e) a `@` (see `npm-dist-tag(1)`) that points to (d) * f) a `` that has a "latest" tag satisfying (e) * g) a `` that resolves to (b) @@ -76,7 +76,7 @@ after packing it up into a tarball (b). * `npm install [@/] [--save|--save-dev|--save-optional]`: Do a `@` install, where `` is the "tag" config. (See - `npm-config(7)`.) + `npm-config(7)`. The config's default value is `latest`.) In most cases, this will install the latest version of the module published on npm. diff --git a/deps/npm/doc/cli/npm-publish.md b/deps/npm/doc/cli/npm-publish.md index 8c447d0df9..cf2f4feb53 100644 --- a/deps/npm/doc/cli/npm-publish.md +++ b/deps/npm/doc/cli/npm-publish.md @@ -9,9 +9,11 @@ npm-publish(1) -- Publish a package ## DESCRIPTION -Publishes a package to the registry so that it can be installed by name. See -`npm-developers(7)` for details on what's included in the published package, as -well as details on how the package is built. +Publishes a package to the registry so that it can be installed by name. All +files in the package directory are included if no local `.gitignore` or +`.npmignore` file is present. See `npm-developers(7)` for full details on +what's included in the published package, as well as details on how the package +is built. By default npm will publish to the public registry. This can be overridden by specifying a different default registry or using a `npm-scope(7)` in the name @@ -27,7 +29,8 @@ specifying a different default registry or using a `npm-scope(7)` in the name * `[--tag ]` Registers the published package with the given tag, such that `npm install @` will install this version. By default, `npm publish` updates - and `npm install` installs the `latest` tag. + and `npm install` installs the `latest` tag. See `npm-dist-tag(1)` for + details about tags. * `[--access ]` Tells the registry whether this package should be published as public or diff --git a/deps/npm/doc/cli/npm-update.md b/deps/npm/doc/cli/npm-update.md index ce31c28910..7285226d42 100644 --- a/deps/npm/doc/cli/npm-update.md +++ b/deps/npm/doc/cli/npm-update.md @@ -22,7 +22,7 @@ or local) will be updated. As of `npm@2.6.1`, the `npm update` will only inspect top-level packages. Prior versions of `npm` would also recursively inspect all dependencies. -To get the old behavior, use `npm --depth 9999 update`, but be warned that +To get the old behavior, use `npm --depth Infinity update`, but be warned that simultaneous asynchronous update of all packages, including `npm` itself and packages that `npm` depends on, often causes problems up to and including the uninstallation of `npm` itself. diff --git a/deps/npm/doc/files/npm-folders.md b/deps/npm/doc/files/npm-folders.md index 18b7ea50dd..6846b1fce8 100644 --- a/deps/npm/doc/files/npm-folders.md +++ b/deps/npm/doc/files/npm-folders.md @@ -20,12 +20,10 @@ This document will tell you what it puts where. ### prefix Configuration The `prefix` config defaults to the location where node is installed. -On most systems, this is `/usr/local`, and most of the time is the same -as node's `process.installPrefix`. - -On windows, this is the exact location of the node.exe binary. On Unix -systems, it's one level up, since node is typically installed at -`{prefix}/bin/node` rather than `{prefix}/node.exe`. +On most systems, this is `/usr/local`. On windows, this is the exact +location of the node.exe binary. On Unix systems, it's one level up, +since node is typically installed at `{prefix}/bin/node` rather than +`{prefix}/node.exe`. When the `global` flag is set, npm installs things into this prefix. When it is not set, it uses the root of the current package, or the diff --git a/deps/npm/doc/files/package.json.md b/deps/npm/doc/files/package.json.md index ff6686ba21..841e7f4532 100644 --- a/deps/npm/doc/files/package.json.md +++ b/deps/npm/doc/files/package.json.md @@ -21,7 +21,7 @@ The name is what your thing is called. Some rules: -* The name must be shorter than 214 characters. This includes the scope for +* The name must be less than or equal to 214 characters. This includes the scope for scoped packages. * The name can't start with a dot or an underscore. * New packages must not have uppercase letters in the name. @@ -410,7 +410,7 @@ See semver(7) for more details about specifying version ranges. * `git...` See 'Git URLs as Dependencies' below * `user/repo` See 'GitHub URLs' below * `tag` A specific version tagged and published as `tag` See `npm-tag(1)` -* `path/path/path` See Local Paths below +* `path/path/path` See [Local Paths](#local-paths) below For example, these are all valid: diff --git a/deps/npm/doc/misc/npm-config.md b/deps/npm/doc/misc/npm-config.md index 4b9d32ba33..76471601c1 100644 --- a/deps/npm/doc/misc/npm-config.md +++ b/deps/npm/doc/misc/npm-config.md @@ -232,7 +232,7 @@ A client certificate to pass when accessing the registry. ### color -* Default: true on Posix, false on Windows +* Default: true * Type: Boolean or `"always"` If false, never shows colors. If `"always"` then always shows colors. diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html index 952cd66ff9..3f9521992e 100644 --- a/deps/npm/html/doc/README.html +++ b/deps/npm/html/doc/README.html @@ -92,42 +92,6 @@ npm config get globalconfig # defaults to /usr/local/etc/npmrc must remove them yourself manually if you want them gone. Note that this means that future npm installs will not remember the settings that you have chosen.

-

Using npm Programmatically

-

Although npm can be used programmatically, its API is meant for use by the CLI -only, and no guarantees are made regarding its fitness for any other purpose. -If you want to use npm to reliably perform some task, the safest thing to do is -to invoke the desired npm command with appropriate arguments.

-

The semantic version of npm refers to the CLI itself, rather than the -underlying API. The internal API is not guaranteed to remain stable even when -npm's version indicates no breaking changes have been made according to -semver.

-

If you still would like to use npm programmatically, it's possible. The API -isn't very well documented, but it is rather simple.

-

Eventually, npm will be just a thin CLI wrapper around the modules that it -depends on, but for now, there are some things that only the CLI can do. You -should try using one of npm's dependencies first, and only use the API if what -you're trying to do is only supported by npm itself.

-
var npm = require("npm")
-npm.load(myConfigObject, function (er) {
-  if (er) return handlError(er)
-  npm.commands.install(["some", "args"], function (er, data) {
-    if (er) return commandFailed(er)
-    // command succeeded, and data might have some info
-  })
-  npm.registry.log.on("log", function (message) { .... })
-})
-
-

The load function takes an object hash of the command-line configs. -The various npm.commands.<cmd> functions take an array of -positional argument strings. The last argument to any -npm.commands.<cmd> function is a callback. Some commands take other -optional arguments. Read the source.

-

You cannot set configs individually for any single npm function at this -time. Since npm is a singleton, any call to npm.config.set will -change the value for all npm commands in that process.

-

See ./bin/npm-cli.js for an example of pulling config values off of the -command line arguments using nopt. You may also want to check out npm -help config to learn about all the options you can set there.

More Docs

Check out the docs, especially the faq.

@@ -163,5 +127,5 @@ will no doubt tell you to put the output in a gist or email.

       - + diff --git a/deps/npm/html/doc/api/npm-bin.html b/deps/npm/html/doc/api/npm-bin.html index c447623ac8..3d9299365d 100644 --- a/deps/npm/html/doc/api/npm-bin.html +++ b/deps/npm/html/doc/api/npm-bin.html @@ -28,5 +28,5 @@ to the npm.bin property.

       - + diff --git a/deps/npm/html/doc/api/npm-bugs.html b/deps/npm/html/doc/api/npm-bugs.html index 6fd7c5856d..63271d8875 100644 --- a/deps/npm/html/doc/api/npm-bugs.html +++ b/deps/npm/html/doc/api/npm-bugs.html @@ -33,5 +33,5 @@ friendly for programmatic use.

       - + diff --git a/deps/npm/html/doc/api/npm-cache.html b/deps/npm/html/doc/api/npm-cache.html index 0a37bb27f4..6cf0017675 100644 --- a/deps/npm/html/doc/api/npm-cache.html +++ b/deps/npm/html/doc/api/npm-cache.html @@ -42,5 +42,5 @@ incrementation.

       - + diff --git a/deps/npm/html/doc/api/npm-commands.html b/deps/npm/html/doc/api/npm-commands.html index c672cb3a16..433d7da710 100644 --- a/deps/npm/html/doc/api/npm-commands.html +++ b/deps/npm/html/doc/api/npm-commands.html @@ -36,5 +36,5 @@ usage, or man 3 npm-<command> for programmatic usage.

       - + diff --git a/deps/npm/html/doc/api/npm-config.html b/deps/npm/html/doc/api/npm-config.html index f8d8ae30c0..9b6e7874f4 100644 --- a/deps/npm/html/doc/api/npm-config.html +++ b/deps/npm/html/doc/api/npm-config.html @@ -57,5 +57,5 @@ functions instead.

       - + diff --git a/deps/npm/html/doc/api/npm-deprecate.html b/deps/npm/html/doc/api/npm-deprecate.html index 4b1c74daae..92beadcd62 100644 --- a/deps/npm/html/doc/api/npm-deprecate.html +++ b/deps/npm/html/doc/api/npm-deprecate.html @@ -47,5 +47,5 @@ a deprecation warning to all who attempt to install it.

       - + diff --git a/deps/npm/html/doc/api/npm-docs.html b/deps/npm/html/doc/api/npm-docs.html index 7d8e3ab7d9..b29244a76f 100644 --- a/deps/npm/html/doc/api/npm-docs.html +++ b/deps/npm/html/doc/api/npm-docs.html @@ -33,5 +33,5 @@ friendly for programmatic use.

       - + diff --git a/deps/npm/html/doc/api/npm-edit.html b/deps/npm/html/doc/api/npm-edit.html index 0931efe8b6..a28d16fa95 100644 --- a/deps/npm/html/doc/api/npm-edit.html +++ b/deps/npm/html/doc/api/npm-edit.html @@ -36,5 +36,5 @@ and how this is used.

       - + diff --git a/deps/npm/html/doc/api/npm-explore.html b/deps/npm/html/doc/api/npm-explore.html index 9840342a02..f2e43f9f4f 100644 --- a/deps/npm/html/doc/api/npm-explore.html +++ b/deps/npm/html/doc/api/npm-explore.html @@ -31,5 +31,5 @@ sure to use npm rebuild <pkg> if you make any changes.

       - + diff --git a/deps/npm/html/doc/api/npm-help-search.html b/deps/npm/html/doc/api/npm-help-search.html index 49b22cdfaf..d4c8c152ac 100644 --- a/deps/npm/html/doc/api/npm-help-search.html +++ b/deps/npm/html/doc/api/npm-help-search.html @@ -44,5 +44,5 @@ Name of the file that matched        - + diff --git a/deps/npm/html/doc/api/npm-init.html b/deps/npm/html/doc/api/npm-init.html index 3fd3a058eb..38707e957b 100644 --- a/deps/npm/html/doc/api/npm-init.html +++ b/deps/npm/html/doc/api/npm-init.html @@ -39,5 +39,5 @@ then go ahead and use this programmatically.

       - + diff --git a/deps/npm/html/doc/api/npm-install.html b/deps/npm/html/doc/api/npm-install.html index 127f9b1521..19c83deb24 100644 --- a/deps/npm/html/doc/api/npm-install.html +++ b/deps/npm/html/doc/api/npm-install.html @@ -32,5 +32,5 @@ installed or when an error has been encountered.

       - + diff --git a/deps/npm/html/doc/api/npm-link.html b/deps/npm/html/doc/api/npm-link.html index 0cce1cbed8..2cf378d861 100644 --- a/deps/npm/html/doc/api/npm-link.html +++ b/deps/npm/html/doc/api/npm-link.html @@ -42,5 +42,5 @@ the package in the current working directory

       - + diff --git a/deps/npm/html/doc/api/npm-load.html b/deps/npm/html/doc/api/npm-load.html index 571a75850e..f1a9f5be4b 100644 --- a/deps/npm/html/doc/api/npm-load.html +++ b/deps/npm/html/doc/api/npm-load.html @@ -37,5 +37,5 @@ config object.

       - + diff --git a/deps/npm/html/doc/api/npm-ls.html b/deps/npm/html/doc/api/npm-ls.html index 8e2854ea35..1a47dbcb3d 100644 --- a/deps/npm/html/doc/api/npm-ls.html +++ b/deps/npm/html/doc/api/npm-ls.html @@ -63,5 +63,5 @@ dependency will only be output once.

       - + diff --git a/deps/npm/html/doc/api/npm-outdated.html b/deps/npm/html/doc/api/npm-outdated.html index 40f8da3f8e..dc100aba62 100644 --- a/deps/npm/html/doc/api/npm-outdated.html +++ b/deps/npm/html/doc/api/npm-outdated.html @@ -28,5 +28,5 @@ currently outdated.

       - + diff --git a/deps/npm/html/doc/api/npm-owner.html b/deps/npm/html/doc/api/npm-owner.html index 3297a9bf1e..ffcf76e4db 100644 --- a/deps/npm/html/doc/api/npm-owner.html +++ b/deps/npm/html/doc/api/npm-owner.html @@ -47,5 +47,5 @@ that is not implemented at this time.

       - + diff --git a/deps/npm/html/doc/api/npm-pack.html b/deps/npm/html/doc/api/npm-pack.html index 42da30ddc7..c28bd7032b 100644 --- a/deps/npm/html/doc/api/npm-pack.html +++ b/deps/npm/html/doc/api/npm-pack.html @@ -33,5 +33,5 @@ overwritten the second time.

       - + diff --git a/deps/npm/html/doc/api/npm-ping.html b/deps/npm/html/doc/api/npm-ping.html index b91891ba27..c73766fbe2 100644 --- a/deps/npm/html/doc/api/npm-ping.html +++ b/deps/npm/html/doc/api/npm-ping.html @@ -29,4 +29,4 @@ to npm registries.

       - + diff --git a/deps/npm/html/doc/api/npm-prefix.html b/deps/npm/html/doc/api/npm-prefix.html index 96b6f0e463..09abb2eeec 100644 --- a/deps/npm/html/doc/api/npm-prefix.html +++ b/deps/npm/html/doc/api/npm-prefix.html @@ -29,5 +29,5 @@        - + diff --git a/deps/npm/html/doc/api/npm-prune.html b/deps/npm/html/doc/api/npm-prune.html index 3584f02015..270157cb00 100644 --- a/deps/npm/html/doc/api/npm-prune.html +++ b/deps/npm/html/doc/api/npm-prune.html @@ -30,5 +30,5 @@ package's dependencies list.

       - + diff --git a/deps/npm/html/doc/api/npm-publish.html b/deps/npm/html/doc/api/npm-publish.html index c9c20e7907..fde56865e2 100644 --- a/deps/npm/html/doc/api/npm-publish.html +++ b/deps/npm/html/doc/api/npm-publish.html @@ -46,5 +46,5 @@ the registry. Overwrites when the "force" environment variable is set        - + diff --git a/deps/npm/html/doc/api/npm-rebuild.html b/deps/npm/html/doc/api/npm-rebuild.html index d2c258f534..2120b230b1 100644 --- a/deps/npm/html/doc/api/npm-rebuild.html +++ b/deps/npm/html/doc/api/npm-rebuild.html @@ -30,5 +30,5 @@ the new binary. If no 'packages' parameter is specify, every package wil        - + diff --git a/deps/npm/html/doc/api/npm-repo.html b/deps/npm/html/doc/api/npm-repo.html index 6523acc746..d9dd7e1e6a 100644 --- a/deps/npm/html/doc/api/npm-repo.html +++ b/deps/npm/html/doc/api/npm-repo.html @@ -33,5 +33,5 @@ friendly for programmatic use.

       - + diff --git a/deps/npm/html/doc/api/npm-restart.html b/deps/npm/html/doc/api/npm-restart.html index 3d30112b71..27eb9bd467 100644 --- a/deps/npm/html/doc/api/npm-restart.html +++ b/deps/npm/html/doc/api/npm-restart.html @@ -52,5 +52,5 @@ behavior will be accompanied by an increase in major version number

       - + diff --git a/deps/npm/html/doc/api/npm-root.html b/deps/npm/html/doc/api/npm-root.html index 82ef516c3c..011375f8e9 100644 --- a/deps/npm/html/doc/api/npm-root.html +++ b/deps/npm/html/doc/api/npm-root.html @@ -29,5 +29,5 @@        - + diff --git a/deps/npm/html/doc/api/npm-run-script.html b/deps/npm/html/doc/api/npm-run-script.html index 7c4837904b..e592eb968d 100644 --- a/deps/npm/html/doc/api/npm-run-script.html +++ b/deps/npm/html/doc/api/npm-run-script.html @@ -41,5 +41,5 @@ assumed to be the command to run. All other elements are ignored.

       - + diff --git a/deps/npm/html/doc/api/npm-search.html b/deps/npm/html/doc/api/npm-search.html index 1dbd50a8bb..32b7fc9f1a 100644 --- a/deps/npm/html/doc/api/npm-search.html +++ b/deps/npm/html/doc/api/npm-search.html @@ -53,5 +53,5 @@ like).

       - + diff --git a/deps/npm/html/doc/api/npm-shrinkwrap.html b/deps/npm/html/doc/api/npm-shrinkwrap.html index 44bbe67b8e..b8891e749f 100644 --- a/deps/npm/html/doc/api/npm-shrinkwrap.html +++ b/deps/npm/html/doc/api/npm-shrinkwrap.html @@ -33,5 +33,5 @@ been saved.

       - + diff --git a/deps/npm/html/doc/api/npm-start.html b/deps/npm/html/doc/api/npm-start.html index c4f2b9e252..bcd448db28 100644 --- a/deps/npm/html/doc/api/npm-start.html +++ b/deps/npm/html/doc/api/npm-start.html @@ -28,5 +28,5 @@        - + diff --git a/deps/npm/html/doc/api/npm-stop.html b/deps/npm/html/doc/api/npm-stop.html index c1a4969652..af310632bc 100644 --- a/deps/npm/html/doc/api/npm-stop.html +++ b/deps/npm/html/doc/api/npm-stop.html @@ -28,5 +28,5 @@ in the packages parameter.

       - + diff --git a/deps/npm/html/doc/api/npm-tag.html b/deps/npm/html/doc/api/npm-tag.html index 74b9fdca62..49756460b4 100644 --- a/deps/npm/html/doc/api/npm-tag.html +++ b/deps/npm/html/doc/api/npm-tag.html @@ -36,5 +36,5 @@ used. For more information about how to set this config, check        - + diff --git a/deps/npm/html/doc/api/npm-test.html b/deps/npm/html/doc/api/npm-test.html index a532ca8a02..bdc9c481df 100644 --- a/deps/npm/html/doc/api/npm-test.html +++ b/deps/npm/html/doc/api/npm-test.html @@ -30,5 +30,5 @@ in the packages parameter.

       - + diff --git a/deps/npm/html/doc/api/npm-uninstall.html b/deps/npm/html/doc/api/npm-uninstall.html index 926f984945..d5c225f9bb 100644 --- a/deps/npm/html/doc/api/npm-uninstall.html +++ b/deps/npm/html/doc/api/npm-uninstall.html @@ -30,5 +30,5 @@ uninstalled or when an error has been encountered.

       - + diff --git a/deps/npm/html/doc/api/npm-unpublish.html b/deps/npm/html/doc/api/npm-unpublish.html index b07dce819e..264c005ba8 100644 --- a/deps/npm/html/doc/api/npm-unpublish.html +++ b/deps/npm/html/doc/api/npm-unpublish.html @@ -33,5 +33,5 @@ the root package entry is removed from the registry entirely.

       - + diff --git a/deps/npm/html/doc/api/npm-update.html b/deps/npm/html/doc/api/npm-update.html index 44335e595b..68280b7c1b 100644 --- a/deps/npm/html/doc/api/npm-update.html +++ b/deps/npm/html/doc/api/npm-update.html @@ -33,5 +33,5 @@ parameter will be called when done or when an error occurs.

       - + diff --git a/deps/npm/html/doc/api/npm-version.html b/deps/npm/html/doc/api/npm-version.html index b6090eca5c..00c68be820 100644 --- a/deps/npm/html/doc/api/npm-version.html +++ b/deps/npm/html/doc/api/npm-version.html @@ -32,5 +32,5 @@ not have exactly one element. The only element should be a version number.

       - + diff --git a/deps/npm/html/doc/api/npm-view.html b/deps/npm/html/doc/api/npm-view.html index 82aa620c41..2c8e33bdbb 100644 --- a/deps/npm/html/doc/api/npm-view.html +++ b/deps/npm/html/doc/api/npm-view.html @@ -81,5 +81,5 @@ the field name.

       - + diff --git a/deps/npm/html/doc/api/npm-whoami.html b/deps/npm/html/doc/api/npm-whoami.html index bf6a49701f..151b9c090e 100644 --- a/deps/npm/html/doc/api/npm-whoami.html +++ b/deps/npm/html/doc/api/npm-whoami.html @@ -29,5 +29,5 @@        - + diff --git a/deps/npm/html/doc/api/npm.html b/deps/npm/html/doc/api/npm.html index e00ae9e9f4..c075b2df28 100644 --- a/deps/npm/html/doc/api/npm.html +++ b/deps/npm/html/doc/api/npm.html @@ -23,7 +23,7 @@ npm.load([configObject, ]function (er, npm) { npm.commands.install(["package"], cb) })

VERSION

-

2.14.15

+

2.14.16

DESCRIPTION

This is the API documentation for npm. To find documentation of the command line @@ -109,5 +109,5 @@ method names. Use the npm.deref method to find the real name.

       - + diff --git a/deps/npm/html/doc/cli/npm-access.html b/deps/npm/html/doc/cli/npm-access.html index 927ad46d9d..960f36e56e 100644 --- a/deps/npm/html/doc/cli/npm-access.html +++ b/deps/npm/html/doc/cli/npm-access.html @@ -84,5 +84,5 @@ with an HTTP 402 status code (logically enough), unless you use        - + diff --git a/deps/npm/html/doc/cli/npm-adduser.html b/deps/npm/html/doc/cli/npm-adduser.html index 8db22a998e..2f39869491 100644 --- a/deps/npm/html/doc/cli/npm-adduser.html +++ b/deps/npm/html/doc/cli/npm-adduser.html @@ -68,5 +68,5 @@ precedence over any global configuration.

       - + diff --git a/deps/npm/html/doc/cli/npm-bin.html b/deps/npm/html/doc/cli/npm-bin.html index 051a17dc4e..a88f31d379 100644 --- a/deps/npm/html/doc/cli/npm-bin.html +++ b/deps/npm/html/doc/cli/npm-bin.html @@ -35,5 +35,5 @@        - + diff --git a/deps/npm/html/doc/cli/npm-bugs.html b/deps/npm/html/doc/cli/npm-bugs.html index e534ce8a70..42bdbf210f 100644 --- a/deps/npm/html/doc/cli/npm-bugs.html +++ b/deps/npm/html/doc/cli/npm-bugs.html @@ -54,5 +54,5 @@ a package.json in the current folder and use the name        - + diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html index d9d13e67ca..b21c444163 100644 --- a/deps/npm/html/doc/cli/npm-build.html +++ b/deps/npm/html/doc/cli/npm-build.html @@ -40,5 +40,5 @@ directly, run:

       - + diff --git a/deps/npm/html/doc/cli/npm-bundle.html b/deps/npm/html/doc/cli/npm-bundle.html index 808ef0e578..5d015febd2 100644 --- a/deps/npm/html/doc/cli/npm-bundle.html +++ b/deps/npm/html/doc/cli/npm-bundle.html @@ -31,5 +31,5 @@ install packages into the local space.

       - + diff --git a/deps/npm/html/doc/cli/npm-cache.html b/deps/npm/html/doc/cli/npm-cache.html index e7271f0dd8..9b1da7a0e9 100644 --- a/deps/npm/html/doc/cli/npm-cache.html +++ b/deps/npm/html/doc/cli/npm-cache.html @@ -81,5 +81,5 @@ they do not make an HTTP request to the registry.

       - + diff --git a/deps/npm/html/doc/cli/npm-completion.html b/deps/npm/html/doc/cli/npm-completion.html index b17b42d9c7..c7e98ec93c 100644 --- a/deps/npm/html/doc/cli/npm-completion.html +++ b/deps/npm/html/doc/cli/npm-completion.html @@ -42,5 +42,5 @@ completions based on the arguments.

       - + diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html index 5dd370f679..5880af7c42 100644 --- a/deps/npm/html/doc/cli/npm-config.html +++ b/deps/npm/html/doc/cli/npm-config.html @@ -66,5 +66,5 @@ global config.

       - + diff --git a/deps/npm/html/doc/cli/npm-dedupe.html b/deps/npm/html/doc/cli/npm-dedupe.html index 7708ab7f83..9602b2ae9d 100644 --- a/deps/npm/html/doc/cli/npm-dedupe.html +++ b/deps/npm/html/doc/cli/npm-dedupe.html @@ -63,5 +63,5 @@ versions.

       - + diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html index 1eb1e17bb8..c98a34e75c 100644 --- a/deps/npm/html/doc/cli/npm-deprecate.html +++ b/deps/npm/html/doc/cli/npm-deprecate.html @@ -38,5 +38,5 @@ something like this:

       - + diff --git a/deps/npm/html/doc/cli/npm-dist-tag.html b/deps/npm/html/doc/cli/npm-dist-tag.html index 7e6d02ee5d..3b8a8a8490 100644 --- a/deps/npm/html/doc/cli/npm-dist-tag.html +++ b/deps/npm/html/doc/cli/npm-dist-tag.html @@ -35,14 +35,23 @@ of using a specific version number:

When installing dependencies, a preferred tagged version may be specified:

npm install --tag <tag>
 

This also applies to npm dedupe.

-

Publishing a package sets the "latest" tag to the published version unless the +

Publishing a package sets the latest tag to the published version unless the --tag option is used. For example, npm publish --tag=beta.

+

By default, npm install <pkg> (without any @<version> or @<tag> +specifier) installs the latest tag.

PURPOSE

-

Tags can be used to provide an alias instead of version numbers. For -example, npm currently uses the tag "next" to identify the upcoming -version, and the tag "latest" to identify the current version.

-

A project might choose to have multiple streams of development, e.g., -"stable", "canary".

+

Tags can be used to provide an alias instead of version numbers.

+

For example, a project might choose to have multiple streams of development +and use a different tag for each stream, +e.g., stable, beta, dev, canary.

+

By default, the latest tag is used by npm to identify the current version of +a package, and npm install <pkg> (without any @<version> or @<tag> +specifier) installs the latest tag. Typically, projects only use the latest +tag for stable release versions, and use other tags for unstable versions such +as prereleases.

+

The next tag is used by some projects to identify the upcoming version.

+

By default, other than latest, no tag has any special significance to npm +itself.

CAVEATS

This command used to be known as npm tag, which only created new tags, and so had a different syntax.

@@ -76,5 +85,5 @@ begin with a number or the letter v.

       - + diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html index f85bf792c3..14b4760d3f 100644 --- a/deps/npm/html/doc/cli/npm-docs.html +++ b/deps/npm/html/doc/cli/npm-docs.html @@ -56,5 +56,5 @@ the current folder and use the name property.

       - + diff --git a/deps/npm/html/doc/cli/npm-edit.html b/deps/npm/html/doc/cli/npm-edit.html index feb7936a42..a7549f551b 100644 --- a/deps/npm/html/doc/cli/npm-edit.html +++ b/deps/npm/html/doc/cli/npm-edit.html @@ -49,5 +49,5 @@ or "notepad" on Windows.        - + diff --git a/deps/npm/html/doc/cli/npm-explore.html b/deps/npm/html/doc/cli/npm-explore.html index 24ab1f1564..0708c2733f 100644 --- a/deps/npm/html/doc/cli/npm-explore.html +++ b/deps/npm/html/doc/cli/npm-explore.html @@ -49,5 +49,5 @@ Windows        - + diff --git a/deps/npm/html/doc/cli/npm-help-search.html b/deps/npm/html/doc/cli/npm-help-search.html index 9126696751..f7bd1b3ada 100644 --- a/deps/npm/html/doc/cli/npm-help-search.html +++ b/deps/npm/html/doc/cli/npm-help-search.html @@ -46,5 +46,5 @@ where the terms were found in the documentation.

       - + diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html index be9418fc14..1d297b8a29 100644 --- a/deps/npm/html/doc/cli/npm-help.html +++ b/deps/npm/html/doc/cli/npm-help.html @@ -52,5 +52,5 @@ matches are equivalent to specifying a topic name.

       - + diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html index b92411fe28..8d2fe31bde 100644 --- a/deps/npm/html/doc/cli/npm-init.html +++ b/deps/npm/html/doc/cli/npm-init.html @@ -48,5 +48,5 @@ defaults and not prompt you for any options.

       - + diff --git a/deps/npm/html/doc/cli/npm-install.html b/deps/npm/html/doc/cli/npm-install.html index 7281f12576..4edb8b1bbc 100644 --- a/deps/npm/html/doc/cli/npm-install.html +++ b/deps/npm/html/doc/cli/npm-install.html @@ -30,7 +30,7 @@ by that. See npm-shrinkwrap(1).

  • b) a gzipped tarball containing (a)
  • c) a url that resolves to (b)
  • d) a <name>@<version> that is published on the registry (see npm-registry(7)) with (c)
  • -
  • e) a <name>@<tag> that points to (d)
  • +
  • e) a <name>@<tag> (see npm-dist-tag(1)) that points to (d)
  • f) a <name> that has a "latest" tag satisfying (e)
  • g) a <git remote url> that resolves to (b)
  • @@ -68,7 +68,7 @@ after packing it up into a tarball (b).

  • npm install [@<scope>/]<name> [--save|--save-dev|--save-optional]:

    Do a <name>@<tag> install, where <tag> is the "tag" config. (See - npm-config(7).)

    + npm-config(7). The config's default value is latest.)

    In most cases, this will install the latest version of the module published on npm.

    Example:

    @@ -279,5 +279,5 @@ affects a real use-case, it will be investigated.

           - + diff --git a/deps/npm/html/doc/cli/npm-link.html b/deps/npm/html/doc/cli/npm-link.html index 89c8d82bc0..7d9500725b 100644 --- a/deps/npm/html/doc/cli/npm-link.html +++ b/deps/npm/html/doc/cli/npm-link.html @@ -72,5 +72,5 @@ include that scope, e.g.

           - + diff --git a/deps/npm/html/doc/cli/npm-logout.html b/deps/npm/html/doc/cli/npm-logout.html index b09df9cc7d..577dc95459 100644 --- a/deps/npm/html/doc/cli/npm-logout.html +++ b/deps/npm/html/doc/cli/npm-logout.html @@ -55,5 +55,5 @@ that registry at the same time.

           - + diff --git a/deps/npm/html/doc/cli/npm-ls.html b/deps/npm/html/doc/cli/npm-ls.html index 74c7c4e6d7..9b4ec16687 100644 --- a/deps/npm/html/doc/cli/npm-ls.html +++ b/deps/npm/html/doc/cli/npm-ls.html @@ -22,7 +22,7 @@ installed, as well as their dependencies, in a tree-structure.

    limit the results to only the paths to the packages named. Note that nested packages will also show the paths to the specified packages. For example, running npm ls promzard in npm's source tree will show:

    -
    npm@2.14.15 /path/to/npm
    +
    npm@2.14.16 /path/to/npm
     └─┬ init-package-json@0.0.4
       └── promzard@0.1.5
     

    It will print out extraneous, missing, and invalid packages.

    @@ -97,5 +97,5 @@ project.

           - + diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html index 76687c3384..a4e1f6f12c 100644 --- a/deps/npm/html/doc/cli/npm-outdated.html +++ b/deps/npm/html/doc/cli/npm-outdated.html @@ -115,5 +115,5 @@ project.

           - + diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html index 73a457835f..cbd00b28c4 100644 --- a/deps/npm/html/doc/cli/npm-owner.html +++ b/deps/npm/html/doc/cli/npm-owner.html @@ -49,5 +49,5 @@ that is not implemented at this time.

           - + diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html index b68e2f695c..a0214d27a2 100644 --- a/deps/npm/html/doc/cli/npm-pack.html +++ b/deps/npm/html/doc/cli/npm-pack.html @@ -41,5 +41,5 @@ overwritten the second time.

           - + diff --git a/deps/npm/html/doc/cli/npm-ping.html b/deps/npm/html/doc/cli/npm-ping.html index 0b8ffbf96f..5283e84e2b 100644 --- a/deps/npm/html/doc/cli/npm-ping.html +++ b/deps/npm/html/doc/cli/npm-ping.html @@ -32,4 +32,4 @@        - + diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html index 40f4bde492..9c6eb2fb52 100644 --- a/deps/npm/html/doc/cli/npm-prefix.html +++ b/deps/npm/html/doc/cli/npm-prefix.html @@ -38,5 +38,5 @@ to contain a package.json file unless -g is also specified.

           - + diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html index 2415adf636..cbbf757890 100644 --- a/deps/npm/html/doc/cli/npm-prune.html +++ b/deps/npm/html/doc/cli/npm-prune.html @@ -41,5 +41,5 @@ negate NODE_ENV being set to production.

           - + diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html index fc7d1f6c2d..1b913f936b 100644 --- a/deps/npm/html/doc/cli/npm-publish.html +++ b/deps/npm/html/doc/cli/npm-publish.html @@ -14,9 +14,11 @@
    npm publish <tarball> [--tag <tag>] [--access <public|restricted>]
     npm publish <folder> [--tag <tag>] [--access <public|restricted>]
     

    DESCRIPTION

    -

    Publishes a package to the registry so that it can be installed by name. See -npm-developers(7) for details on what's included in the published package, as -well as details on how the package is built.

    +

    Publishes a package to the registry so that it can be installed by name. All +files in the package directory are included if no local .gitignore or +.npmignore file is present. See npm-developers(7) for full details on +what's included in the published package, as well as details on how the package +is built.

    By default npm will publish to the public registry. This can be overridden by specifying a different default registry or using a npm-scope(7) in the name (see package.json(5)).

    @@ -31,7 +33,8 @@ with a package.json file inside.

  • [--tag <tag>] Registers the published package with the given tag, such that npm install <name>@<tag> will install this version. By default, npm publish updates -and npm install installs the latest tag.

    +and npm install installs the latest tag. See npm-dist-tag(1) for +details about tags.

  • [--access <public|restricted>] Tells the registry whether this package should be published as public or @@ -66,5 +69,5 @@ it is removed with npm-unpublish(1).

           - + diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html index 73066ffa22..e59fa0b5c8 100644 --- a/deps/npm/html/doc/cli/npm-rebuild.html +++ b/deps/npm/html/doc/cli/npm-rebuild.html @@ -38,5 +38,5 @@ the new binary.

           - + diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html index 3b997168cc..f5a16a71c1 100644 --- a/deps/npm/html/doc/cli/npm-repo.html +++ b/deps/npm/html/doc/cli/npm-repo.html @@ -42,5 +42,5 @@ a package.json in the current folder and use the name        - + diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html index 35c9e2aadf..d854a290bb 100644 --- a/deps/npm/html/doc/cli/npm-restart.html +++ b/deps/npm/html/doc/cli/npm-restart.html @@ -53,5 +53,5 @@ behavior will be accompanied by an increase in major version number

           - + diff --git a/deps/npm/html/doc/cli/npm-rm.html b/deps/npm/html/doc/cli/npm-rm.html index 689dceaa10..fc08c1771b 100644 --- a/deps/npm/html/doc/cli/npm-rm.html +++ b/deps/npm/html/doc/cli/npm-rm.html @@ -39,5 +39,5 @@ on its behalf.

           - + diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html index 1352a2c30d..aef668a7f8 100644 --- a/deps/npm/html/doc/cli/npm-root.html +++ b/deps/npm/html/doc/cli/npm-root.html @@ -35,5 +35,5 @@        - + diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html index acbddd79e2..f272d18c11 100644 --- a/deps/npm/html/doc/cli/npm-run-script.html +++ b/deps/npm/html/doc/cli/npm-run-script.html @@ -57,5 +57,5 @@ you should write:

           - + diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html index f00ebb1f96..02d8bf993d 100644 --- a/deps/npm/html/doc/cli/npm-search.html +++ b/deps/npm/html/doc/cli/npm-search.html @@ -49,5 +49,5 @@ fall on multiple lines.

           - + diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html index d5b938ea78..22783a1a3a 100644 --- a/deps/npm/html/doc/cli/npm-shrinkwrap.html +++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html @@ -164,5 +164,5 @@ contents rather than versions.

           - + diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html index 6482e7f520..6117bb5ce9 100644 --- a/deps/npm/html/doc/cli/npm-star.html +++ b/deps/npm/html/doc/cli/npm-star.html @@ -36,5 +36,5 @@ a vaguely positive way to show that you care.

           - + diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html index 70acbfb5dd..e3c7fb453d 100644 --- a/deps/npm/html/doc/cli/npm-stars.html +++ b/deps/npm/html/doc/cli/npm-stars.html @@ -37,5 +37,5 @@ you will most certainly enjoy this command.

           - + diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html index f3c3bc523d..0abf6026f0 100644 --- a/deps/npm/html/doc/cli/npm-start.html +++ b/deps/npm/html/doc/cli/npm-start.html @@ -39,5 +39,5 @@ more details.

           - + diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html index 04cddba97b..c548457826 100644 --- a/deps/npm/html/doc/cli/npm-stop.html +++ b/deps/npm/html/doc/cli/npm-stop.html @@ -34,5 +34,5 @@        - + diff --git a/deps/npm/html/doc/cli/npm-tag.html b/deps/npm/html/doc/cli/npm-tag.html index 48b7051ef4..79f75851dc 100644 --- a/deps/npm/html/doc/cli/npm-tag.html +++ b/deps/npm/html/doc/cli/npm-tag.html @@ -62,5 +62,5 @@ that do not begin with a number or the letter v.

           - + diff --git a/deps/npm/html/doc/cli/npm-team.html b/deps/npm/html/doc/cli/npm-team.html index e9c4342f8a..cde3b3beef 100644 --- a/deps/npm/html/doc/cli/npm-team.html +++ b/deps/npm/html/doc/cli/npm-team.html @@ -67,4 +67,4 @@ use the npm access command to grant or revoke the appropriate permi        - + diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html index d732d76908..19803e9907 100644 --- a/deps/npm/html/doc/cli/npm-test.html +++ b/deps/npm/html/doc/cli/npm-test.html @@ -37,5 +37,5 @@ true.

           - + diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html index 22a78bcb8d..dea1476ec9 100644 --- a/deps/npm/html/doc/cli/npm-uninstall.html +++ b/deps/npm/html/doc/cli/npm-uninstall.html @@ -57,5 +57,5 @@ npm uninstall dtrace-provider --save-optional        - + diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html index 4152dfbeb8..038ef313e4 100644 --- a/deps/npm/html/doc/cli/npm-unpublish.html +++ b/deps/npm/html/doc/cli/npm-unpublish.html @@ -47,5 +47,5 @@ package again, a new version number must be used.

           - + diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html index 8182d49620..16f572e6f7 100644 --- a/deps/npm/html/doc/cli/npm-update.html +++ b/deps/npm/html/doc/cli/npm-update.html @@ -24,7 +24,7 @@ packages.

    or local) will be updated.

    As of npm@2.6.1, the npm update will only inspect top-level packages. Prior versions of npm would also recursively inspect all dependencies. -To get the old behavior, use npm --depth 9999 update, but be warned that +To get the old behavior, use npm --depth Infinity update, but be warned that simultaneous asynchronous update of all packages, including npm itself and packages that npm depends on, often causes problems up to and including the uninstallation of npm itself.

    @@ -119,5 +119,5 @@ be downgraded.

           - + diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html index 1f1fcfcb9c..5e314e7e3d 100644 --- a/deps/npm/html/doc/cli/npm-version.html +++ b/deps/npm/html/doc/cli/npm-version.html @@ -95,5 +95,5 @@ and tag up to the server, and deletes the build/temp directory.

           - + diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html index 6298ee702c..6111cdb861 100644 --- a/deps/npm/html/doc/cli/npm-view.html +++ b/deps/npm/html/doc/cli/npm-view.html @@ -82,5 +82,5 @@ the field name.

           - + diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html index 9eb94323d8..f0d59db71a 100644 --- a/deps/npm/html/doc/cli/npm-whoami.html +++ b/deps/npm/html/doc/cli/npm-whoami.html @@ -33,5 +33,5 @@        - + diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html index bdff00e3b8..9fcca1222f 100644 --- a/deps/npm/html/doc/cli/npm.html +++ b/deps/npm/html/doc/cli/npm.html @@ -13,7 +13,7 @@

    SYNOPSIS

    npm <command> [args]
     

    VERSION

    -

    2.14.15

    +

    2.14.16

    DESCRIPTION

    npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency @@ -110,7 +110,7 @@ easily by doing npm view npm contributors.

    the issues list or ask on the mailing list.

    BUGS

    When you find issues, please report them:

    @@ -118,7 +118,7 @@ the issues list or ask on the mailing list.

  • web: https://github.com/npm/npm/issues
  • email: -npm-@googlegroups.com
  • +npm-@googlegroups.com
  • Be sure to include all of the output from the npm command that didn't work as expected. The npm-debug.log file is also helpful to provide.

    @@ -128,7 +128,7 @@ will no doubt tell you to put the output in a gist or email.

    Isaac Z. Schlueter :: isaacs :: @izs :: -i@izs.me

    +i@izs.me

    SEE ALSO

    • npm-help(1)
    • @@ -154,5 +154,5 @@ will no doubt tell you to put the output in a gist or email.

             - + diff --git a/deps/npm/html/doc/files/npm-folders.html b/deps/npm/html/doc/files/npm-folders.html index 2133bfc17a..9319a3f77b 100644 --- a/deps/npm/html/doc/files/npm-folders.html +++ b/deps/npm/html/doc/files/npm-folders.html @@ -25,11 +25,10 @@ is installed.

    prefix Configuration

    The prefix config defaults to the location where node is installed. -On most systems, this is /usr/local, and most of the time is the same -as node's process.installPrefix.

    -

    On windows, this is the exact location of the node.exe binary. On Unix -systems, it's one level up, since node is typically installed at -{prefix}/bin/node rather than {prefix}/node.exe.

    +On most systems, this is /usr/local. On windows, this is the exact +location of the node.exe binary. On Unix systems, it's one level up, +since node is typically installed at {prefix}/bin/node rather than +{prefix}/node.exe.

    When the global flag is set, npm installs things into this prefix. When it is not set, it uses the root of the current package, or the current working directory if not in a package already.

    @@ -184,5 +183,5 @@ cannot be found elsewhere. See packa        - + diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html index 2133bfc17a..9319a3f77b 100644 --- a/deps/npm/html/doc/files/npm-global.html +++ b/deps/npm/html/doc/files/npm-global.html @@ -25,11 +25,10 @@ is installed.

    prefix Configuration

    The prefix config defaults to the location where node is installed. -On most systems, this is /usr/local, and most of the time is the same -as node's process.installPrefix.

    -

    On windows, this is the exact location of the node.exe binary. On Unix -systems, it's one level up, since node is typically installed at -{prefix}/bin/node rather than {prefix}/node.exe.

    +On most systems, this is /usr/local. On windows, this is the exact +location of the node.exe binary. On Unix systems, it's one level up, +since node is typically installed at {prefix}/bin/node rather than +{prefix}/node.exe.

    When the global flag is set, npm installs things into this prefix. When it is not set, it uses the root of the current package, or the current working directory if not in a package already.

    @@ -184,5 +183,5 @@ cannot be found elsewhere. See
    packa        - + diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html index 83c4be7173..d6987af5bc 100644 --- a/deps/npm/html/doc/files/npm-json.html +++ b/deps/npm/html/doc/files/npm-json.html @@ -24,7 +24,7 @@ changes to the version.

    The name is what your thing is called.

    Some rules:

    For example, these are all valid:

    { "dependencies" :
    @@ -565,5 +565,5 @@ ignored.

           - + diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html index b400267be4..2bfc4db1aa 100644 --- a/deps/npm/html/doc/files/npmrc.html +++ b/deps/npm/html/doc/files/npmrc.html @@ -83,5 +83,5 @@ manner.

           - + diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html index 83c4be7173..d6987af5bc 100644 --- a/deps/npm/html/doc/files/package.json.html +++ b/deps/npm/html/doc/files/package.json.html @@ -24,7 +24,7 @@ changes to the version.

    The name is what your thing is called.

    Some rules:

      -
    • The name must be shorter than 214 characters. This includes the scope for +
    • The name must be less than or equal to 214 characters. This includes the scope for scoped packages.
    • The name can't start with a dot or an underscore.
    • New packages must not have uppercase letters in the name.
    • @@ -309,7 +309,7 @@ tarball or git URL.

    • git... See 'Git URLs as Dependencies' below
    • user/repo See 'GitHub URLs' below
    • tag A specific version tagged and published as tag See npm-tag(1)
    • -
    • path/path/path See Local Paths below
    • +
    • path/path/path See Local Paths below

    For example, these are all valid:

    { "dependencies" :
    @@ -565,5 +565,5 @@ ignored.

           - + diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html index 84b38628d4..3b9f85fed9 100644 --- a/deps/npm/html/doc/index.html +++ b/deps/npm/html/doc/index.html @@ -242,5 +242,5 @@        - + diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html index 7fd8a50eb9..7c830fb39c 100644 --- a/deps/npm/html/doc/misc/npm-coding-style.html +++ b/deps/npm/html/doc/misc/npm-coding-style.html @@ -147,5 +147,5 @@ set to anything."

           - + diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html index bb6d06fd0d..f164cd5e79 100644 --- a/deps/npm/html/doc/misc/npm-config.html +++ b/deps/npm/html/doc/misc/npm-config.html @@ -196,7 +196,7 @@ explicitly used, and that only GET requests use the cache.

    A client certificate to pass when accessing the registry.

    color

      -
    • Default: true on Posix, false on Windows
    • +
    • Default: true
    • Type: Boolean or "always"

    If false, never shows colors. If "always" then always shows colors. @@ -799,5 +799,5 @@ exit successfully.

           - + diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html index 1d939787d8..05897b052a 100644 --- a/deps/npm/html/doc/misc/npm-developers.html +++ b/deps/npm/html/doc/misc/npm-developers.html @@ -195,5 +195,5 @@ from a fresh checkout.

           - + diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html index 97b0e475b2..9c7fc3df0e 100644 --- a/deps/npm/html/doc/misc/npm-disputes.html +++ b/deps/npm/html/doc/misc/npm-disputes.html @@ -13,7 +13,7 @@

    SYNOPSIS

    1. Get the author email with npm owner ls <pkgname>
    2. -
    3. Email the author, CC support@npmjs.com
    4. +
    5. Email the author, CC support@npmjs.com
    6. After a few weeks, if there's no resolution, we'll sort it out.

    Don't squat on package names. Publish code or move out of the way.

    @@ -51,12 +51,12 @@ Joe's appropriate course of action in each case is the same.

    owner (Bob).
  • Joe emails Bob, explaining the situation as respectfully as possible, and what he would like to do with the module name. He -adds the npm support staff support@npmjs.com to the CC list of +adds the npm support staff support@npmjs.com to the CC list of the email. Mention in the email that Bob can run npm owner add joe foo to add Joe as an owner of the foo package.
  • After a reasonable amount of time, if Bob has not responded, or if Bob and Joe can't come to any sort of resolution, email support -support@npmjs.com and we'll sort it out. ("Reasonable" is +support@npmjs.com and we'll sort it out. ("Reasonable" is usually at least 4 weeks, but extra time is allowed around common holidays.)
  • @@ -112,5 +112,5 @@ things into it.        - + diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html index 1ca8232c06..e9c9b6316d 100644 --- a/deps/npm/html/doc/misc/npm-index.html +++ b/deps/npm/html/doc/misc/npm-index.html @@ -242,5 +242,5 @@        - + diff --git a/deps/npm/html/doc/misc/npm-orgs.html b/deps/npm/html/doc/misc/npm-orgs.html index d5417ce629..8089d1aae3 100644 --- a/deps/npm/html/doc/misc/npm-orgs.html +++ b/deps/npm/html/doc/misc/npm-orgs.html @@ -86,4 +86,4 @@        - + diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html index 79d1aeaf06..405abe5a59 100644 --- a/deps/npm/html/doc/misc/npm-registry.html +++ b/deps/npm/html/doc/misc/npm-registry.html @@ -70,5 +70,5 @@ effectively implement the entire CouchDB API anyway.

           - + diff --git a/deps/npm/html/doc/misc/npm-scope.html b/deps/npm/html/doc/misc/npm-scope.html index 2394c0035f..082079e0ac 100644 --- a/deps/npm/html/doc/misc/npm-scope.html +++ b/deps/npm/html/doc/misc/npm-scope.html @@ -91,5 +91,5 @@ that registry instead.

           - + diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html index 2bac128e28..c8d13a4a18 100644 --- a/deps/npm/html/doc/misc/npm-scripts.html +++ b/deps/npm/html/doc/misc/npm-scripts.html @@ -207,5 +207,5 @@ scripts is for compilation which must be done on the target architecture.        - + diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html index e6c4ced30b..61469f102c 100644 --- a/deps/npm/html/doc/misc/removing-npm.html +++ b/deps/npm/html/doc/misc/removing-npm.html @@ -57,5 +57,5 @@ modules. To track those down, you can do the following:

           - + diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html index 9fc9ae1fd3..782b6cbbdc 100644 --- a/deps/npm/html/doc/misc/semver.html +++ b/deps/npm/html/doc/misc/semver.html @@ -302,5 +302,5 @@ range, use the satisfies(version, range) function.

           - + diff --git a/deps/npm/lib/adduser.js b/deps/npm/lib/adduser.js index 367f3ba0d9..42c029efb1 100644 --- a/deps/npm/lib/adduser.js +++ b/deps/npm/lib/adduser.js @@ -169,7 +169,9 @@ function save (c, u, cb) { }) } - log.info("adduser", "Authorized user %s", u.u) - npm.config.save("user", cb) + log.info('adduser', 'Authorized user %s', u.u) + var scopeMessage = scope ? ' to scope ' + scope : '' + console.log('Logged in as %s%s on %s.', u.u, scopeMessage, uri) + npm.config.save('user', cb) }) } diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js index 2e11be32f8..851636c3c1 100644 --- a/deps/npm/lib/cache.js +++ b/deps/npm/lib/cache.js @@ -337,6 +337,7 @@ function afterAdd (cb) { return function (er, data) { // Save the resolved, shasum, etc. into the data so that the next // time we load from this cached data, we have all the same info. + // Ignore if it fails. var pj = path.join(cachedPackageRoot(data), "package", "package.json") var done = inflight(pj, cb) @@ -347,7 +348,7 @@ function afterAdd (cb) { return function (er, data) { if (er) return done(er) writeFileAtomic(pj, JSON.stringify(data), {chown : cs}, function (er) { if (!er) log.verbose("afterAdd", pj, "written") - return done(er, data) + return done(null, data) }) }) }} diff --git a/deps/npm/lib/cache/add-local-tarball.js b/deps/npm/lib/cache/add-local-tarball.js index e84b66dd8d..f078039e35 100644 --- a/deps/npm/lib/cache/add-local-tarball.js +++ b/deps/npm/lib/cache/add-local-tarball.js @@ -13,7 +13,7 @@ var mkdir = require("mkdirp") , chownr = require("chownr") , inflight = require("inflight") , once = require("once") - , writeStream = require("fs-write-stream-atomic") + , writeStreamAtomic = require("fs-write-stream-atomic") , randomBytes = require("crypto").pseudoRandomBytes // only need uniqueness module.exports = addLocalTarball @@ -166,7 +166,7 @@ function addTmpTarball_ (tgz, data, shasum, cb) { if (er) return cb(er) var read = fs.createReadStream(tgz) - var write = writeStream(target, { mode: npm.modes.file }) + var write = writeStreamAtomic(target, { mode: npm.modes.file }) var fin = cs.uid && cs.gid ? chown : done read.on("error", cb).pipe(write).on("error", cb).on("close", fin) }) diff --git a/deps/npm/lib/cache/add-remote-tarball.js b/deps/npm/lib/cache/add-remote-tarball.js index 66d2200966..d04e9da509 100644 --- a/deps/npm/lib/cache/add-remote-tarball.js +++ b/deps/npm/lib/cache/add-remote-tarball.js @@ -4,7 +4,8 @@ var mkdir = require("mkdirp") , path = require("path") , sha = require("sha") , retry = require("retry") - , createWriteStream = require("fs-write-stream-atomic") + , writeStreamAtomic = require("fs-write-stream-atomic") + , PassThrough = require('readable-stream').PassThrough , npm = require("../npm.js") , inflight = require("inflight") , addLocalTarball = require("./add-local-tarball.js") @@ -78,8 +79,8 @@ function fetchAndShaCheck (u, tmp, shasum, auth, cb) { return cb(er, response) } - var tarball = createWriteStream(tmp, { mode : npm.modes.file }) - tarball.on("error", function (er) { + var tarball = writeStreamAtomic(tmp, { mode: npm.modes.file }) + tarball.on('error', function (er) { cb(er) tarball.destroy() }) @@ -105,6 +106,15 @@ function fetchAndShaCheck (u, tmp, shasum, auth, cb) { }) }) - response.pipe(tarball) + // 0.8 http streams have a bug, where if they're paused with data in + // their buffers when the socket closes, they call `end` before emptying + // those buffers, which results in the entire pipeline ending and thus + // the point that applied backpressure never being able to trigger a + // `resume`. + // We work around this by piping into a pass through stream that has + // unlimited buffering. The pass through stream is from readable-stream + // and is thus a current streams3 implementation that is free of these + // bugs even on 0.8. + response.pipe(PassThrough({highWaterMark: Infinity})).pipe(tarball) }) } diff --git a/deps/npm/lib/pack.js b/deps/npm/lib/pack.js index a5ce90094f..ab81cc20f6 100644 --- a/deps/npm/lib/pack.js +++ b/deps/npm/lib/pack.js @@ -11,7 +11,7 @@ var npm = require("./npm.js") , chain = require("slide").chain , path = require("path") , cwd = process.cwd() - , writeStream = require('fs-write-stream-atomic') + , writeStreamAtomic = require('fs-write-stream-atomic') , cachedPackageRoot = require("./cache/cached-package-root.js") pack.usage = "npm pack " @@ -52,7 +52,7 @@ function pack_ (pkg, cb) { var cached = path.join(cachedPackageRoot(data), "package.tgz") , from = fs.createReadStream(cached) - , to = writeStream(fname) + , to = writeStreamAtomic(fname) , errState = null from.on("error", cb_) diff --git a/deps/npm/lib/utils/correct-mkdir.js b/deps/npm/lib/utils/correct-mkdir.js index 650c56fb17..c0a31bdc58 100644 --- a/deps/npm/lib/utils/correct-mkdir.js +++ b/deps/npm/lib/utils/correct-mkdir.js @@ -10,6 +10,13 @@ var stats = {} var effectiveOwner module.exports = function correctMkdir (path, cb) { cb = dezalgo(cb) + cb = inflight('correctMkdir:' + path, cb) + if (!cb) { + return log.verbose('correctMkdir', path, 'correctMkdir already in flight; waiting') + } else { + log.verbose('correctMkdir', path, 'correctMkdir not in flight; initializing') + } + if (stats[path]) return cb(null, stats[path]) fs.stat(path, function (er, st) { diff --git a/deps/npm/lib/utils/error-handler.js b/deps/npm/lib/utils/error-handler.js index dac6a17f25..e5daf2066e 100644 --- a/deps/npm/lib/utils/error-handler.js +++ b/deps/npm/lib/utils/error-handler.js @@ -11,7 +11,7 @@ var cbCalled = false , exitCode = 0 , rollbacks = npm.rollbacks , chain = require("slide").chain - , writeStream = require("fs-write-stream-atomic") + , writeStreamAtomic = require("fs-write-stream-atomic") , nameValidator = require("validate-npm-package-name") @@ -187,8 +187,10 @@ function errorHandler (er) { ,"not with npm itself." ,"Tell the author that this fails on your system:" ," "+er.script - ,"You can get their info via:" - ," npm owner ls "+er.pkgname + ,'You can get information on how to open an issue for this project with:' + ,' npm bugs ' + er.pkgname + ,'Or if that isn\'t available, you can get their info via:', + ,' npm owner ls ' + er.pkgname ,"There is likely additional logging output above." ].join("\n")) break @@ -391,7 +393,7 @@ function writeLogFile (cb) { writingLogFile = true wroteLogFile = true - var fstr = writeStream("npm-debug.log") + var fstr = writeStreamAtomic("npm-debug.log") , os = require("os") , out = "" diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1 index dae1e044a7..7cf7be7dd7 100644 --- a/deps/npm/man/man1/npm-README.1 +++ b/deps/npm/man/man1/npm-README.1 @@ -142,53 +142,6 @@ Uninstalling npm does not remove configuration files by default\. You must remove them yourself manually if you want them gone\. Note that this means that future npm installs will not remember the settings that you have chosen\. -.SH Using npm Programmatically -.P -Although npm can be used programmatically, its API is meant for use by the CLI -\fIonly\fR, and no guarantees are made regarding its fitness for any other purpose\. -If you want to use npm to reliably perform some task, the safest thing to do is -to invoke the desired \fBnpm\fP command with appropriate arguments\. -.P -The semantic version of npm refers to the CLI itself, rather than the -underlying API\. \fIThe internal API is not guaranteed to remain stable even when -npm's version indicates no breaking changes have been made according to -semver\.\fR -.P -If you \fIstill\fR would like to use npm programmatically, it's \fIpossible\fR\|\. The API -isn't very well documented, but it \fIis\fR rather simple\. -.P -Eventually, npm will be just a thin CLI wrapper around the modules that it -depends on, but for now, there are some things that only the CLI can do\. You -should try using one of npm's dependencies first, and only use the API if what -you're trying to do is only supported by npm itself\. -.P -.RS 2 -.nf -var npm = require("npm") -npm\.load(myConfigObject, function (er) { - if (er) return handlError(er) - npm\.commands\.install(["some", "args"], function (er, data) { - if (er) return commandFailed(er) - // command succeeded, and data might have some info - }) - npm\.registry\.log\.on("log", function (message) { \.\.\.\. }) -}) -.fi -.RE -.P -The \fBload\fP function takes an object hash of the command\-line configs\. -The various \fBnpm\.commands\.\fP functions take an \fBarray\fR of -positional argument \fBstrings\fR\|\. The last argument to any -\fBnpm\.commands\.\fP function is a callback\. Some commands take other -optional arguments\. Read the source\. -.P -You cannot set configs individually for any single npm function at this -time\. Since \fBnpm\fP is a singleton, any call to \fBnpm\.config\.set\fP will -change the value for \fIall\fR npm commands in that process\. -.P -See \fB\|\./bin/npm\-cli\.js\fP for an example of pulling config values off of the -command line arguments using nopt\. You may also want to check out \fBnpm -help config\fP to learn about all the options you can set there\. .SH More Docs .P Check out the docs \fIhttps://docs\.npmjs\.com/\fR, diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index a9c7786bc8..3c17975c4e 100644 --- a/deps/npm/man/man1/npm-dist-tag.1 +++ b/deps/npm/man/man1/npm-dist-tag.1 @@ -47,16 +47,29 @@ npm install \-\-tag .P This also applies to \fBnpm dedupe\fP\|\. .P -Publishing a package sets the "latest" tag to the published version unless the +Publishing a package sets the \fBlatest\fP tag to the published version unless the \fB\-\-tag\fP option is used\. For example, \fBnpm publish \-\-tag=beta\fP\|\. +.P +By default, \fBnpm install \fP (without any \fB@\fP or \fB@\fP +specifier) installs the \fBlatest\fP tag\. .SH PURPOSE .P -Tags can be used to provide an alias instead of version numbers\. For -example, \fBnpm\fP currently uses the tag "next" to identify the upcoming -version, and the tag "latest" to identify the current version\. +Tags can be used to provide an alias instead of version numbers\. +.P +For example, a project might choose to have multiple streams of development +and use a different tag for each stream, +e\.g\., \fBstable\fP, \fBbeta\fP, \fBdev\fP, \fBcanary\fP\|\. +.P +By default, the \fBlatest\fP tag is used by npm to identify the current version of +a package, and \fBnpm install \fP (without any \fB@\fP or \fB@\fP +specifier) installs the \fBlatest\fP tag\. Typically, projects only use the \fBlatest\fP +tag for stable release versions, and use other tags for unstable versions such +as prereleases\. +.P +The \fBnext\fP tag is used by some projects to identify the upcoming version\. .P -A project might choose to have multiple streams of development, e\.g\., -"stable", "canary"\. +By default, other than \fBlatest\fP, no tag has any special significance to npm +itself\. .SH CAVEATS .P This command used to be known as \fBnpm tag\fP, which only created new tags, and so diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index b93805f9ef..ff754dc2d2 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -33,7 +33,7 @@ c) a url that resolves to (b) .IP \(bu 2 d) a \fB@\fP that is published on the registry (see npm help 7 \fBnpm\-registry\fP) with (c) .IP \(bu 2 -e) a \fB@\fP that points to (d) +e) a \fB@\fP (see npm help \fBnpm\-dist\-tag\fP) that points to (d) .IP \(bu 2 f) a \fB\fP that has a "latest" tag satisfying (e) .IP \(bu 2 @@ -86,7 +86,7 @@ after packing it up into a tarball (b)\. .IP \(bu 2 \fBnpm install [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional]\fP: Do a \fB@\fP install, where \fB\fP is the "tag" config\. (See - npm help 7 \fBnpm\-config\fP\|\.) + npm help 7 \fBnpm\-config\fP\|\. The config's default value is \fBlatest\fP\|\.) In most cases, this will install the latest version of the module published on npm\. Example: diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index d865fee892..9d539a0eaa 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -23,7 +23,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf -npm@2.14.15 /path/to/npm +npm@2.14.16 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index a41165a809..9da086a4a4 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -11,9 +11,11 @@ npm publish [\-\-tag ] [\-\-access ] .RE .SH DESCRIPTION .P -Publishes a package to the registry so that it can be installed by name\. See -npm help 7 \fBnpm\-developers\fP for details on what's included in the published package, as -well as details on how the package is built\. +Publishes a package to the registry so that it can be installed by name\. All +files in the package directory are included if no local \fB\|\.gitignore\fP or +\fB\|\.npmignore\fP file is present\. See npm help 7 \fBnpm\-developers\fP for full details on +what's included in the published package, as well as details on how the package +is built\. .P By default npm will publish to the public registry\. This can be overridden by specifying a different default registry or using a npm help 7 \fBnpm\-scope\fP in the name @@ -30,7 +32,8 @@ with a package\.json file inside\. \fB[\-\-tag ]\fP Registers the published package with the given tag, such that \fBnpm install @\fP will install this version\. By default, \fBnpm publish\fP updates -and \fBnpm install\fP installs the \fBlatest\fP tag\. +and \fBnpm install\fP installs the \fBlatest\fP tag\. See npm help \fBnpm\-dist\-tag\fP for +details about tags\. .IP \(bu 2 \fB[\-\-access ]\fP Tells the registry whether this package should be published as public or diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index 84681d6d1c..e503368bc6 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -25,7 +25,7 @@ or local) will be updated\. .P As of \fBnpm@2\.6\.1\fP, the \fBnpm update\fP will only inspect top\-level packages\. Prior versions of \fBnpm\fP would also recursively inspect all dependencies\. -To get the old behavior, use \fBnpm \-\-depth 9999 update\fP, but be warned that +To get the old behavior, use \fBnpm \-\-depth Infinity update\fP, but be warned that simultaneous asynchronous update of all packages, including \fBnpm\fP itself and packages that \fBnpm\fP depends on, often causes problems up to and including the uninstallation of \fBnpm\fP itself\. diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index 994fedd2fb..69c3fc4f34 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -10,7 +10,7 @@ npm [args] .RE .SH VERSION .P -2.14.15 +2.14.16 .SH DESCRIPTION .P npm is the package manager for the Node JavaScript platform\. It puts diff --git a/deps/npm/man/man3/npm.3 b/deps/npm/man/man3/npm.3 index bfa750d91c..af3395c39f 100644 --- a/deps/npm/man/man3/npm.3 +++ b/deps/npm/man/man3/npm.3 @@ -20,7 +20,7 @@ npm\.load([configObject, ]function (er, npm) { .RE .SH VERSION .P -2.14.15 +2.14.16 .SH DESCRIPTION .P This is the API documentation for npm\. diff --git a/deps/npm/man/man5/npm-folders.5 b/deps/npm/man/man5/npm-folders.5 index f337b9b6d3..a95cd885ff 100644 --- a/deps/npm/man/man5/npm-folders.5 +++ b/deps/npm/man/man5/npm-folders.5 @@ -25,12 +25,10 @@ If you need both, then install it in both places, or use \fBnpm link\fP\|\. .SS prefix Configuration .P The \fBprefix\fP config defaults to the location where node is installed\. -On most systems, this is \fB/usr/local\fP, and most of the time is the same -as node's \fBprocess\.installPrefix\fP\|\. -.P -On windows, this is the exact location of the node\.exe binary\. On Unix -systems, it's one level up, since node is typically installed at -\fB{prefix}/bin/node\fP rather than \fB{prefix}/node\.exe\fP\|\. +On most systems, this is \fB/usr/local\fP\|\. On windows, this is the exact +location of the node\.exe binary\. On Unix systems, it's one level up, +since node is typically installed at \fB{prefix}/bin/node\fP rather than +\fB{prefix}/node\.exe\fP\|\. .P When the \fBglobal\fP flag is set, npm installs things into this prefix\. When it is not set, it uses the root of the current package, or the diff --git a/deps/npm/man/man5/npm-global.5 b/deps/npm/man/man5/npm-global.5 index f337b9b6d3..a95cd885ff 100644 --- a/deps/npm/man/man5/npm-global.5 +++ b/deps/npm/man/man5/npm-global.5 @@ -25,12 +25,10 @@ If you need both, then install it in both places, or use \fBnpm link\fP\|\. .SS prefix Configuration .P The \fBprefix\fP config defaults to the location where node is installed\. -On most systems, this is \fB/usr/local\fP, and most of the time is the same -as node's \fBprocess\.installPrefix\fP\|\. -.P -On windows, this is the exact location of the node\.exe binary\. On Unix -systems, it's one level up, since node is typically installed at -\fB{prefix}/bin/node\fP rather than \fB{prefix}/node\.exe\fP\|\. +On most systems, this is \fB/usr/local\fP\|\. On windows, this is the exact +location of the node\.exe binary\. On Unix systems, it's one level up, +since node is typically installed at \fB{prefix}/bin/node\fP rather than +\fB{prefix}/node\.exe\fP\|\. .P When the \fBglobal\fP flag is set, npm installs things into this prefix\. When it is not set, it uses the root of the current package, or the diff --git a/deps/npm/man/man5/npm-json.5 b/deps/npm/man/man5/npm-json.5 index a08ee531bc..ba383dd95a 100644 --- a/deps/npm/man/man5/npm-json.5 +++ b/deps/npm/man/man5/npm-json.5 @@ -21,7 +21,7 @@ The name is what your thing is called\. Some rules: .RS 0 .IP \(bu 2 -The name must be shorter than 214 characters\. This includes the scope for +The name must be less than or equal to 214 characters\. This includes the scope for scoped packages\. .IP \(bu 2 The name can't start with a dot or an underscore\. @@ -506,7 +506,7 @@ See npm help 7 semver for more details about specifying version ranges\. .IP \(bu 2 \fBtag\fP A specific version tagged and published as \fBtag\fP See npm help \fBnpm\-tag\fP .IP \(bu 2 -\fBpath/path/path\fP See Local Paths below +\fBpath/path/path\fP See Local Paths \fI#local\-paths\fR below .RE .P diff --git a/deps/npm/man/man5/package.json.5 b/deps/npm/man/man5/package.json.5 index a08ee531bc..ba383dd95a 100644 --- a/deps/npm/man/man5/package.json.5 +++ b/deps/npm/man/man5/package.json.5 @@ -21,7 +21,7 @@ The name is what your thing is called\. Some rules: .RS 0 .IP \(bu 2 -The name must be shorter than 214 characters\. This includes the scope for +The name must be less than or equal to 214 characters\. This includes the scope for scoped packages\. .IP \(bu 2 The name can't start with a dot or an underscore\. @@ -506,7 +506,7 @@ See npm help 7 semver for more details about specifying version ranges\. .IP \(bu 2 \fBtag\fP A specific version tagged and published as \fBtag\fP See npm help \fBnpm\-tag\fP .IP \(bu 2 -\fBpath/path/path\fP See Local Paths below +\fBpath/path/path\fP See Local Paths \fI#local\-paths\fR below .RE .P diff --git a/deps/npm/man/man7/npm-config.7 b/deps/npm/man/man7/npm-config.7 index fb33aeb69b..b932989969 100644 --- a/deps/npm/man/man7/npm-config.7 +++ b/deps/npm/man/man7/npm-config.7 @@ -323,7 +323,7 @@ A client certificate to pass when accessing the registry\. .SS color .RS 0 .IP \(bu 2 -Default: true on Posix, false on Windows +Default: true .IP \(bu 2 Type: Boolean or \fB"always"\fP diff --git a/deps/npm/package.json b/deps/npm/package.json index d6831c8490..23bb9f2589 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "2.14.15", + "version": "2.14.16", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ @@ -173,10 +173,9 @@ ], "devDependencies": { "deep-equal": "~1.0.1", - "marked": "~0.3.3", + "marked": "~0.3.5", "marked-man": "~0.1.5", - "nock": "~1.9.0", - "npm-registry-couchapp": "~2.6.7", + "npm-registry-couchapp": "~2.6.12", "npm-registry-mock": "~1.0.0", "require-inject": "~1.3.0", "sprintf-js": "~1.0.2", diff --git a/deps/npm/test/common-tap.js b/deps/npm/test/common-tap.js index de0a9f416d..3537df6876 100644 --- a/deps/npm/test/common-tap.js +++ b/deps/npm/test/common-tap.js @@ -18,8 +18,6 @@ process.env.npm_config_cache = exports.npm_config_cache = npm_config_cache process.env.npm_config_userconfig = exports.npm_config_userconfig = path.join(__dirname, 'fixtures', 'config', 'userconfig') process.env.npm_config_globalconfig = exports.npm_config_globalconfig = path.join(__dirname, 'fixtures', 'config', 'globalconfig') process.env.random_env_var = 'foo' -// suppress warnings about using a prerelease version of node -process.env.npm_config_node_version = process.version.replace(/-.*$/, '') var bin = exports.bin = require.resolve('../bin/npm-cli.js') var chain = require('slide').chain diff --git a/deps/npm/test/tap/404-private-registry-scoped.js b/deps/npm/test/tap/404-private-registry-scoped.js index 681fff05e8..84251b113c 100644 --- a/deps/npm/test/tap/404-private-registry-scoped.js +++ b/deps/npm/test/tap/404-private-registry-scoped.js @@ -1,22 +1,38 @@ -var nock = require('nock') var test = require('tap').test -var npm = require('../../') -var addNamed = require('../../lib/cache/add-named') +var common = require('../common-tap.js') +var mr = require('npm-registry-mock') +var server -test('scoped package names not mangled on error with non-root registry', function test404 (t) { - nock('http://localhost:1337') - .get('/registry/@scope%2ffoo') - .reply(404, { - error: 'not_found', - reason: 'document not found' - }) +test('setup', function (t) { + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.end() + }) +}) - npm.load({registry: 'http://localhost:1337/registry', global: true}, function () { - addNamed('@scope/foo', '*', null, function checkError (err) { - t.ok(err, 'should error') - t.equal(err.message, '404 Not Found: @scope/foo', 'should have package name in error') - t.equal(err.pkgid, '@scope/foo', 'err.pkgid should match package name') +test('scoped package names not mangled on error with non-root registry', function (t) { + common.npm( + [ + 'cache', + 'add', + '@scope/foo@*', + '--force' + ], + {}, + function (er, code, stdout, stderr) { + t.ifError(er, 'correctly handled 404') + t.equal(code, 1, 'exited with error') + t.match(stderr, /404 Not found/, 'should notify the sort of error as a 404') + t.match(stderr, /@scope\/foo/, 'should have package name in error') t.end() - }) - }) + } + ) +}) + +test('cleanup', function (t) { + t.pass('cleaned up') + server.done() + server.close() + t.end() }) diff --git a/deps/npm/test/tap/404-private-registry.js b/deps/npm/test/tap/404-private-registry.js index 698f5b8613..bc716b1702 100644 --- a/deps/npm/test/tap/404-private-registry.js +++ b/deps/npm/test/tap/404-private-registry.js @@ -1,25 +1,39 @@ -var nock = require('nock') var test = require('tap').test var path = require('path') -var npm = require('../../') -var addNamed = require('../../lib/cache/add-named') +var common = require('../common-tap.js') +var mr = require('npm-registry-mock') +var server var packageName = path.basename(__filename,'.js') -test('package names not mangled on error with non-root registry', function test404 (t) { - nock('http://localhost:1337') - .get('/registry/' + packageName) - .reply(404, { - error: 'not_found', - reason: 'document not found' - }) +test('setup', function (t) { + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.end() + }) +}) - npm.load({registry: 'http://localhost:1337/registry', global: true}, function () { - addNamed(packageName, '*', null, function checkError (err) { - t.ok(err, 'should error') - t.equal(err.message, '404 Not Found: ' + packageName, 'should have package name in error') - t.equal(err.pkgid, packageName, 'err.pkgid should match package name') +test('package names not mangled on error with non-root registry', function (t) { + common.npm( + [ + 'cache', + 'add', + packageName + '@*' + ], + {}, + function (er, code, stdout, stderr) { + t.ifError(er, 'correctly handled 404') + t.equal(code, 1, 'exited with error') + t.match(stderr, packageName, 'should have package name in error') t.end() - }) - }) + } + ) +}) + +test('cleanup', function (t) { + t.pass('cleaned up') + server.done() + server.close() + t.end() }) diff --git a/deps/npm/test/tap/add-named-update-protocol-port.js b/deps/npm/test/tap/add-named-update-protocol-port.js index 52832db0c2..38b500d0c0 100644 --- a/deps/npm/test/tap/add-named-update-protocol-port.js +++ b/deps/npm/test/tap/add-named-update-protocol-port.js @@ -1,9 +1,10 @@ 'use strict' var path = require('path') -var nock = require('nock') var test = require('tap').test -var npm = require('../../') -var addNamed = require('../../lib/cache/add-named') +var common = require('../common-tap') +var mr = require('npm-registry-mock') +var server1 +var server2 var packageName = path.basename(__filename, '.js') @@ -36,46 +37,77 @@ var fooiPkg = { } } -test('tarball paths should update port if updating protocol', function (t) { - nock('http://localhost:1337/registry') - .get('/' + packageName) - .reply(200, fooPkg) - - nock('http://localhost:1337/registry') - .get('/' + packageName + '/-/' + packageName + '-0.0.0.tgz') - .reply(200, '1') - - nock('http://localhost:1338/registry') - .get('/' + packageName + '/-/' + packageName + '-0.0.0.tgz') - .reply(404) - - npm.load({registry: 'http://localhost:1337/registry', global: true}, function () { - addNamed(packageName, '0.0.0', null, function checkPath (err, pkg) { - t.ifError(err, 'addNamed worked') +test('setup', function (t) { + mr({ + port: 1337, + throwOnUnmatched: true + }, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server1 = s + mr({ + port: 1338, + throwOnUnmatched: true + }, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server2 = s t.end() }) }) }) -test('tarball paths should NOT update if different hostname', function (t) { - nock('http://localhost:1337/registry') - .get('/' + iPackageName) - .reply(200, fooiPkg) +test('tarball paths should update port if updating protocol', function (t) { + server1.get('/registry/' + packageName).reply(200, fooPkg) + server1.get( + '/registry/' + packageName + '/-/' + packageName + '-0.0.0.tgz' + ).reply(200, '1') - nock('http://127.0.0.1:1338/registry') - .get('/' + iPackageName + '/-/' + iPackageName + '-0.0.0.tgz') - .reply(200, '1') + common.npm( + [ + 'cache', + 'add', + packageName + '@0.0.0', + '--registry', + 'http://localhost:1337/registry' + ], + {}, + function (er, code, stdout, stderr) { + if (er) { throw er } + t.equal(code, 0, 'addNamed worked') + server1.done() + t.end() + } + ) +}) - nock('http://127.0.0.1:1337/registry') - .get('/' + iPackageName + '/-/' + iPackageName + '-0.0.0.tgz') - .reply(404) +test('tarball paths should NOT update if different hostname', function (t) { + server1.get('/registry/' + iPackageName).reply(200, fooiPkg) + server2.get( + '/registry/' + iPackageName + '/-/' + iPackageName + '-0.0.0.tgz' + ).reply(200, '1') - npm.load({registry: 'http://localhost:1337/registry', global: true}, function () { - addNamed(iPackageName, '0.0.0', null, function checkPath (err, pkg) { - t.ifError(err, 'addNamed worked') + common.npm( + [ + 'cache', + 'add', + iPackageName + '@0.0.0', + '--registry', + 'http://localhost:1337/registry' + ], + {}, + function (er, code, stdout, stderr) { + if (er) { throw er } + t.equal(code, 0, 'addNamed worked') + server1.done() + server2.done() t.end() - }) - }) + } + ) +}) +test('cleanup', function (t) { + t.pass('cleaned up') + server1.close() + server2.close() + t.end() }) diff --git a/deps/npm/test/tap/add-remote-git-fake-windows.js b/deps/npm/test/tap/add-remote-git-fake-windows.js index c9c9dd446b..66d70800f5 100644 --- a/deps/npm/test/tap/add-remote-git-fake-windows.js +++ b/deps/npm/test/tap/add-remote-git-fake-windows.js @@ -20,7 +20,7 @@ var pjParent = JSON.stringify({ name: 'parent', version: '1.2.3', dependencies: { - child: 'git://localhost:1233/child.git' + child: 'git://localhost:1234/child.git' } }, null, 2) + '\n' @@ -93,7 +93,8 @@ function setup (cb) { '--listen=localhost', '--export-all', '--base-path=.', - '--port=1233' + '--reuseaddr', + '--port=1234' ], { cwd: pkg, diff --git a/deps/npm/test/tap/add-remote-git-shrinkwrap.js b/deps/npm/test/tap/add-remote-git-shrinkwrap.js index f2982355e1..e1882d8ee7 100644 --- a/deps/npm/test/tap/add-remote-git-shrinkwrap.js +++ b/deps/npm/test/tap/add-remote-git-shrinkwrap.js @@ -20,7 +20,7 @@ var pjParent = JSON.stringify({ name: 'parent', version: '1.2.3', dependencies: { - 'child': 'git://localhost:1235/child.git#master' + 'child': 'git://localhost:1234/child.git#master' } }, null, 2) + '\n' @@ -68,7 +68,7 @@ test('shrinkwrap gets correct _from and _resolved (#7121)', function (t) { var shrinkwrap = require(resolve(pkg, 'npm-shrinkwrap.json')) t.equal( shrinkwrap.dependencies.child.from, - 'git://localhost:1235/child.git#master', + 'git://localhost:1234/child.git#master', 'npm shrinkwrapped from correctly' ) @@ -82,7 +82,7 @@ test('shrinkwrap gets correct _from and _resolved (#7121)', function (t) { t.equal( shrinkwrap.dependencies.child.resolved, - 'git://localhost:1235/child.git#' + treeish, + 'git://localhost:1234/child.git#' + treeish, 'npm shrinkwrapped resolved correctly' ) @@ -121,7 +121,8 @@ function setup (cb) { '--listen=localhost', '--export-all', '--base-path=.', - '--port=1235' + '--reuseaddr', + '--port=1234' ], { cwd: pkg, diff --git a/deps/npm/test/tap/add-remote-git.js b/deps/npm/test/tap/add-remote-git.js index e33d09c1a1..24abf33a77 100644 --- a/deps/npm/test/tap/add-remote-git.js +++ b/deps/npm/test/tap/add-remote-git.js @@ -80,6 +80,7 @@ function setup (cb) { '--listen=localhost', '--export-all', '--base-path=.', + '--reuseaddr', '--port=1234' ], { diff --git a/deps/npm/test/tap/adduser-always-auth.js b/deps/npm/test/tap/adduser-always-auth.js index 6a451b451c..db0e8b4761 100644 --- a/deps/npm/test/tap/adduser-always-auth.js +++ b/deps/npm/test/tap/adduser-always-auth.js @@ -14,7 +14,24 @@ var responses = { "Email" : "u@p.me\n" } -function mocks(server) { +function verifyStdout (runner, successMessage, t) { + var remaining = Object.keys(responses).length + return function (chunk) { + if (remaining > 0) { + remaining-- + + var label = chunk.toString('utf8').split(':')[0] + runner.stdin.write(responses[label]) + + if (remaining === 0) runner.stdin.end() + } else { + var message = chunk.toString('utf8').trim() + t.equal(message, successMessage) + } + } +} + +function mocks (server) { server.filteringRequestBody(function (r) { if (r.match(/\"_id\":\"org\.couchdb\.user:u\"/)) { return "auth" @@ -46,17 +63,140 @@ test("npm login", function (t) { }) }) - var o = "", e = "", remaining = Object.keys(responses).length - runner.stdout.on("data", function (chunk) { - remaining-- - o += chunk + var message = 'Logged in as u on ' + common.registry + '/.' + runner.stdout.on('data', verifyStdout(runner, message, t)) + }) +}) - var label = chunk.toString("utf8").split(":")[0] - runner.stdin.write(responses[label]) +test('npm login --scope uses :registry as its URI', function (t) { + var port = common.port + 1 + var uri = 'http://localhost:' + port + '/' + var scope = '@myco' + common.npm( + [ + 'config', + '--userconfig', outfile, + 'set', + scope + ':registry', + uri + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') - if (remaining === 0) runner.stdin.end() + mr({ port: port, plugin: mocks }, function (er, s) { + var runner = common.npm( + [ + 'login', + '--loglevel', 'silent', + '--userconfig', outfile, + '--scope', scope + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + var config = fs.readFileSync(outfile, 'utf8') + t.like(config, new RegExp(scope + ':registry=' + uri), 'scope:registry is set') + s.close() + rimraf(outfile, function (err) { + t.ifError(err, 'removed config file OK') + t.end() + }) + }) + + var message = 'Logged in as u to scope ' + scope + ' on ' + uri + '.' + runner.stdout.on('data', verifyStdout(runner, message, t)) + }) + }) +}) + +test('npm login --scope makes sure is prefixed by an @', function (t) { + var port = common.port + 1 + var uri = 'http://localhost:' + port + '/' + var scope = 'myco' + var prefixedScope = '@' + scope + common.npm( + [ + '--userconfig', outfile, + 'config', + 'set', + prefixedScope + ':registry', + uri + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + + mr({ port: port, plugin: mocks }, function (er, s) { + var runner = common.npm( + [ + 'login', + '--loglevel', 'silent', + '--userconfig', outfile, + '--scope', scope + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + var config = fs.readFileSync(outfile, 'utf8') + t.like(config, new RegExp(prefixedScope + ':registry=' + uri), 'scope:registry is set') + s.close() + rimraf(outfile, function (err) { + t.ifError(err, 'removed config file OK') + t.end() + }) + }) + + var message = 'Logged in as u to scope ' + prefixedScope + ' on ' + uri + '.' + runner.stdout.on('data', verifyStdout(runner, message, t)) + }) + }) +}) + +test('npm login --scope --registry uses as its URI', function (t) { + var scope = '@myco' + common.npm( + [ + '--userconfig', outfile, + 'config', + 'set', + scope + ':registry', + 'invalidurl' + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + + mr({ port: common.port, plugin: mocks }, function (er, s) { + var runner = common.npm( + [ + 'login', + '--registry', common.registry, + '--loglevel', 'silent', + '--userconfig', outfile, + '--scope', scope + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + var config = fs.readFileSync(outfile, 'utf8') + t.like(config, new RegExp(scope + ':registry=' + common.registry), 'scope:registry is set') + s.close() + rimraf(outfile, function (err) { + t.ifError(err, 'removed config file OK') + t.end() + }) + }) + + var message = 'Logged in as u to scope ' + scope + ' on ' + common.registry + '/.' + runner.stdout.on('data', verifyStdout(runner, message, t)) }) - runner.stderr.on("data", function (chunk) { e += chunk }) }) }) @@ -83,17 +223,8 @@ test("npm login --always-auth", function (t) { }) }) - var o = "", e = "", remaining = Object.keys(responses).length - runner.stdout.on("data", function (chunk) { - remaining-- - o += chunk - - var label = chunk.toString("utf8").split(":")[0] - runner.stdin.write(responses[label]) - - if (remaining === 0) runner.stdin.end() - }) - runner.stderr.on("data", function (chunk) { e += chunk }) + var message = 'Logged in as u on ' + common.registry + '/.' + runner.stdout.on('data', verifyStdout(runner, message, t)) }) }) @@ -120,17 +251,8 @@ test("npm login --no-always-auth", function (t) { }) }) - var o = "", e = "", remaining = Object.keys(responses).length - runner.stdout.on("data", function (chunk) { - remaining-- - o += chunk - - var label = chunk.toString("utf8").split(":")[0] - runner.stdin.write(responses[label]) - - if (remaining === 0) runner.stdin.end() - }) - runner.stderr.on("data", function (chunk) { e += chunk }) + var message = 'Logged in as u on ' + common.registry + '/.' + runner.stdout.on('data', verifyStdout(runner, message, t)) }) }) diff --git a/deps/npm/test/tap/adduser-legacy-auth.js b/deps/npm/test/tap/adduser-legacy-auth.js index f9829c618a..890a3fd274 100644 --- a/deps/npm/test/tap/adduser-legacy-auth.js +++ b/deps/npm/test/tap/adduser-legacy-auth.js @@ -73,17 +73,20 @@ test('npm login', function (t) { }) }) - var o = '', e = '', remaining = Object.keys(responses).length + var remaining = Object.keys(responses).length runner.stdout.on('data', function (chunk) { - remaining-- - o += chunk + if (remaining > 0) { + remaining-- - var label = chunk.toString('utf8').split(':')[0] - runner.stdin.write(responses[label]) + var label = chunk.toString('utf8').split(':')[0] + runner.stdin.write(responses[label]) - if (remaining === 0) runner.stdin.end() + if (remaining === 0) runner.stdin.end() + } else { + var message = chunk.toString('utf8').trim() + t.equal(message, 'Logged in as u on ' + common.registry + '/.') + } }) - runner.stderr.on('data', function (chunk) { e += chunk }) }) }) diff --git a/deps/npm/test/tap/correct-mkdir.js b/deps/npm/test/tap/correct-mkdir.js new file mode 100644 index 0000000000..4bfc6b1c97 --- /dev/null +++ b/deps/npm/test/tap/correct-mkdir.js @@ -0,0 +1,58 @@ +var test = require('tap').test +var assert = require('assert') +var path = require('path') +var requireInject = require('require-inject') +var cache_dir = path.resolve(__dirname, 'correct-mkdir') + +test('correct-mkdir: no race conditions', function (t) { + var mock_fs = {} + var did_hook = false + mock_fs.stat = function (path, cb) { + if (path === cache_dir) { + // Return a non-matching owner + cb(null, { + uid: +process.uid + 1, + isDirectory: function () { + return true + } + }) + if (!did_hook) { + did_hook = true + doHook() + } + } else { + assert.ok(false, 'Unhandled stat path: ' + path) + } + } + var chown_in_progress = 0 + var mock_chownr = function (path, uid, gid, cb) { + ++chown_in_progress + process.nextTick(function () { + --chown_in_progress + cb(null) + }) + } + var mocks = { + 'graceful-fs': mock_fs, + 'chownr': mock_chownr + } + var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) + + var calls_in_progress = 3 + function handleCallFinish () { + t.equal(chown_in_progress, 0, 'should not return while chown still in progress') + if (!--calls_in_progress) { + t.end() + } + } + function doHook () { + // This is fired during the first correctMkdir call, after the stat has finished + // but before the chownr has finished + // Buggy old code will fail and return a cached value before initial call is done + correctMkdir(cache_dir, handleCallFinish) + } + // Initial call + correctMkdir(cache_dir, handleCallFinish) + // Immediate call again in case of race condition there + correctMkdir(cache_dir, handleCallFinish) +}) diff --git a/deps/npm/test/tap/git-dependency-install-link.js b/deps/npm/test/tap/git-dependency-install-link.js index cbb256d983..4fb141578f 100644 --- a/deps/npm/test/tap/git-dependency-install-link.js +++ b/deps/npm/test/tap/git-dependency-install-link.js @@ -135,6 +135,7 @@ function setup (cb) { '--listen=localhost', '--export-all', '--base-path=.', + '--reuseaddr', '--port=1234' ], { diff --git a/deps/npm/test/tap/install-link-scripts.js b/deps/npm/test/tap/install-link-scripts.js index bd8b9a3e37..5ad2feafe8 100644 --- a/deps/npm/test/tap/install-link-scripts.js +++ b/deps/npm/test/tap/install-link-scripts.js @@ -122,7 +122,8 @@ function setup () { path.join(dep, 'package.json'), JSON.stringify(dependency, null, 2) ) - fs.writeFileSync(path.join(dep, 'bin', 'foo'), foo, { mode: '0755' }) + fs.writeFileSync(path.join(dep, 'bin', 'foo'), foo) + fs.chmod(path.join(dep, 'bin', 'foo'), '0755') } function cleanup () { diff --git a/deps/npm/test/tap/noargs-install-config-save.js b/deps/npm/test/tap/noargs-install-config-save.js index b6900b4317..28aa8f2fcf 100644 --- a/deps/npm/test/tap/noargs-install-config-save.js +++ b/deps/npm/test/tap/noargs-install-config-save.js @@ -1,18 +1,14 @@ -var common = require("../common-tap.js") -var test = require("tap").test -var npm = require.resolve("../../bin/npm-cli.js") -var path = require("path") -var fs = require("fs") -var rimraf = require("rimraf") -var mkdirp = require("mkdirp") +var common = require('../common-tap.js') +var test = require('tap').test +var path = require('path') +var fs = require('fs') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') var mr = require("npm-registry-mock") -var spawn = require("child_process").spawn -var node = process.execPath - -var pkg = path.resolve(process.env.npm_config_tmp || "/tmp", - "noargs-install-config-save") +var pkg = path.resolve(process.env.npm_config_tmp || '/tmp', + 'noargs-install-config-save') function writePackageJson() { rimraf.sync(pkg) @@ -29,33 +25,32 @@ function writePackageJson() { }), "utf8") } -function createChild (args) { - var env = { - "npm_config_save": true, - "npm_config_registry": common.registry, - "npm_config_cache": pkg + "/cache", - HOME: process.env.HOME, - Path: process.env.PATH, - PATH: process.env.PATH - } - - if (process.platform === "win32") - env.npm_config_cache = "%APPDATA%\\npm-cache" - - return spawn(node, args, { - cwd: pkg, - env: env - }) +var env = { + 'npm_config_save': true, + 'npm_config_registry': common.registry, + 'npm_config_cache': pkg + '/cache', + HOME: process.env.HOME, + Path: process.env.PATH, + PATH: process.env.PATH +} +var OPTS = { + cwd: pkg, + env: env } test("does not update the package.json with empty arguments", function (t) { writePackageJson() - t.plan(1) + t.plan(2) - mr({port : common.port}, function (er, s) { - var child = createChild([npm, "install"]) - child.on("close", function () { - var text = JSON.stringify(fs.readFileSync(pkg + "/package.json", "utf8")) + mr({ port: common.port }, function (er, s) { + common.npm('install', OPTS, function (er, code, stdout, stderr) { + if (er) throw er + t.is(code, 0) + if (code !== 0) { + console.error('#', stdout) + console.error('#', stderr) + } + var text = JSON.stringify(fs.readFileSync(pkg + '/package.json', 'utf8')) s.close() t.ok(text.indexOf("\"dependencies") === -1) }) @@ -64,11 +59,12 @@ test("does not update the package.json with empty arguments", function (t) { test("updates the package.json (adds dependencies) with an argument", function (t) { writePackageJson() - t.plan(1) + t.plan(2) - mr({port : common.port}, function (er, s) { - var child = createChild([npm, "install", "underscore"]) - child.on("close", function () { + mr({ port: common.port }, function (er, s) { + common.npm(['install', 'underscore'], OPTS, function (er, code, stdout, stderr) { + if (er) throw er + t.is(code, 0) s.close() var text = JSON.stringify(fs.readFileSync(pkg + "/package.json", "utf8")) t.ok(text.indexOf("\"dependencies") !== -1) diff --git a/deps/npm/test/tap/publish-access-scoped.js b/deps/npm/test/tap/publish-access-scoped.js index e734ebfd78..5d2b4e30e2 100644 --- a/deps/npm/test/tap/publish-access-scoped.js +++ b/deps/npm/test/tap/publish-access-scoped.js @@ -1,81 +1,70 @@ var fs = require("fs") var path = require("path") -var test = require("tap").test -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") -var nock = require("nock") - -var npm = require("../../") -var common = require("../common-tap.js") +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var mr = require('npm-registry-mock') +var common = require('../common-tap') +var server var pkg = path.join(__dirname, "publish-access") -// TODO: nock uses setImmediate, breaks 0.8: replace with mockRegistry -if (!global.setImmediate) { - global.setImmediate = function () { - var args = [arguments[0], 0].concat([].slice.call(arguments, 1)) - setTimeout.apply(this, args) - } -} - -test("setup", function (t) { - mkdirp(path.join(pkg, "cache"), function () { - var configuration = { - cache : path.join(pkg, "cache"), - loglevel : "silent", - registry : common.registry - } - - npm.load(configuration, next) +test('setup', function (t) { + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + t.pass('setup done') + server = s + t.end() }) +}) - function next (er) { - t.ifError(er, "npm loaded successfully") +test('scoped packages pass public access if set', function (t) { + server.filteringRequestBody(function (body) { + t.doesNotThrow(function () { + var parsed = JSON.parse(body) + t.equal(parsed.access, 'public', 'access level is correct') + }, 'converted body back into object') + return true + }).put('/@bigco%2fpublish-access', true).reply(201, {ok: true}) - process.chdir(pkg) + mkdirp(path.join(pkg, 'cache'), function () { fs.writeFile( path.join(pkg, "package.json"), JSON.stringify({ - name: "@bigco/publish-access", - version: "1.2.5" + name: '@bigco/publish-access', + version: '1.2.5', + public: true }), "ascii", function (er) { - t.ifError(er) - - t.pass("setup done") - t.end() + t.ifError(er, 'package file written') + common.npm( + [ + 'publish', + '--access', 'public', + '--cache', path.join(pkg, 'cache'), + '--loglevel', 'silly', + '--registry', common.registry + ], + { + cwd: pkg + }, + function (er) { + t.ifError(er, 'published without error') + + server.done() + t.end() + } + ) } ) - } -}) - -test("scoped packages pass public access if set", function (t) { - var put = nock(common.registry) - .put("/@bigco%2fpublish-access") - .reply(201, verify) - - npm.config.set("access", "public") - npm.commands.publish([], false, function (er) { - t.ifError(er, "published without error") - - put.done() - t.end() }) - - function verify (_, body) { - t.doesNotThrow(function () { - var parsed = JSON.parse(body) - t.equal(parsed.access, "public", "access level is correct") - }, "converted body back into object") - - return {ok: true} - } }) test("cleanup", function (t) { process.chdir(__dirname) + server.close() rimraf(pkg, function (er) { t.ifError(er) diff --git a/deps/npm/test/tap/publish-access-unscoped.js b/deps/npm/test/tap/publish-access-unscoped.js index 023bfba5f2..4d193cffd9 100644 --- a/deps/npm/test/tap/publish-access-unscoped.js +++ b/deps/npm/test/tap/publish-access-unscoped.js @@ -1,81 +1,70 @@ var fs = require("fs") var path = require("path") -var test = require("tap").test -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") -var nock = require("nock") - -var npm = require("../../") -var common = require("../common-tap.js") +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var mr = require('npm-registry-mock') +var common = require('../common-tap') +var server var pkg = path.join(__dirname, "publish-access-unscoped") -// TODO: nock uses setImmediate, breaks 0.8: replace with mockRegistry -if (!global.setImmediate) { - global.setImmediate = function () { - var args = [arguments[0], 0].concat([].slice.call(arguments, 1)) - setTimeout.apply(this, args) - } -} - -test("setup", function (t) { - mkdirp(path.join(pkg, "cache"), function () { - var configuration = { - cache : path.join(pkg, "cache"), - loglevel : "silent", - registry : common.registry - } - - npm.load(configuration, next) +test('setup', function (t) { + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + t.pass('setup done') + server = s + t.end() }) +}) - function next (er) { - t.ifError(er, "npm loaded successfully") +test('unscoped packages can be explicitly set as public', function (t) { + server.filteringRequestBody(function (body) { + t.doesNotThrow(function () { + var parsed = JSON.parse(body) + t.equal(parsed.access, 'public', 'access level is correct') + }, 'converted body back into object') + return true + }).put('/publish-access', true).reply(201, {ok: true}) - process.chdir(pkg) + mkdirp(path.join(pkg, 'cache'), function () { fs.writeFile( path.join(pkg, "package.json"), JSON.stringify({ - name: "publish-access", - version: "1.2.5" + name: 'publish-access', + version: '1.2.5', + public: true }), "ascii", function (er) { - t.ifError(er) - - t.pass("setup done") - t.end() + t.ifError(er, 'package file written') + common.npm( + [ + 'publish', + '--access', 'public', + '--cache', path.join(pkg, 'cache'), + '--loglevel', 'silly', + '--registry', common.registry + ], + { + cwd: pkg + }, + function (er) { + t.ifError(er, 'published without error') + + server.done() + t.end() + } + ) } ) - } -}) - -test("unscoped packages can be explicitly set as public", function (t) { - var put = nock(common.registry) - .put("/publish-access") - .reply(201, verify) - - npm.config.set("access", "public") - npm.commands.publish([], false, function (er) { - t.ifError(er, "published without error") - - put.done() - t.end() }) - - function verify (_, body) { - t.doesNotThrow(function () { - var parsed = JSON.parse(body) - t.equal(parsed.access, "public", "access level is correct") - }, "converted body back into object") - - return {ok: true} - } }) test("cleanup", function (t) { process.chdir(__dirname) + server.close() rimraf(pkg, function (er) { t.ifError(er) diff --git a/deps/npm/test/tap/publish-scoped.js b/deps/npm/test/tap/publish-scoped.js index f74ca2e616..cf0daed486 100644 --- a/deps/npm/test/tap/publish-scoped.js +++ b/deps/npm/test/tap/publish-scoped.js @@ -1,68 +1,64 @@ var fs = require("fs") var path = require("path") -var test = require("tap").test -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") -var nock = require("nock") - -var npm = require("../../") -var common = require("../common-tap.js") +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var common = require('../common-tap') +var mr = require('npm-registry-mock') var pkg = path.join(__dirname, "prepublish_package") -test("setup", function (t) { - mkdirp(path.join(pkg, "cache"), next) - - function next () { - process.chdir(pkg) - fs.writeFile( - path.join(pkg, "package.json"), - JSON.stringify({ - name: "@bigco/publish-organized", - version: "1.2.5" - }), - "ascii", - function (er) { - t.ifError(er) - - t.pass("setup done") - t.end() - } - ) - } +var server + +function setup () { + cleanup() + mkdirp.sync(path.join(pkg, 'cache')) + + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify({ + name: '@bigco/publish-organized', + version: '1.2.5' + }, null, 2), + 'ascii') +} + +test('setup', function (t) { + setup() + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.end() + }) }) -test("npm publish should honor scoping", function (t) { - var put = nock(common.registry) - .put("/@bigco%2fpublish-organized") - .reply(201, verify) - - var configuration = { - cache : path.join(pkg, "cache"), - loglevel : "silent", - registry : "http://nonexistent.lvh.me", - "//localhost:1337/:username" : "username", - "//localhost:1337/:_password" : new Buffer("password").toString("base64"), - "//localhost:1337/:email" : "ogd@aoaioxxysz.net" - } - - npm.load(configuration, onload) - - function onload (er) { - t.ifError(er, "npm bootstrapped successfully") - - npm.config.set("@bigco:registry", common.registry) - npm.commands.publish([], false, function (er) { - t.ifError(er, "published without error") - - put.done() - - t.end() - }) - } +test('npm publish should honor scoping', function (t) { + server.filteringRequestBody(verify) + .put('/@bigco%2fpublish-organized', true) + .reply(201, {ok: true}) + + var configuration = [ + 'progress=false', + 'cache=' + path.join(pkg, 'cache'), + 'registry=http://nonexistent.lvh.me', + '//localhost:1337/:username=username', + '//localhost:1337/:_password=' + new Buffer('password').toString('base64'), + '//localhost:1337/:email=' + 'ogd@aoaioxxysz.net', + '@bigco:registry=' + common.registry + ] + var configFile = path.join(pkg, '.npmrc') + + fs.writeFileSync(configFile, configuration.join('\n') + '\n') + + common.npm(['publish'], {'cwd': pkg}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'published without error') + server.done() + t.end() + }) - function verify (_, body) { + function verify (body) { t.doesNotThrow(function () { var parsed = JSON.parse(body) var current = parsed.versions["1.2.5"] @@ -79,15 +75,17 @@ test("npm publish should honor scoping", function (t) { ) }, "converted body back into object") - return {ok: true} + return true } }) -test("cleanup", function (t) { - process.chdir(__dirname) - rimraf(pkg, function (er) { - t.ifError(er) - - t.end() - }) +test('cleanup', function (t) { + server.close() + t.end() + cleanup() }) + +function cleanup () { + process.chdir(__dirname) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/registry.js b/deps/npm/test/tap/registry.js index 060d9b67b6..fef099f0af 100644 --- a/deps/npm/test/tap/registry.js +++ b/deps/npm/test/tap/registry.js @@ -38,11 +38,14 @@ function runTests () { cwd: ca, stdio: "inherit" } - common.npm(["install"], opts, function (err, code) { + common.npm(["install"], opts, function (err, code, stdout, stderr) { if (err) { throw err } if (code) { return test("need install to work", function (t) { - t.fail("install failed with: " + code) + t.fail( + "install failed with: " + code + + '\nstdout: ' + stdout + + '\nstderr: ' + stderr) t.end() }) @@ -52,24 +55,32 @@ function runTests () { env: env, stdio: "inherit" } - common.npm(["test", "--", "-Rtap"], opts, function (err, code) { - if (err) { throw err } - if (code) { - return test("need test to work", function (t) { - t.fail("test failed with: " + code) - t.end() + common.npm( + [ + "test", "--", "-Rtap" + ], + opts, + function (err, code, stdout, stderr) { + if (err) { throw err } + if (code) { + return test("need test to work", function (t) { + t.fail( + "test failed with: " + code + + '\nstdout: ' + stdout + + '\nstderr: ' + stderr) + t.end() + }) + } + opts = { + cwd: ca, + env: env, + stdio: "inherit" + } + common.npm(["prune", "--production"], opts, function (err, code) { + if (err) { throw err } + process.exit(code || 0) + }) }) } - opts = { - cwd: ca, - env: env, - stdio: "inherit" - } - common.npm(["prune", "--production"], opts, function (err, code) { - if (err) { throw err } - process.exit(code || 0) - }) - }) - } }) } diff --git a/deps/npm/test/tap/sorted-package-json.js b/deps/npm/test/tap/sorted-package-json.js index 6853cf3020..726b56f46d 100644 --- a/deps/npm/test/tap/sorted-package-json.js +++ b/deps/npm/test/tap/sorted-package-json.js @@ -27,7 +27,7 @@ test("sorting dependencies", function (t) { mr({port : common.port}, function (er, s) { // underscore is already in the package.json, // but --save will trigger a rewrite with sort - var child = spawn(node, [npm, "install", "--save", "underscore@1.3.3"], { + var child = spawn(node, [npm, "install", "--save", "underscore@1.3.3", "--no-progress", "--loglevel=error"], { cwd: pkg, env: { "npm_config_registry": common.registry, @@ -38,7 +38,8 @@ test("sorting dependencies", function (t) { HOME: process.env.HOME, Path: process.env.PATH, PATH: process.env.PATH - } + }, + stdio: ['ignore', 'ignore', process.stderr] }) child.on("close", function (code) {