From 976b9a9ab3ce0e7a592ba2a60035209d4f647992 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kat=20March=C3=A1n?= More Severe Uninstalling
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.
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.
Check out the docs, especially the faq.
@@ -163,5 +127,5 @@2.14.15
+2.14.16
This is the API documentation for npm. To find documentation of the command line @@ -109,5 +109,5 @@
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.
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.
This command used to be known as npm tag
, which only created new tags, and so
had a different syntax.
<name>@<version>
that is published on the registry (see npm-registry(7)
) with (c)<name>@<tag>
that points to (d)<name>@<tag>
(see npm-dist-tag(1)
) that points to (d)<name>
that has a "latest" tag satisfying (e)<git remote url>
that resolves to (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 @@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 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html
index 76687c3384cbba..a4e1f6f12cd71b 100644
--- a/deps/npm/html/doc/cli/npm-outdated.html
+++ b/deps/npm/html/doc/cli/npm-outdated.html
@@ -115,5 +115,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html
index 73a457835f4377..cbd00b28c4515c 100644
--- a/deps/npm/html/doc/cli/npm-owner.html
+++ b/deps/npm/html/doc/cli/npm-owner.html
@@ -49,5 +49,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html
index b68e2f695ce3b1..a0214d27a2d2df 100644
--- a/deps/npm/html/doc/cli/npm-pack.html
+++ b/deps/npm/html/doc/cli/npm-pack.html
@@ -41,5 +41,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-ping.html b/deps/npm/html/doc/cli/npm-ping.html
index 0b8ffbf96f0a9c..5283e84e2be750 100644
--- a/deps/npm/html/doc/cli/npm-ping.html
+++ b/deps/npm/html/doc/cli/npm-ping.html
@@ -32,4 +32,4 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html
index 40f4bde492c25e..9c6eb2fb528bb0 100644
--- a/deps/npm/html/doc/cli/npm-prefix.html
+++ b/deps/npm/html/doc/cli/npm-prefix.html
@@ -38,5 +38,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html
index 2415adf636a58b..cbbf757890bc39 100644
--- a/deps/npm/html/doc/cli/npm-prune.html
+++ b/deps/npm/html/doc/cli/npm-prune.html
@@ -41,5 +41,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html
index fc7d1f6c2df8a8..1b913f936b1849 100644
--- a/deps/npm/html/doc/cli/npm-publish.html
+++ b/deps/npm/html/doc/cli/npm-publish.html
@@ -14,9 +14,11 @@ SYNOPSIS
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 @@ SYNOPSIS
[--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 @@
SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html
index 73066ffa224dd6..e59fa0b5c821ed 100644
--- a/deps/npm/html/doc/cli/npm-rebuild.html
+++ b/deps/npm/html/doc/cli/npm-rebuild.html
@@ -38,5 +38,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html
index 3b997168ccc3bf..f5a16a71c10e40 100644
--- a/deps/npm/html/doc/cli/npm-repo.html
+++ b/deps/npm/html/doc/cli/npm-repo.html
@@ -42,5 +42,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html
index 35c9e2aadf5663..d854a290bb7378 100644
--- a/deps/npm/html/doc/cli/npm-restart.html
+++ b/deps/npm/html/doc/cli/npm-restart.html
@@ -53,5 +53,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-rm.html b/deps/npm/html/doc/cli/npm-rm.html
index 689dceaa1018d7..fc08c1771bdc9f 100644
--- a/deps/npm/html/doc/cli/npm-rm.html
+++ b/deps/npm/html/doc/cli/npm-rm.html
@@ -39,5 +39,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html
index 1352a2c30d9793..aef668a7f82a70 100644
--- a/deps/npm/html/doc/cli/npm-root.html
+++ b/deps/npm/html/doc/cli/npm-root.html
@@ -35,5 +35,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html
index acbddd79e22f71..f272d18c116de1 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 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html
index f00ebb1f9659f1..02d8bf993d0661 100644
--- a/deps/npm/html/doc/cli/npm-search.html
+++ b/deps/npm/html/doc/cli/npm-search.html
@@ -49,5 +49,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html
index d5b938ea789650..22783a1a3a3081 100644
--- a/deps/npm/html/doc/cli/npm-shrinkwrap.html
+++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html
@@ -164,5 +164,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html
index 6482e7f5202a8c..6117bb5ce96ebf 100644
--- a/deps/npm/html/doc/cli/npm-star.html
+++ b/deps/npm/html/doc/cli/npm-star.html
@@ -36,5 +36,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html
index 70acbfb5dd39f6..e3c7fb453d5b67 100644
--- a/deps/npm/html/doc/cli/npm-stars.html
+++ b/deps/npm/html/doc/cli/npm-stars.html
@@ -37,5 +37,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html
index f3c3bc523d19f8..0abf6026f0a99b 100644
--- a/deps/npm/html/doc/cli/npm-start.html
+++ b/deps/npm/html/doc/cli/npm-start.html
@@ -39,5 +39,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html
index 04cddba97bb07e..c548457826cfdc 100644
--- a/deps/npm/html/doc/cli/npm-stop.html
+++ b/deps/npm/html/doc/cli/npm-stop.html
@@ -34,5 +34,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-tag.html b/deps/npm/html/doc/cli/npm-tag.html
index 48b7051ef4c93f..79f75851dc9c3f 100644
--- a/deps/npm/html/doc/cli/npm-tag.html
+++ b/deps/npm/html/doc/cli/npm-tag.html
@@ -62,5 +62,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-team.html b/deps/npm/html/doc/cli/npm-team.html
index e9c4342f8ae670..cde3b3beef7e26 100644
--- a/deps/npm/html/doc/cli/npm-team.html
+++ b/deps/npm/html/doc/cli/npm-team.html
@@ -67,4 +67,4 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html
index d732d76908f254..19803e99079720 100644
--- a/deps/npm/html/doc/cli/npm-test.html
+++ b/deps/npm/html/doc/cli/npm-test.html
@@ -37,5 +37,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html
index 22a78bcb8d6856..dea1476ec915a8 100644
--- a/deps/npm/html/doc/cli/npm-uninstall.html
+++ b/deps/npm/html/doc/cli/npm-uninstall.html
@@ -57,5 +57,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html
index 4152dfbeb867d0..038ef313e42f7d 100644
--- a/deps/npm/html/doc/cli/npm-unpublish.html
+++ b/deps/npm/html/doc/cli/npm-unpublish.html
@@ -47,5 +47,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html
index 8182d4962004b1..16f572e6f7b7eb 100644
--- a/deps/npm/html/doc/cli/npm-update.html
+++ b/deps/npm/html/doc/cli/npm-update.html
@@ -24,7 +24,7 @@ SYNOPSIS
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 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html
index 1f1fcfcb9c6b5d..5e314e7e3dee13 100644
--- a/deps/npm/html/doc/cli/npm-version.html
+++ b/deps/npm/html/doc/cli/npm-version.html
@@ -95,5 +95,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html
index 6298ee702c23eb..6111cdb861a1c7 100644
--- a/deps/npm/html/doc/cli/npm-view.html
+++ b/deps/npm/html/doc/cli/npm-view.html
@@ -82,5 +82,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html
index 9eb94323d838e3..f0d59db71a0342 100644
--- a/deps/npm/html/doc/cli/npm-whoami.html
+++ b/deps/npm/html/doc/cli/npm-whoami.html
@@ -33,5 +33,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html
index bdff00e3b84d21..9fcca1222fa42e 100644
--- a/deps/npm/html/doc/cli/npm.html
+++ b/deps/npm/html/doc/cli/npm.html
@@ -13,7 +13,7 @@ npm
javascript package manager
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 @@
CONTRIBUTIONS
the issues list or ask on the mailing list.
BUGS
When you find issues, please report them:
@@ -118,7 +118,7 @@ BUGS
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.
Isaac Z. Schlueter :: isaacs :: @izs :: -i@izs.me
+i@izs.meThe 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
.
/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.
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
.
/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.
The name is what your thing is called.
Some rules:
git...
See 'Git URLs as Dependencies' belowuser/repo
See 'GitHub URLs' belowtag
A specific version tagged and published as tag
See npm-tag(1)
path/path/path
See Local Paths belowpath/path/path
See Local Paths belowFor example, these are all valid:
{ "dependencies" :
@@ -565,5 +565,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html
index b400267be45aff..2bfc4db1aa78fb 100644
--- a/deps/npm/html/doc/files/npmrc.html
+++ b/deps/npm/html/doc/files/npmrc.html
@@ -83,5 +83,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html
index 83c4be717301ff..d6987af5bcbd48 100644
--- a/deps/npm/html/doc/files/package.json.html
+++ b/deps/npm/html/doc/files/package.json.html
@@ -24,7 +24,7 @@ name
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 @@ dependencies
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 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html
index 84b38628d4de0a..3b9f85fed9baed 100644
--- a/deps/npm/html/doc/index.html
+++ b/deps/npm/html/doc/index.html
@@ -242,5 +242,5 @@ semver(7)
-
+
diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html
index 7fd8a50eb9b166..7c830fb39cb901 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 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html
index bb6d06fd0d55ca..f164cd5e7936a0 100644
--- a/deps/npm/html/doc/misc/npm-config.html
+++ b/deps/npm/html/doc/misc/npm-config.html
@@ -196,7 +196,7 @@ cert
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 @@
SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html
index 1d939787d842ba..05897b052ad918 100644
--- a/deps/npm/html/doc/misc/npm-developers.html
+++ b/deps/npm/html/doc/misc/npm-developers.html
@@ -195,5 +195,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html
index 97b0e475b268d2..9c7fc3df0eee41 100644
--- a/deps/npm/html/doc/misc/npm-disputes.html
+++ b/deps/npm/html/doc/misc/npm-disputes.html
@@ -13,7 +13,7 @@ npm-disputes
Handling Module
SYNOPSIS
- Get the author email with
npm owner ls <pkgname>
-- Email the author, CC support@npmjs.com
+- Email the author, CC support@npmjs.com
- 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 @@ DESCRIPTION
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 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html
index 1ca8232c06ea42..e9c9b6316dbb6a 100644
--- a/deps/npm/html/doc/misc/npm-index.html
+++ b/deps/npm/html/doc/misc/npm-index.html
@@ -242,5 +242,5 @@ semver(7)
-
+
diff --git a/deps/npm/html/doc/misc/npm-orgs.html b/deps/npm/html/doc/misc/npm-orgs.html
index d5417ce6295c26..8089d1aae341c3 100644
--- a/deps/npm/html/doc/misc/npm-orgs.html
+++ b/deps/npm/html/doc/misc/npm-orgs.html
@@ -86,4 +86,4 @@ Team Admins create teams
-
+
diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html
index 79d1aeaf069a5b..405abe5a59fcfb 100644
--- a/deps/npm/html/doc/misc/npm-registry.html
+++ b/deps/npm/html/doc/misc/npm-registry.html
@@ -70,5 +70,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/npm-scope.html b/deps/npm/html/doc/misc/npm-scope.html
index 2394c0035f675b..082079e0ac6560 100644
--- a/deps/npm/html/doc/misc/npm-scope.html
+++ b/deps/npm/html/doc/misc/npm-scope.html
@@ -91,5 +91,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html
index 2bac128e2856d0..c8d13a4a18f194 100644
--- a/deps/npm/html/doc/misc/npm-scripts.html
+++ b/deps/npm/html/doc/misc/npm-scripts.html
@@ -207,5 +207,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html
index e6c4ced30b0fef..61469f102cfcdf 100644
--- a/deps/npm/html/doc/misc/removing-npm.html
+++ b/deps/npm/html/doc/misc/removing-npm.html
@@ -57,5 +57,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html
index 9fc9ae1fd3af3a..782b6cbbdcfd3d 100644
--- a/deps/npm/html/doc/misc/semver.html
+++ b/deps/npm/html/doc/misc/semver.html
@@ -302,5 +302,5 @@ Ranges
-
+
diff --git a/deps/npm/lib/adduser.js b/deps/npm/lib/adduser.js
index 367f3ba0d92754..42c029efb1b84b 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 2e11be32f862fa..851636c3c17ae9 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 e84b66dd8dd51f..f078039e357867 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 66d22009663307..d04e9da5090dd9 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 a5ce90094f6a3a..ab81cc20f61c72 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 650c56fb17deb7..c0a31bdc58a10a 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 dac6a17f251c90..e5daf2066ee9c7 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 dae1e044a77b74..7cf7be7dd7bd53 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 a9c7786bc8b511..3c17975c4ea4e3 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 b93805f9ef378a..ff754dc2d27fa9 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 d865fee89203ee..9d539a0eaacc3d 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 a41165a809aba5..9da086a4a49c0a 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 84681d6d1ce2e1..e503368bc6a62e 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 994fedd2fbf6a7..69c3fc4f3452db 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 bfa750d91ce018..af3395c39f370b 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 f337b9b6d3ff7d..a95cd885ff2403 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 f337b9b6d3ff7d..a95cd885ff2403 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 a08ee531bcc3ba..ba383dd95a8e78 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 a08ee531bcc3ba..ba383dd95a8e78 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 fb33aeb69b2afb..b932989969ca3f 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 d6831c8490de2f..23bb9f2589d394 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 de0a9f416d79d8..3537df68761aa6 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 681fff05e8ec5f..84251b113c2a9c 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 698f5b86133d35..bc716b1702c371 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 52832db0c257a1..38b500d0c0ad52 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 c9c9dd446b9e1a..66d70800f54d54 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 f2982355e14b12..e1882d8ee7d6a4 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 e33d09c1a13473..24abf33a773fd2 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 6a451b451c3c62..db0e8b47617835 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 f9829c618ac7e8..890a3fd2749858 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 00000000000000..4bfc6b1c977614
--- /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 cbb256d983d0f0..4fb141578f19d4 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 bd8b9a3e37b858..5ad2feafe85b74 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 b6900b431740d2..28aa8f2fcf2bcb 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 e734ebfd783193..5d2b4e30e2506c 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 023bfba5f2dd82..4d193cffd99a77 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 f74ca2e6160f60..cf0daed486d6ca 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 060d9b67b67fcc..fef099f0af8092 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 6853cf3020637d..726b56f46d2e16 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) {