deps: upgrade npm beta to 5.0.0-beta.56

PR-URL: https://github.com/nodejs/node/pull/12936
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Kat Marchán 2017-05-09 14:46:02 -07:00 committed by Anna Henningsen
parent 994617370e
commit c0d858f8bb
No known key found for this signature in database
GPG Key ID: D8B9F5AEAE84E4CF
1396 changed files with 72579 additions and 26118 deletions

View File

@ -43,9 +43,9 @@ cache:
- node_modules/tacks
- node_modules/tap
install:
- "node . prune"
- "node . rebuild --depth=0"
- "node . install --ignore-scripts"
- "node . prune"
- "make -j4 doc"
script:
- "node . run tap -- \"test/tap/*.js\" \"test/broken-under-nyc/*.js\""

5
deps/npm/AUTHORS vendored
View File

@ -459,3 +459,8 @@ Evgeny Kulikov <beyondcompute@users.noreply.github.com>
Carol (Nichols || Goulding) <carol.nichols@gmail.com>
Jarid Margolin <jaridmargolin@gmail.com>
David Cook <divergentdave@gmail.com>
Brian Dukes <bdukes@engagesoftware.com>
J F <git@twopointzero.us>
Pavlo Liulia <pavloblack@hotmail.com>
Ján Dzurek <famousgarkin@outlook.com>
Lucas Theisen <ltheisen@mitre.org>

37
deps/npm/BROKEN.org vendored Normal file
View File

@ -0,0 +1,37 @@
* Broken test files
* add-remote-git-get-resolved.js (needs porting to pacote)
* bugs.js (I think because opts.fullMetadata)
* builtin-config.js (freezes)
* check-cpu-reqs.js (uhhh? it's not checking?)
* check-engine-reqs.js (same?)
* check-os-reqs.js (same?)
* doctor.js (needs rewrite)
* full-warning-messages.js
* get.js
* git-npmignore.js
* git-races.js
* github-shortcut.js
* ignore-shrinkwrap.js
* install-shrinkwrapped-git.js
* install-with-dev-dep-duplicate.js
* legacy-npm-self-install.js (one check failed)
* ls-depth-cli.js
* outdated-local.js
* outdated-notarget.js
* outdated-private.js
* peer-deps-invalid.js
* peer-deps-toplevel.js
* peer-deps-without-package-json.js
* repo.js
* retry-on-stale-cache.js
* scope-header.js
* shrinkwrap-default-arg-ver.js
* shrinkwrap-local-dependency.js
* shrinkwrap-optional-dependency.js
* shrinkwrap-optional-property.js
* shrinkwrap-prod-dependency.js
* shrinkwrap-shared-dev-dependency.js
* splat-with-only-prerelease-to-latest.js
* url-dependencies.js
* verify-no-lifecycle-on-repo.js
* network/legacy-shrinkwrap.js

74
deps/npm/CHANGELOG.md vendored
View File

@ -1,3 +1,77 @@
## v4.6.1 (2017-04-21)
A little release to tide you over while we hammer out the last bits for npm@5.
### FEATURES
* [`d13c9b2f2`](https://github.com/npm/npm/commit/d13c9b2f24b6380427f359b6e430b149ac8aaa79)
`init-package-json@1.10.0`:
The `name:` prompt is now `package name:` to make this less ambiguous for new users.
The default package name is now a valid package name. For example: If your package directory
has mixed case, the default package name will be all lower case.
* [`f08c66323`](https://github.com/npm/npm/commit/f08c663231099f7036eb82b92770806a3a79cdf1)
[#16213](https://github.com/npm/npm/pull/16213)
Add `--allow-same-version` option to `npm version` so that you can use `npm version` to run
your version lifecycles and tag your git repo without actually changing the version number in
your `package.json`.
([@lucastheisen](https://github.com/lucastheisen))
* [`f5e8becd0`](https://github.com/npm/npm/commit/f5e8becd05e0426379eb0c999abdbc8e87a7f6f2)
Timing has been added throughout the install implementation. You can see it by running
a command with `--loglevel=timing`. You can also run commands with `--timing` which will write
an `npm-debug.log` even on success and add an entry to `_timing.json` in your cache with
the timing information from that run.
([@iarna](https://github.com/iarna))
### BUG FIXES
* [`9c860f2ed`](https://github.com/npm/npm/commit/9c860f2ed3bdea1417ed059b019371cd253db2ad)
[#16021](https://github.com/npm/npm/pull/16021)
Fix a crash in `npm doctor` when used with a registry that does not support
the `ping` API endpoint.
([@watilde](https://github.com/watilde))
* [`65b9943e9`](https://github.com/npm/npm/commit/65b9943e9424c67547b0029f02b0258e35ba7d26)
[#16364](https://github.com/npm/npm/pull/16364)
Shorten the ELIFECYCLE error message. The shorter error message should make it much
easier to discern the actual cause of the error.
([@j-f1](https://github.com/j-f1))
* [`a87a4a835`](https://github.com/npm/npm/commit/a87a4a8359693518ee41dfeb13c5a8929136772a)
`npmlog@4.0.2`:
Fix flashing of the progress bar when your terminal is very narrow.
([@iarna](https://github.com/iarna))
* [`41c10974f`](https://github.com/npm/npm/commit/41c10974fe95a2e520e33e37725570c75f6126ea)
`write-file-atomic@1.3.2`:
Wait for `fsync` to complete before considering our file written to disk.
This will improve certain sorts of Windows diagnostic problems.
* [`2afa9240c`](https://github.com/npm/npm/commit/2afa9240ce5b391671ed5416464f2882d18a94bc)
[#16336](https://github.com/npm/npm/pull/16336)
Don't ham-it-up when expecting JSON.
([@bdukes](https://github.com/bdukes))
### DOCUMENTATION FIXES
* [`566f3eebe`](https://github.com/npm/npm/commit/566f3eebe741f935b7c1e004bebf19b8625a1413)
[#16296](https://github.com/npm/npm/pull/16296)
Use a single convention when referring to the `<command>` you're running.
([@desfero](https://github.com/desfero))
* [`ccbb94934`](https://github.com/npm/npm/commit/ccbb94934d4f677f680c3e2284df3d0ae0e65758)
[#16267](https://github.com/npm/npm/pull/16267)
Fix a missing space in the example package.json.
([@famousgarkin](https://github.com/famousgarkin))
### DEPENDENCY UPDATES
* [`ebde4ea33`](https://github.com/npm/npm/commit/ebde4ea3363dfc154c53bd537189503863c9b3a4)
`hosted-git-info@2.4.2`
* [`c46ad71bb`](https://github.com/npm/npm/commit/c46ad71bbe27aaa9ee10e107d8bcd665d98544d7)
`init-package-json@1.9.6`
* [`d856d570d`](https://github.com/npm/npm/commit/d856d570d2df602767c039cf03439d647bba2e3d)
`npm-registry-client@8.1.1`
* [`4a2e14436`](https://github.com/npm/npm/commit/4a2e1443613a199665e7adbda034d5b9d10391a2)
`readable-stream@2.2.9`
* [`f0399138e`](https://github.com/npm/npm/commit/f0399138e6d6f1cd7f807d523787a3b129996301)
`normalize-package-data@2.3.8`
### v4.5.0 (2017-03-24)
Welcome a wrinkle on npm's registry API!

24
deps/npm/Makefile vendored
View File

@ -53,23 +53,23 @@ latest:
@echo "Installing latest published npm"
@echo "Use 'make install' or 'make link' to install the code"
@echo "in this folder that you're looking at right now."
node cli.js install -g -f npm ${NPMOPTS}
node bin/npm-cli.js install -g -f npm ${NPMOPTS}
install: all
node cli.js install -g -f ${NPMOPTS}
node bin/npm-cli.js install -g -f ${NPMOPTS}
# backwards compat
dev: install
link: uninstall
node cli.js link -f
node bin/npm-cli.js link -f
clean: markedclean marked-manclean doc-clean uninstall
rm -rf npmrc
node cli.js cache clean
node bin/npm-cli.js cache clean
uninstall:
node cli.js rm npm -g -f
node bin/npm-cli.js rm npm -g -f
doc: $(mandocs) $(htmldocs)
@ -143,22 +143,22 @@ html/doc/misc/%.html: doc/misc/%.md $(html_docdeps)
marked: node_modules/.bin/marked
node_modules/.bin/marked:
node cli.js install marked --no-global
node bin/npm-cli.js install marked --no-global --no-timing --no-save
marked-man: node_modules/.bin/marked-man
node_modules/.bin/marked-man:
node cli.js install marked-man --no-global
node bin/npm-cli.js install marked-man --no-global --no-timing --no-save
doc: man
man: $(cli_docs)
test: doc
node cli.js test
node bin/npm-cli.js test
tag:
npm tag npm@$(PUBLISHTAG) latest
node bin/npm-cli.js tag npm@$(PUBLISHTAG) latest
ls-ok:
node . ls >/dev/null
@ -167,13 +167,13 @@ gitclean:
git clean -fd
publish: gitclean ls-ok link doc-clean doc
@git push origin :v$(shell npm -v) 2>&1 || true
@git push origin :v$(shell node bin/npm-cli.js --no-timing -v) 2>&1 || true
git push origin $(BRANCH) &&\
git push origin --tags &&\
npm publish --tag=$(PUBLISHTAG)
node bin/npm-cli.js publish --tag=$(PUBLISHTAG)
release: gitclean ls-ok markedclean marked-manclean doc-clean doc
node cli.js prune --production
node bin/npm-cli.js prune --production --no-save
@bash scripts/release.sh
sandwich:

2
deps/npm/README.md vendored
View File

@ -78,7 +78,7 @@ If you plan on hacking on npm, `make link` is your friend.
If you've got the npm source code, you can also semi-permanently set
arbitrary config keys using the `./configure --key=val ...`, and then
run npm commands by doing `node cli.js <cmd> <args>`. (This is helpful
run npm commands by doing `node bin/npm-cli.js <command> <args>`. (This is helpful
for testing, or running stuff without actually installing npm itself.)
## Windows Install or Upgrade

72
deps/npm/TODO.org vendored Normal file
View File

@ -0,0 +1,72 @@
* Finished
* [COMPLETED] npm: add `created-with`, `shrinkwrap-version`, and `package-integrity`
* [COMPLETED] npm: warn on incompatible package-lock version
* [COMPLETED] npm: warn if both shrinkwrap and package-lock are there
* [COMPLETED] npm: fix git-prepare
* [COMPLETED] npm: fix auth failure for locked scoped deps
* [COMPLETED] npm: send the user-agent through to pacote
* [COMPLETED] npm: get https://github.com/npm/write-file-atomic/pull/23 merged
* [COMPLETED] npm: get https://github.com/npm/fstream-npm/pull/27 merged
* [COMPLETED] npm: if local deps exist w/o needed metadata, fetch it
* [COMPLETED] Run `prepare` during git tarball packing phase
* [COMPLETED] npm: put npm cache clear behind --force
* [COMPLETED] npm: package-lock.json
* lib/install/read-shrinkwrap.js
* lib/shrinkwrap.js
* lib/install/save.js (?)
* lib/utils/tar.js (add autoignore)
* fstream-npm (add autoignore)
* lib/version.js
* [COMPLETED] npm: --save by default
* [COMPLETED] npm: make sure `npm i <pkg>` defaults to package.json
* it only happens for command line arguments
* getAllMetadata
* Apparently, I did this way back when and totally forgot. lol.
* [COMPLETED] make-fetch-happen: make sure other options npm used are implemented
* look at the comment at the bottom of pacote.js
* [COMPLETED] make-fetch-happen: support strictSSL option
* [COMPLETED] Write npm@5 speeds presentation for Friday
* [COMPLETED] pacote: support `opts.fullMetadata` for `pkg.manifest`
* [COMPLETED] npm: fix invalid package: null error
* [COMPLETED] make-fetch-happen: case-insensitive http_proxy/proxy/https_proxy
* [COMPLETED] cacache: integrate cacache@8 into npm/pacote/mfh
* [COMPLETED] make-fetch-happen: literally vendor in node-fetch. sigh.
* basically, the whole tarball situation prevents shrinkwrap. sux :<
* note: solved this by forking node-fetch into node-fetch-npm
* [COMPLETED] pacote: http auth and alwaysAuth
* https://github.com/zkat/pacote/issues/77
* [COMPLETED] make-fetch-happen: NO_PROXY support
* https://github.com/zkat/make-fetch-happen/issues/17
* [COMPLETED] npm: calculate sri with ssri and add it to dist.integrity
* [COMPLETED] pacote: refactor handler API
* maybe use Protoduck?
* [COMPLETED] npm: nag Ryan about when sha512 is happening
* He says it's delayed 😭
* I can still start sending integrity in the publish
* [COMPLETED] npm: fix bundle replacement issues (see: npm i nyc warning spam)
* need fromBundle attribute on shrinkwrap and pass it through. the sw.version && sw.integrity-based fake node needs to have this there.
* Backlog
* [TODO] pacote: opts.extraHeaders
* https://github.com/zkat/pacote/issues/79
* [TODO] pacote: ECONNRESET recovery
* https://github.com/zkat/pacote/issues/8
* [TODO] pacote: skip node_modules extraction for non-bundleDeps
* https://github.com/zkat/pacote/issues/49
* [TODO] pacote: write tests for file/directory handlers
* [TODO] npm: `npm publish --dry-run` -> https://npm.im/pkgfiles ?
* Rebecca says yea
* [TODO] make-fetch-happen: write tests for agent pooling/proxy
* https://github.com/zkat/make-fetch-happen/issues/16
* [TODO] make-fetch-happen: retry notification
* https://github.com/zkat/make-fetch-happen/issues/21
* [TODO] npm: move addBundled call from inflate-shrinkwrap to extract
* fix the fucking bundling thing while at it
* Needed for npm@5
* [TODO] pacote: write tests for git handlers
* https://github.com/zkat/pacote/issues/70
* [TODO] pacote: offline feature support for git deps
* [TODO] npm: get logging working during the recalculateMetadata spam
* [TODO] write-file-atomic: review https://github.com/npm/write-file-atomic/pull/22
* Active
* [TODO] npm: make `npm update` save files as the right type
* [TODO] node: track down lifecycle signal failure

View File

@ -15,6 +15,7 @@ install:
- ps: Install-Product node $env:nodejs_version $env:platform
- npm config set spin false
- npm rebuild
- npm i -g "npm/npm#release-beta-5"
- node . install -g .
- set "PATH=%APPDATA%\npm;C:\Program Files\Git\mingw64\libexec;%PATH%"
- npm install --loglevel=http

View File

@ -57,7 +57,7 @@
if (conf.version) {
console.log(npm.version)
return
return errorHandler.exit(0)
}
if (conf.versions) {
@ -83,7 +83,7 @@
if (er) return errorHandler(er)
npm.commands[npm.command](npm.argv, function (err) {
// https://www.youtube.com/watch?v=7nfPu8qTiQU
if (!err && npm.config.get('ham-it-up')) {
if (!err && npm.config.get('ham-it-up') && !npm.config.get('json') && !npm.config.get('parseable')) {
output('\n 🎵 I Have the Honour to Be Your Obedient Servant,🎵 ~ npm 📜🖋\n')
}
errorHandler.apply(this, arguments)

View File

@ -1,3 +1,682 @@
### v2.15.12 (2017-03-24):
This version brings the latest `node-gyp` to a soon to be released Node.js
4.x. The `node-gyp` update is paticularly important to Windows folks due to
its addition of Visual Studio 2017 support.
* [`cdd60e733`](https://github.com/npm/npm/commit/cdd60e733905a9994e1d6d832996bfdd12abeaee)
`node-gyp@3.6.0`:
Improvements to how Python is located. New `--devdir` flag.
Support for VS2017.
Chakracore support on ARM.
Remove path-array dependency, reducing size significantly.
([@bnoordhuis](https://github.com/bnoordhuis))
([@mhart](https://github.com/mhart))
([@refack](https://github.com/refack))
([@kunalspathak](https://github.com/kunalspathak))
### v2.15.11 (2016-09-08):
On we go with our monthly release cadence! This week is pretty much all
dependency updates and some documentation changes, as can be expected by now.
Note that `npm@4` will almost certainly be released next month! It's not final
what we'll end up doing as far as LTS support goes, but the current thinking is
that, considering how small and resource-constrained our team is, support for
`npm@2` will be reduced to essentially maintenance, so we can better focus on
`npm@3` as the new LTS version (which will go into `node@6`), and `npm@4` as our
next main development version.
#### DOCUMENTATION UPDATES
* [`8f71038`](https://github.com/npm/npm/commit/8f71038310501ad5bc7445b2fa2ff0eaa377919a)
[#13892](https://github.com/npm/npm/pull/13892)
Update `LICENSE` file to match license on `master`.
([@rvagg](https://github.com/rvagg))
* [`e81b4f1`](https://github.com/npm/npm/commit/e81b4f1d18a4d79b7af8342747f2ed7dc3e84f0a)
[#12438](https://github.com/npm/npm/issues/12438)
Remind folks to use `#!/usr/bin/env node` in their `bin` scripts to make files
executable directly.
([@mxstbr](https://github.com/mxstbr))
* [`f89789f`](https://github.com/npm/npm/commit/f89789f43d65bfc74f64f15a99356841377e1af3)
[#13655](https://github.com/npm/npm/pull/13655)
Document line comment syntax for `.npmrc`.
([@mdjasper](https://github.com/mdjasper))
* [`5cd3abc`](https://github.com/npm/npm/commit/5cd3abc3511515e09b4a1b781c0520e84c267c5b)
[#13493](https://github.com/npm/npm/pull/13493)
Document that the user config file can itself be configured either through the
`$NPM_CONFIG_USERCONFIG` environment variable, or `--userconfig` command line
flag.
([@jasonkarns](https://github.com/jasonkarns))
* [`dd71ca0`](https://github.com/npm/npm/commit/dd71ca0efc2094b824ccc9e23af0fc915499f2e6)
[#13911](https://github.com/npm/npm/pull/13911)
Minor documentation reword and cleanup.
([@othiym23](https://github.com/othiym23))
* [`f7a320c`](https://github.com/npm/npm/commit/f7a320c816947d578a050c97e0fb9878954be0e8)
[#13682](https://github.com/npm/npm/pull/13682)
Minor grammar fix in documentation for `npm scripts`.
([@Ajedi32](https://github.com/Ajedi32))
* [`e5cb5e8`](https://github.com/npm/npm/commit/e5cb5e8fcf4642836fedf3f3421c994a8e27e19b)
[#13717](https://github.com/npm/npm/pull/13717)
Document that `npm link` will link the files specified in the `bin` field of
`package.json` to `{prefix}/bin/{name}`.
([@legodude17](https://github.com/legodude17))
#### DEPENDENCY UPDATES
* [`8bef026`](https://github.com/npm/npm/commit/8bef026603b6da888edf0d41308d9e532abfcd54)
`graceful-fs@4.1.6`
([@francescoinfante](https://github.com/francescoinfante))
* [`9f73f4a`](https://github.com/npm/npm/commit/9f73f4aab5f56b256c5cf9e461e81abfa2844945)
`glob@7.0.6`
([@isaacs](https://github.com/isaacs))
* [`5391b7e`](https://github.com/npm/npm/commit/5391b7e8cd4401fbadbf54e810fdc965a3662a21)
`which@1.2.1`
([@isaacs](https://github.com/isaacs))
* [`43bfec8`](https://github.com/npm/npm/commit/43bfec8376dd8ded7d56a8dabd6139919544760e)
`retry@0.10.0`
([@tim-kos](https://github.com/tim-kos))
* [`39305f1`](https://github.com/npm/npm/commit/39305f1c76f74bf9789c769ef72a94ea9a81d119)
`readable-stream@2.1.5`
([@calvinmetcalf](https://github.com/calvinmetcalf))
* [`a5512fa`](https://github.com/npm/npm/commit/a5512fafd72e23755e77e28f1122b008bc12a733)
`once@1.4.0`
([@zkochan](https://github.com/zkochan))
* [`06a208b`](https://github.com/npm/npm/commit/06a208b178c1de3d0da58bc35a854d200fea8ef0)
`npm-registry-client@7.2.1`:
* [npm/npm-registry-client#142](https://github.com/npm/npm-registry-client/pull/142) Fix `EventEmitter` warning spam from error handlers on socket. ([@addaleax](https://github.com/addaleax))
* [npm/npm-registry-client#131](https://github.com/npm/npm-registry-client/pull/131) Adds support for streaming request bodies. ([@aredridel](https://github.com/aredridel))
* Fixes [#13656](https://github.com/npm/npm/issues/13656).
* Dependency updates.
* Documentation improvements.
([@othiym23](https://github.com/othiym23))
* [`4f759be`](https://github.com/npm/npm/commit/4f759be1fb5e23180b970350e58f40a513daa680)
`inherits@2.0.3`
([@isaacs](https://github.com/isaacs))
* [`4258b76`](https://github.com/npm/npm/commit/4258b764e2565f6294ae1e34a5653895290b62e3)
`tap@7.1.1`
([@isaacs](https://github.com/isaacs))
### v2.15.10 (2016-08-11):
Hi all, today's our first release coming out of the new monthly release
cadence. See below for details. We're all recovered from conferences now and
raring to go! For LTS we see some bug fixes, documentation improvements and
a host of dependency updates.
The most dramatic bug fix is probably the inclusion of scoped modules in
bundled dependencies. Prior to this release and
[v3.10.7](https://github.com/npm/npm/releases/v3.10.7), npm had ignored
scoped modules found in `bundleDependencies` entirely.
#### NEW RELEASE CADENCE
Releasing npm has been, for the most part, a very prominent part of our
weekly process process. As part of our efforts to find the most effective
ways to allocate our team's resources, we decided last month that we would
try and slow our releases down to a monthly cadence, and see if we found
ourselves with as much extra time and attention as we expected to have.
Process experiments are useful for finding more effective ways to do our
work, and we're at least going to keep doing this for a whole quarter, and
then measure how well it worked out. It's entirely likely that we'll switch
back to a more frequent cadence, specially if we find that the value that
weekly cadence was providing the community is not worth sacrificing for a
bit of extra time. Does this affect you significantly? Let us know!
#### WINDOWS CORNER CASES
* [`405c404`](https://github.com/npm/npm/commit/405c4048c69c14d66e6179aba0c8a35e504e8041)
[#13023](https://github.com/npm/npm/pull/13023)
Fixed a Windows issue with the cache where callbacks could be called more than once.
([@zkat](https://github.com/zkat))
* [`bf348dc`](https://github.com/npm/npm/commit/bf348dcfb944dc4b9f71b779bf172f86a2e1f474)
[#13023](https://github.com/npm/npm/pull/13023)
Fixed a Windows corner case with correct-mkdir where if SUDO_UID or
SUDO_GID were set then we would try to chown things even though that can't
work on Windows.
([@zkat](https://github.com/zkat))
#### RACES IN THE CACHE
* [`68f29f1`](https://github.com/npm/npm/commit/68f29f18f65c7a7e1c58eb6933af41d786971379)
[#12669](https://github.com/npm/npm/issues/12669)
Ignore ENOENT errors on chownr while adding packages to cache. This change
works around problems with race conditions and local packages.
([@julianduque](https://github.com/julianduque))
#### BETTER GIT ENVIRONMENT WHITELISTING
* [`5e96566`](https://github.com/npm/npm/commit/5e96566088f0d88c1ed10c5a9cbb7c0cd4aa2aee)
[#13358](https://github.com/npm/npm/pull/13358)
Add GIT_EXEC_PATH to Git environment whitelist.
([@mhart](https://github.com/mhart))
#### DOCUMENTATION
* [`363e381`](https://github.com/npm/npm/commit/363e381a4076ead89707a00cc4a447b1d59df3bc)
[#13319](https://github.com/npm/npm/pull/13319)
As Node.js 0.8 is no longer supported, remove mention of it from the README.
([@watilde](https://github.com/watilde))
* [`e8fafa8`](https://github.com/npm/npm/commit/e8fafa887c60eb8842c76c4b3dffe85eb49fa434)
[#10167](https://github.com/npm/npm/pull/10167)
Clarify in scope documentation that npm@2 is required for scoped packages.
([@danpaz](https://github.com/danpaz))
#### DEPENDENCIES
* [`66ef279`](https://github.com/npm/npm/commit/66ef279b7c3b3e4f9454474dddd057cc1f21873b)
[npm/fstream-npm#22](https://github.com/npm/fstream-npm/pull/22)
`fstream@1.1.1`:
Always include NOTICE files now. Fix inclusion of scoped modules as bundled dependencies.
([@kemitchell](https://github.com/kemitchell))
([@forivall](https://github.com/forivall))
* [`fe8385b`](https://github.com/npm/npm/commit/fe8385bd655502feb175eed175a6a06cafb2247a)
`glob@7.0.5`:
Update minimatch dep for security fix. See the minimatch update below for details.
([@isaacs](https://github.com/isaacs))
* [`51d49d2`](https://github.com/npm/npm/commit/51d49d2f79b4c69264de73a492ed54f87188d554)
[isaacs/node-graceful-fs#71](https://github.com/isaacs/node-graceful-fs/pull/71)
`graceful-fs@4.1.5`:
`graceful-fs` had a [bug fix](https://github.com/isaacs/node-graceful-fs/pull/71) which
fixes a problem ([nodejs/node#7846](https://github.com/nodejs/node/pull/7846)) exposed
by recent changes to Node.js.
([@thefourtheye](https://github.com/thefourtheye))
* [`5c8f39d`](https://github.com/npm/npm/commit/5c8f39d152c43e96b9006ffe865646a36a433a8a)
`minimatch@3.0.3`:
Handle extremely long and terrible patterns more gracefully.
There were some magic numbers that assumed that every extglob pattern starts
and ends with a specific number of characters in the regular expression.
Since !(||) patterns are a little bit more complicated, this led to creating
an invalid regular expression and throwing.
([@isaacs](https://github.com/isaacs))
* [`d681e16`](https://github.com/npm/npm/commit/d681e16a475a49d6196af9a5cedaaf88712f3a9f)
[npm/npm-user-validate#9](https://github.com/npm/npm-user-validate/pull/9)
`npm-user-validate@0.1.5`:
Use correct, lower username length limit.
([@aredridel](https://github.com/aredridel))
* [`f918994`](https://github.com/npm/npm/commit/f918994bd05ca965766cd573606ac35fb3032d6e)
`request@2.74.0`:
Update `request` dependency `tough-cookie` to `2.3.0` to
to address [https://nodesecurity.io/advisories/130](https://nodesecurity.io/advisories/130).
Versions 0.9.7 through 2.2.2 contain a vulnerable regular expression that,
under certain conditions involving long strings of semicolons in the
"Set-Cookie" header, causes the event loop to block for excessive amounts of
time.
([@stash-sfdc](https://github.com/stash-sfdc))
* [`5540cc4`](https://github.com/npm/npm/commit/5540cc4d6bde65071fb6fc2cb074e8598bd1276f)
[isaacs/rimraf#111](https://github.com/isaacs/rimraf/issues/111)
`rimraf@2.5.4`: Clarify assertions: cb is required, options are not.
([@isaacs](https://github.com/isaacs))
* [`6357928`](https://github.com/npm/npm/commit/6357928673be85f520dae2104fea58c35742bd65)
`spdx-license-ids@1.2.2`:
New licenses synced from spdx.org.
([@shinnn](https://github.com/shinnn))
### v2.15.9 (2016-06-30):
What's this? An LTS release? Yes, that is indeed so. Small, as usual, and as
LTSs should be, really, but a release nonetheless!
The star of the show is an updated `node-gyp` with some goodies. The rest is
just docs and some CI stuff.
Happy hacking!
#### DEPENDENCY UPDATE!
* [`f9a07cc`](https://github.com/npm/npm/commit/f9a07cc873f1915827d8df97d0c43204d1eb128c)
[#13200](https://github.com/npm/npm/pull/13200)
[`node-gyp@3.4.0`](https://github.com/nodejs/node-gyp/blob/master/CHANGELOG.md):
AIX, Visual Studio 2015, and logging improvements. Oh my~!
([@rvagg](https://github.com/rvagg))
#### CI TWEAKS
* [`bee83b8`](https://github.com/npm/npm/commit/bee83b8500c31aba65451dfcb082f9b5d1d5ce34)
Globally install `rimraf` on CI to make the LTS self-install work better.
([@othiym23](https://github.com/othiym23))
* [`6b8c0ab`](https://github.com/npm/npm/commit/6b8c0ab6fcbf8a37e8693acb8bbac22293b10893)
This new Travis configuration only runs coverage checks against Node.js LTS,
which speeds up all the other test runs. By, like, a lot. Also, the entire
file has been extensively commented, so the next time we need to mess with it,
we'll be able to better remember why all the weird bits are there.
([@othiym23](https://github.com/othiym23))
#### DOCUMENTATION FIXES
* [`2c7a5be`](https://github.com/npm/npm/commit/2c7a5be080276e3fdca3375ab0f8f5edffff753e)
[#13156](https://github.com/npm/npm/pull/13156)
Fix old reference to `doc/install` in a source comment.
([@sheerun](https://github.com/sheerun))
* [`e1cf78c`](https://github.com/npm/npm/commit/e1cf78c5b77f95383bd4a7fc6eeb8adbbe68e12e)
[#13189](https://github.com/npm/npm/pull/13189)
[#13113](https://github.com/npm/npm/issues/13113)
[#13189](https://github.com/npm/npm/pull/13189)
Fixes a link to `npm-tag(3)` that was breaking to instead point to
`npm-dist-tag(1)`, as reported by [@SimenB](https://github.com/SimenB)
([@macdonst](https://github.com/macdonst))
### v2.15.8 (2016-06-17):
There's a very important bug fix and a long-awaited (and significant!)
deprecation in this hotfix release. [Hold on.](http://butt.holdings/)
#### *WHOA*
When Node.js 6.0.0 was released, the CLI team noticed an alarming upsurge in
bugs related to important files (like `README.md`) not being included in
published packages. The new bugs looked much like
[#5082](https://github.com/npm/npm/issues/5082), which had been around in one
form or another since April, 2014. #5082 used to be a very rare (and obnoxious)
bug that the CLI team hadn't had much luck reproducing, and we'd basically
marked it down as a race condition that arose on machines using slow and / or
rotating-media-based hard drives.
Under 6.0.0, the behavior was reliable enough to be nearly deterministic, and
made it very difficult for publishers using `.npmignore` files in combination
with `"files"` stanzas in `package.json` to get their packages onto the
registry without one or more files missing from the packed tarball. The entire
saga is contained within [the issue](https://github.com/npm/npm/issues/5082),
but the summary is that an improvement to the performance of
[`fs.realpath()`](https://nodejs.org/api/fs.html#fs_fs_realpath_path_options_callback)
made it much more likely that the packing code would lose the race.
Fixing this has proven to be very difficult, in part because the code used by
npm to produce package tarballs is more complicated than, strictly speaking, it
needs to be. [**@evanlucas**](https://github.com/evanlucas) contributed [a
patch](https://github.com/npm/fstream/pull/50) that passed the tests in a
[special test suite](https://github.com/othiym23/eliminate-5082) that I
([**@othiym23**](https://github.com/othiym23)) created (with help from
[**@addaleax**](https://github.com/addaleax)), but only _after_ we'd released
the fixed version of that package did we learn that it actually made the
problem _worse_ in other situations in npm proper. Eventually,
[**@rvagg**](https://github.com/rvagg) put together a more durable fix that
appears to completely address the errant behavior under Node.js 6.0.0. That's
the patch included in this release. Everybody should chip in for redback
insurance for Rod and his family; he's done the community a huge favor.
Does this mean the long (2+ year) saga of #5082 is now over? At this point, I'm
going to quote from my latest summary on the issue:
> The CLI team (mostly me, with input from the rest of the team) has decided that
> the overall complexity of the interaction between `fstream`, `fstream-ignore`,
> `fstream-npm`, and `node-tar` has grown more convoluted than the team is
> comfortable (maybe even capable of) supporting.
>
> - While I believe that @rvagg's (very targeted) fix addresses _this_ issue, I
> would be shocked if there aren't other race conditions in npm's packing
> logic. I've already identified a couple other places in the code that are
> most likely race conditions, even if they're harder to trigger than the
> current one.
> - The way that dependency bundling is integrated leads to a situation in
> which a bunch of logic is duplicated between `fstream-npm` and
> `lib/utils/tar.js` in npm itself, and the way `fstream`'s extension
> mechanism works makes this difficult to clean up. This caused a nasty
> regression ([#13088](https://github.com/npm/fstream/pull/50), see below) as
> of ~`npm@3.8.7` where the dependencies of `bundledDependencies` were no
> longer being included in the built package tarballs.
> - The interaction between `.npmignore`, `.gitignore`, and `files` is hopelessly
> complicated, scattered in many places throughout the code. We've been
> discussing [making the ignores and includes logic clearer and more
> predictable](https://github.com/npm/npm/wiki/Files-and-Ignores), and the
> current code fights our efforts to clean that up.
>
> So, our intention is still to replace `fstream`, `fstream-ignore`, and
> `fstream-npm` with something much simpler and purpose-built. There's no real
> reason to have a stream abstraction here when a simple recursive-descent
> filesystem visitor and a synchronous function that can answer whether a given
> path should be included in the packed tarball would do the job adequately.
>
> What's not yet clear is whether we'll need to replace `node-tar` in the
> process. `node-tar` is a very robust implementation of tar (it handles, like,
> everything), and it also includes some very important tweaks to prevent several
> classes of security exploits involving maliciously crafted packages. However,
> its packing API involves passing in an `fstream` instance, so we'd either need
> to produce something that follows enough of `fstream`'s contract for `node-tar`
> to keep working, or swap `node-tar` out for something like `tar-stream` (and
> then ensuring that our use of `tar-stream` is secure, which could involve
> security patches for either npm or `tar-stream`).
The testing and review of `fstream@1.0.10` that the team has done leads us to
believe that this bug is fixed, but I'm feeling more than a little paranoid
about fstream now, so it's important that people keep a close eye on their
publishes for a while and let us know immediately if they notice any
irregularities.
* [`2c49265`](https://github.com/npm/npm/commit/2c49265c6746d29ae0cd5f3532d28c5950f9847e)
[#5082](https://github.com/npm/npm/issues/5082) `fstream@1.0.10`: Ensure that
entries are collected after a paused stream resumes.
([@rvagg](https://github.com/rvagg))
* [`92e4344`](https://github.com/npm/npm/commit/92e43444d9204f749f83512aeab5d5e0a2d085a7)
[#5082](https://github.com/npm/npm/issues/5082) Remove the warning introduced
in `npm@3.10.0`, because it should no longer be necessary.
([@othiym23](https://github.com/othiym23))
#### GOODBYE, FAITHFUL FRIEND
At NodeConf Adventure 2016 (RIP in peace, Mikeal Rogers's NodeConf!), the CLI
team had an opportunity to talk to representatives from some of the larger
companies that we knew were still using Node.js 0.8 in production. After asking
them whether they were still using 0.8, we got back blank stares and questions
like, "0.8? You mean, from four years ago?" After establishing that being able
to run npm in their legacy environments was no longer necessary, the CLI team
made the decision to drop support for 0.8. (Faithful observers of our [team
meetings](https://github.com/npm/npm/issues?utf8=%E2%9C%93&q=is%3Aissue+npm+cli+team+meeting+)
will have known this was the plan for NodeConf since the beginning of 2016.)
In practice, this means only what's in the commit below: we've removed 0.8 from
our continuous integration test matrix below, and will no longer be habitually
testing changes under Node 0.8. We may also give ourselves permission to use
`setImmediate()` in test code. However, since the project still supports
Node.js 0.10 and 0.12, it's unlikely that patches that rely on ES 2015
functionality will land anytime soon.
Looking forward, the team's current plan is to drop support for Node.js 0.10
when its LTS maintenace window expires in October, 2016, and 0.12 when its
maintenance / LTS window ends at the end of 2016. We will also drop support for
Node.js 5.x when Node.js 6 becomes LTS and Node.js 7 is released, also in the
October-December 2016 timeframe.
(Confused about Node.js's LTS policy? [Don't
be!](https://github.com/nodejs/LTS) If you look at [this
diagram](https://github.com/nodejs/LTS/blob/ce364a94b0e0619eba570cd57be396573e1ef889/schedule.png),
it should make all of the preceding clear.)
If, in practice, this doesn't work with distribution packagers or other
community stakeholders responsible for packaging and distributing Node.js and
npm, please reach out to us. Aligning the npm CLI's LTS policy with Node's
helps everybody minimize the amount of work they need to do, and since all of
our teams are small and very busy, this is somewhere between a necessity and
non-negotiable.
* [`4a1ecc0`](https://github.com/npm/npm/commit/4a1ecc068fb2660bd9bc3e2e2372aa0176d2193b)
Remove 0.8 from the Node.js testing matrix, and reorder to match real-world
priority, with comments. ([@othiym23](https://github.com/othiym23))
### v2.15.7 (2016-06-16):
It pains me greatly that we haven't been able to fix
[#5082](https://github.com/npm/npm/issues/5082) yet, but warning you away from
potentially publishing incomplete packages takes priority over feeling cheesy
about landing a warning to help keep y'all out of trouble, so here you go
(_please read this next bit_ (_please clap_)):
#### DANGER: PUBLISHING ON NODE 6.0.0
Publishing and packing are buggy under Node versions greater than 6.0.0.
Please use Node.js LTS (4.4.x) to publish packages. See
[#5082](https://github.com/npm/npm/issues/5082) for details and current
status.
* [`dff00ce`](https://github.com/npm/npm/commit/dff00cedd56b9c04370f840299a7e657a7a835c6)
[#13077](https://github.com/npm/npm/pull/13077)
Warn when using Node 6+.
([@othiym23](https://github.com/othiym23))
#### PACKAGING CHANGES
* [`1877171`](https://github.com/npm/npm/commit/1877171648e20595a82de34073b643f7e01a339f)
[#12873](https://github.com/npm/npm/issues/12873)
Ignore `.nyc_output`. This will help avoid an accidental publish or commit filled with
code coverage data.
([@TheAlphaNerd](https://github.com/TheAlphaNerd))
#### DOCUMENTATION CHANGES
* [`470ae86`](https://github.com/npm/npm/commit/470ae86e052ae2f29ebec15b7547230b6240042e)
[#12983](https://github.com/npm/npm/pull/12983)
Describe how to run the lifecycle scripts of dependencies. How you do
this changed with `npm` v2.
([@Tapppi](https://github.com/Tapppi))
* [`9cedf37`](https://github.com/npm/npm/commit/9cedf37e5a3e26d0ffd6351af8cac974e3e011c2)
[#12776](https://github.com/npm/npm/pull/12776)
Remove mention of `<pkg>` arg for `run-script`.
([@fibo](https://github.com/fibo))
* [`55b8424`](https://github.com/npm/npm/commit/55b8424d7229f2021cac55f0b03de72403e7c0ff)
[#12840](https://github.com/npm/npm/pull/12840)
Remove sexualized language from comment.
([@geek](https://github.com/geek))
* [`d6bf0c3`](https://github.com/npm/npm/commit/d6bf0c393788a6398bf80b41c57956f2dbcf3b39)
[#12802](https://github.com/npm/npm/pull/12802)
Small grammar fix in `doc/cli/npm.md`.
([@andresilveira](https://github.com/andresilveira))
#### DEPENDENCY UPDATES
* [`2c2c568`](https://github.com/npm/npm/commit/2c2c56857ff801d5fe1b6d3157870cd16e65891b)
`readable-stream@2.1.4`: Brought up to date with Node 6.1.0's streams implementation.
([@calvinmetcalf](https://github.com/calvinmetcalf))
* [`d682e64`](https://github.com/npm/npm/commit/d682e6445845b0a2584935d5e2942409c43f6916)
[npm/npm-user-validate#8](https://github.com/npm/npm-user-validate/pull/8)
`npm-user-validate@0.1.4`: Add a maximum length limit for usernames based on
the (arbitrary) limit imposed by the primary npm registry.
([@aredridel](https://github.com/aredridel))
* [`448b65b`](https://github.com/npm/npm/commit/448b65b48cda3b782b714057fb4b8311cc1fa36a)
`which@1.2.10`: Remove unused dependency `is-absolute`, bug fixes.
([@isaacs](https://github.com/isaacs))
* [`7d15434`](https://github.com/npm/npm/commit/7d15434f0b0af8e70b119835b21968217224664f)
`require-inject@1.4.0`: Add `requireInject.withEmptyCache` and
`requireInject.installGlobally.andClearCache` to support loading modules to be
injected with an empty cache.
([@iarna](https://github.com/iarna))
* [`31845c0`](https://github.com/npm/npm/commit/31845c081bc6f3f8a2f3d83a3c792dccffbaa2a8)
`init-package-json@1.9.4`:
Replace use of reserved identifier `package` in, uh, the package.
([@adius](https://github.com/adius))
* [`d73ef3e`](https://github.com/npm/npm/commit/d73ef3e6b18d4905de668c5115bc6042905a02d9)
`glob@7.0.4`: Use userland `fs.realpath` implementation to get glob working under Node 6.
([@isaacs](https://github.com/isaacs))
* [`b47da85`](https://github.com/npm/npm/commit/b47da85cf83b946f2c8d29ab612c92028f31f6b0)
`inflight@1.0.5`: Correct link to package repository, add `"files"` stanza.
([@iarna](https://github.com/iarna), [@jamestalmage](https://github.com/jamestalmage))
* [`04815e4`](https://github.com/npm/npm/commit/04815e436035de785279fd000cdbc821cc1f3447)
[npm/npmlog#32](https://github.com/npm/npmlog/pull/32)
`npmlog@2.0.4`: Add `"files"` stanza to `package.json`.
([@jamestalmage](https://github.com/jamestalmage))
* [`9e29ad2`](https://github.com/npm/npm/commit/9e29ad227300bb970e7bcd21029944d4733e40db)
`wrappy@1.0.2`: Add `"files"` stanza to `package.json`.
([@jamestalmage](https://github.com/jamestalmage))
* [`44af4d4`](https://github.com/npm/npm/commit/44af4d475ac65bdce6d088173273ce4a4f74a49e)
`abbrev@1.0.9` ([@jorrit](https://github.com/jorrit))
* [`6c977c0`](https://github.com/npm/npm/commit/6c977c0031d074479a26c7bec6ec83fd6c6526b2)
`npm-registry-client@7.1.2`: Add support for newer versions of `npmlog`.
([@iarna](https://github.com/iarna))
### v2.15.6 (2016-05-12):
I have a couple of doc fixes and a shrinkwrap fix for you all this week.
#### PEER DEPENDENCIES AND SHRINKWRAPS
* [`55c998a`](https://github.com/npm/npm/commit/55c998a098a306b90a84beef163a8890f9a616b1)
[#5135](https://github.com/npm/npm/issues/5135)
Fix a bug where peerDependencies & shrinkwraps didn't play nice together. (Where
the peerDependency resolver would end up installing its dep when it wasn't needed.)
([@majgis](https://github.com/majgis))
#### NPM AND `node-gyp` DOCS IMPROVEMENTS
* [`1826908`](https://github.com/npm/npm/commit/1826908b991510d8fbc71a0d0f2c01ff24fd83c2)
[#12636](https://github.com/npm/npm/pull/12636)
Improve `npm-scripts` documentation regarding when `node-gyp` is used.
([@reconbot](https://github.com/reconbot))
* [`f9ff7f3`](https://github.com/npm/npm/commit/f9ff7f36cc2c2c3fbb4f6eef91491b589d049d5f)
[#12586](https://github.com/npm/npm/pull/12586)
Correct `package.json` documentation as to when `node-gyp rebuild` called.
This now matches https://docs.npmjs.com/misc/scripts#default-values
([@reconbot](https://github.com/reconbot))
### v2.15.5 (2016-05-05):
This is a minor LTS release, bringing dependencies up to date and updating
our CI matrix to match what we support.
Some of the dependency updates come out of our getting the development
branch's tests passing on Windows and so bring in fixes for a few Windows
related corner cases.
#### CI UPDATES
* [`bb6f0e5`](https://github.com/npm/npm/commit/bb6f0e5c95d4ad186768b1c962dd4c399f90ddb1)
[#12487](https://github.com/npm/npm/pull/12487)
Remove iojs from CI, add Node.js 6, prioritize 4 over 5.
([@othiym23](https://github.com/othiym23))
#### DEPENDENCY UPDATES
* [`f2f8753`](https://github.com/npm/npm/commit/f2f8753c4aef2a604a4bdca2677711c940234b8f)
`which@1.2.8`:
Properly handle relative path executables.
([@isaacs](https://github.com/isaacs))
* [`e287ca9`](https://github.com/npm/npm/commit/e287ca99c37680d8e4cfacf4cfebe2da98884865)
`read-package-json@2.0.4`:
Fix Windows issue with ENOTDIR detection.
([@zkat](https://github.com/zkat))
* [`1a0ce6c`](https://github.com/npm/npm/commit/1a0ce6cff4c347bad035dc89bba2ceed9dacbf73)
`realize-package-specifier@3.0.3`:
Use npa with windows fix.
Fix relative path resolution when the local file might also be a tag.
([@zkat](https://github.com/zkat))
([@iarna](https://github.com/iarna))
* [`a475c9a`](https://github.com/npm/npm/commit/a475c9a4e4b36d00080b11f379657ce68185adc6)
`lru-cache@4.0.1`:
Use Symbol if available.
([@isaacs](https://github.com/isaacs))
* [`7141e08`](https://github.com/npm/npm/commit/7141e08816c620b1889d7537c30dc5b254de4d1f)
`sorted-object@2.0.0`
([@iamstarkov](https://github.com/iamstarkov))
* [`27c6190`](https://github.com/npm/npm/commit/27c6190216cc8a5a280f0efbabb3444581968d40)
`request@2.72.0`
([@simov](https://github.com/simov))
* [`ab90daf`](https://github.com/npm/npm/commit/ab90daf70ba51b51f722fb4cd74ac5267621c4b4)
`readable-stream@2.1.2`
([@calvinmetcalf](https://github.com/calvinmetcalf))
* [`b1715f8`](https://github.com/npm/npm/commit/b1715f805426403273225bcfa91d1a52d7b56eb8)
`graceful-fs@4.1.4`
([@isaacs](https://github.com/isaacs))
* [`ca97de6`](https://github.com/npm/npm/commit/ca97de6c18059ef420235f4706898ad8758904e6)
`block-stream@0.0.9`
([@isaacs](https://github.com/isaacs))
### v2.15.4 (2016-04-21):
Gosh, it's been a peaceful couple of weeks!
Overall, the CLI team has been focused on the project to [get the test suite
passing on Windows](https://github.com/npm/npm/pull/11444). Our efforts should
be paying off soon -- there's only a couple of tests left!
It's very unlikely those particular changes will make their way into our current
`npm@2` LTS release, I think, but it will help `npm@3` a lot, as well as
whatever version makes it into [`node@6`, which will eventually be the next
Node.js LTS](https://github.com/nodejs/node/pull/6155).
As far as this week goes, we've got a couple of dep updates and doc fixes.
Always happy to see community contributions flying in. 💚
#### DEP UPDATE MAGIC
* [`b178c4a`](https://github.com/npm/npm/commit/b178c4ac9ce91c0a0794526a38b553c759132d18)
`spdx-license-ids@1.2.1`:
Minor project-related tweaks -- no license changes.
([@shinnn](https://github.com/shinnn))
* [`1adf179`](https://github.com/npm/npm/commit/1adf179948ab8cb97dfb2f46a61e9f37d944c42a)
`normalize-git-url@3.0.2`:
Fixes `file://` URLs on Windows. Turns out stuff like `file://C:\hello` is
actually fairly weird for a URL (it's not actually a valid URL, but we're just
gonna pretend.😉)
([@zkat](https://github.com/zkat))
* [`9cfd56c`](https://github.com/npm/npm/commit/9cfd56cdadc040c0b2fa7654cdb5e7d22dbef7cb)
`fs-vacuum@1.2.9`:
This one goes out to our fans at Big Blue: There was an AIX-specific issue
where `fs.rmDir` was failing with `EEXIST` instead of `ENOTEMPTY` with
non-empty directories.
([@richardlau](https://github.com/richardlau))
#### HOORAY DOC CONTRIBUTIONS
No seriously, we love these. Keep 'em comin'!
* [`2afe8bf`](https://github.com/npm/npm/commit/2afe8bf415a159baa181a8102f72c96e1d189bc9)
[#12415](https://github.com/npm/npm/pull/12415)
Clarify that the `--cert` and `--key` options are actual certs and keys, not
paths to files containing them.
([@rvedotrc](https://github.com/rvedotrc))
* [`3522560`](https://github.com/npm/npm/commit/3522560b0a4bb6c9717a34f9728f156fd9760cad)
[#12107](https://github.com/npm/npm/pull/12107)
Document `npm login` as an alias to `npm adduser`. People are still surprised
by this so often.
([@gnerkus](https://github.com/gnerkus))
### v2.15.3 (2016-03-31):
Hiiiiiii!~👋
We're really happy to be getting more and more community contributions! Keep it
up! We really appreciate folks trying to help us, and we'll do our best to help
point you in the right direction. Even things like documentation are a huge
help. And remember -- you get socks for it, too!🎁
This week is as quiet as usual, aside from fixing a regression to `npm
deprecate` you might want to pay attention to! Other than that, just docs and
deps, as any good LTS release train should be. 🙆
#### FIXME
* [`6e0b66e`](https://github.com/npm/npm/commit/6e0b66e282aa27d1b5371e2babaa859924121730)
[#11884](https://github.com/npm/npm/pull/11884)
Include `node_modules` in the list of files and directories that npm won't
include in packages ordinarily. (Modules listed in `bundledDependencies` and
things that those modules rely on, ARE included of course.)
([@Jameskmonger](https://github.com/Jameskmonger))
* [`9896290`](https://github.com/npm/npm/commit/98962909b160364030705575202ad133971033c1)
[#12079](https://github.com/npm/npm/pull/12079)
Back in `npm@2.13.1` we included [a patch that made it so `npm install pkg`
was basically `npm install pkg@latest` instead of
`pkg@*`](https://github.com/npm/npm/pull/9170) This is probably what most
users expected, but it also ended up [breaking `npm
deprecate`](https://github.com/npm/npm/pull/9170) when no version was provided
for a package. In that case, we were using `*` to mean "deprecate all
versions" and relying on the `pkg` -> `pkg@*` conversion. This patch fixes
`npm deprecate pkg` to work as it used to by special casing that particular
command's behavior.
([@polm](https://github.com/polm))
* [`6c1628f`](https://github.com/npm/npm/commit/6c1628f62b657db6c116be13849d00933a3388cd)
[#12146](https://github.com/npm/npm/pull/12146)
Adds `make doc-clean` to `prepublish` script, to clear out previously built
docs before publishing a new npm version.
([@watilde](https://github.com/watilde))
* [`6d3017e`](https://github.com/npm/npm/commit/6d3017e6eed8a771b395d10130ac1f498e2d3211)
[#12146](https://github.com/npm/npm/pull/12146)
Adds `doc-clean` phony target to `make publish`.
([@watilde](https://github.com/watilde))
#### DOCS
* [`d43921c`](https://github.com/npm/npm/commit/d43921c546617cdb94bbee444d7d67ef55f38dc5)
[#12147](https://github.com/npm/npm/pull/12147)
Document that the current behavior of `engines` is just to warn if the node
platform is incompatible.
([@reconbot](https://github.com/reconbot))
* [`3cfe99e`](https://github.com/npm/npm/commit/3cfe99e3a757c5d8cbb1c2789410e9802563abac)
[#12093](https://github.com/npm/npm/pull/12093)
Update `bugs` url in `package.json` to use the `https` URL for Github.
([@watilde](https://github.com/watilde))
* [`ecf865f`](https://github.com/npm/npm/commit/ecf865f4eed1419c75442e0d52bc34ba1647de15)
[#12075](https://github.com/npm/npm/pull/12075)
Add the `--ignore-scripts` flag to the `npm install` docs.
([@paulirish](https://github.com/paulirish))
* [`f0e6db3`](https://github.com/npm/npm/commit/f0e6db32827d88680ef2320e60c0863754a4fbc5)
[#12063](https://github.com/npm/npm/pull/12063)
Various minor fixes to the html docs homepage.
([@watilde](https://github.com/watilde))
#### DEPS
* [`e2660de`](https://github.com/npm/npm/commit/e2660de1c08ed68a1c6fc4ee75d10376595979be)
`npmlog@2.0.3`
([@iarna](https://github.com/iarna))
### v2.15.2 (2016-03-24):
It's always nice to see new contributors. 💚

2
deps/npm/cli.js vendored
View File

@ -1,2 +0,0 @@
#!/usr/bin/env node
require('./bin/npm-cli.js')

View File

@ -3,7 +3,7 @@ npm-explore(1) -- Browse an installed package
## SYNOPSIS
npm explore <pkg> [ -- <cmd>]
npm explore <pkg> [ -- <command>]
## DESCRIPTION

View File

@ -78,6 +78,14 @@ and tag up to the server, and deletes the `build/temp` directory.
## CONFIGURATION
### allow-same-version
* Default: false
* Type: Boolean
Prevents throwing an error when `npm version` is used to set the new version
to the same value as the current version.
### git-tag-version
* Default: true

View File

@ -144,7 +144,7 @@ Those styles are now deprecated. Instead, use SPDX expressions, like this:
Finally, if you do not wish to grant others the right to use a private or
unpublished package under any terms:
{ "license": "UNLICENSED"}
{ "license": "UNLICENSED" }
Consider also setting `"private": true` to prevent accidental publication.

View File

@ -121,6 +121,14 @@ you want your scoped package to be publicly viewable (and installable) set
`--access=public`. The only valid values for `access` are `public` and
`restricted`. Unscoped packages _always_ have an access level of `public`.
### allow-same-version
* Default: false
* Type: Boolean
Prevents throwing an error when `npm version` is used to set the new version
to the same value as the current version.
### always-auth
* Default: false
@ -226,22 +234,18 @@ Number of ms to wait for cache lock files to expire.
* Default: Infinity
* Type: Number
The maximum time (in seconds) to keep items in the registry cache before
re-checking against the registry.
**DEPRECATED**: This option has been deprecated in favor of `--prefer-online`.
Note that no purging is done unless the `npm cache clean` command is
explicitly used, and that only GET requests use the cache.
`--cache-max=0` is an alias for `--prefer-online`.
### cache-min
* Default: 10
* Type: Number
The minimum time (in seconds) to keep items in the registry cache before
re-checking against the registry.
**DEPRECATED**: This option has been deprecated in favor of `--prefer-offline`.
Note that no purging is done unless the `npm cache clean` command is
explicitly used, and that only GET requests use the cache.
`--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`.
### cert
@ -446,6 +450,13 @@ option can be used when it's desirable to optionally run a script when it's
present and fail if the script fails. This is useful, for example, when running
scripts that may only apply for some builds in an otherwise generic CI setup.
### ignore-prepublish
* Default: false
* Type: Boolean
If true, npm will not run `prepublish` scripts.
### ignore-scripts
* Default: false
@ -628,6 +639,14 @@ The registry you want to send cli metrics to if `send-metrics` is true.
The node version to use when checking a package's `engines` map.
### offline
* Default: false
* Type: Boolean
Force offline mode: no network requests will be done during install. To allow
the CLI to fill in missing cache data, see `--prefer-offline`.
### onload-script
* Default: false
@ -671,6 +690,24 @@ process is not aborted.
Output parseable results from commands that write to
standard output. For `npm search`, this will be tab-separated table format.
### prefer-offline
* Default: false
* Type: Boolean
If true, staleness checks for cached data will be bypassed, but missing data
will be requested from the server. To force full offline mode, use `--offline`.
This option is effectively equivalent to `--cache-min=9999999`.
### prefer-online
* Default: false
* Type: Boolean
If true, staleness checks for cached data will be forced, making the CLI look
for updates immediately even for fresh package data.
### prefix
* Default: see npm-folders(5)
@ -960,6 +997,17 @@ Because other tools may rely on the convention that npm version tags look like
`v1.0.0`, _only use this property if it is absolutely necessary_. In
particular, use care when overriding this setting for public packages.
### timing
* Default: `false`
* Type: Boolean
If true, writes an `npm-debug` log to `_logs` and timing information to
`_timing.json`, both in your cache. `_timing.json` is a newline delimited
list of JSON objects. You can quickly view it with this
[json](https://www.npmjs.com/package/json) command line:
`json -g < ~/.npm/_timing.json`.
### tmp
* Default: TMPDIR environment variable, or "/tmp"

154
deps/npm/doc/spec/file-specifiers.md vendored Normal file
View File

@ -0,0 +1,154 @@
# `file:` specifiers
`specifier` refers to the value part of the `package.json`'s `dependencies`
object. This is a semver expression for registry dependencies and
URLs and URL-like strings for other types.
### Dependency Specifiers
* A `file:` specifier is either an absolute path (eg `/path/to/thing`, `d:\path\to\thing`):
* An absolute `file:///absolute/path` with any number of leading slashes
being treated as a single slash. That is, `file:/foo/bar` and
`file:///foo/bar` reference the same package.
* … or a relative path (eg `../path/to/thing`, `path\to\subdir`). Leading
slashes on a file specifier will be removed, that is 'file://../foo/bar`
references the same package as same as `file:../foo/bar`. The latter is
considered canonical.
* Attempting to install a specifer that has a windows drive letter will
produce an error on non-Windows systems.
* A valid `file:` specifier points is:
* a valid package file. That is, a `.tar`, `.tar.gz` or `.tgz` containing
`<dir>/package.json`.
* OR, a directory that contains a `package.json`
Relative specifiers are relative to the file they were found in, or, if
provided on the command line, the CWD that the command was run from.
An absolute specifier found in a `package.json` or `npm-shrinkwrap.json` is
probably an error as it's unlikely to be portable between computers and
should warn.
A specifier provided as a command line argument that is on a different drive
is an error. That is, `npm install file:d:/foo/bar` is an error if the
current drive is `c`. The point of this rule is that if we can't produce a
relative path then it's an error.
### Specifier Disambiguation
On the command line, plain paths are allowed. These paths can be ambiguous
as they could be a path, a plain package name or a github shortcut. This
ambiguity is resolved by checking to see if either a directory exists that
contains a `package.json`. If either is the case then the specifier is a
file specifier, otherwise it's a registry or github specifier.
### Specifier Matching
A specifier is considered to match a dependency on disk when the `realpath`
of the fully resolved specifier matches the `realpath` of the package on disk.
### Saving File Specifiers
When saving to both `package.json` and `npm-shrinkwrap.json` they will be
saved using the `file:../relative/path` form, and the relative path will be
relative to the project's root folder. This is particularly important to
note for the `npm-shrinkwrap.json` as it means the specifier there will
be different then the original `package.json` (where it was relative to that
`package.json`).
# No, for `file:` type specifiers, we SHOULD shrinkwrap. Other symlinks we
# should not. Other symlinks w/o the link spec should be an error.
When shrinkwrapping file specifiers, the contents of the destination
package's `node_modules` WILL NOT be included in the shrinkwrap. If you want to lock
down the destination package's `node_modules` you should create a shrinkwrap for it
separately.
This is necessary to support the mono repo use case where many projects file
to the same package. If each project included its own npm-shrinkwrap.json
then they would each have their own distinct set of transitive dependencies
and they'd step on each other any time you ran an install in one or the other.
NOTE: This should not have an effect on shrinkwrapping of other sorts of
shrinkwrapped packages.
### Installation
#### File type specifiers pointing at tarballs
File-type specifiers pointing at a `.tgz` or `.tar.gz or `.tar` file will
install it as a package file in the same way we would a remote tarball. The
checksum of the package file should be recorded so that we can check for updates.
#### File type specifers pointing at directories
File-type specifiers that point at directories will necessarily not do
anything for `fetch` and `extract` phases.
The symlink should be created during the `finalize` phase.
The `preinstall` for file-type specifiers MUST be run AFTER the
`finalize` phase as the symlink may be a relative path reaching outside the
current project root and a symlink that resolves in `.staging` won't resolve
in the package's final resting place.
If the module is inside the package root that we're running the install for then
dependencies of the linked package will be hoisted to the top level as usual.
If the module is outside the package root then dependencies will be installed inside
the linked module's `node_modules` folder.
### Removal
Removal should remove the symlink.
Removal MUST NOT remove the transitive dependencies IF they're installed in
the linked module's `node_modules` folder.
### Listing
In listings they should not include a version as the version is not
something `npm` is concerned about. This also makes them easily
distinguishable from symlinks of packages that have other dependency
specifiers.
If you had run:
```
npm install --save file:../a
```
And then run:
```
npm ls
```
You would see:
```
example-package@1.0.0 /path/to/example-package
└── a → file:../a
```
```
example-package@1.0.0 /path/to/example-package
+-- a -> file:../a
```
Of note here: No version is included as the relavent detail is WHERE the
package came from, not what version happened to be in that path.
### Outdated
Local specifiers should only show up in `npm outdated` if they're missing
and when they do, they should be reported as:
```
Package Current Wanted Latest Location
a MISSING LOCAL LOCAL example-package
```
### Updating
If a dependency with a local specifier is already installed then `npm
update` shouldn't do anything. If one is missing then it should be
installed as if you ran `npm install`.

View File

@ -54,7 +54,7 @@ paths, etc.) then read on.</p>
If you plan on hacking on npm, <code>make link</code> is your friend.</p>
<p>If you&#39;ve got the npm source code, you can also semi-permanently set
arbitrary config keys using the <code>./configure --key=val ...</code>, and then
run npm commands by doing <code>node cli.js &lt;cmd&gt; &lt;args&gt;</code>. (This is helpful
run npm commands by doing <code>node bin/npm-cli.js &lt;command&gt; &lt;args&gt;</code>. (This is helpful
for testing, or running stuff without actually installing npm itself.)</p>
<h2 id="windows-install-or-upgrade">Windows Install or Upgrade</h2>
<p>Many improvements for Windows users have been made in npm 3 - you will have a better
@ -126,5 +126,5 @@ will no doubt tell you to put the output in a gist or email.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@4.5.0</p>
<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@5.0.0-beta.56</p>

View File

@ -84,5 +84,5 @@ with an HTTP 402 status code (logically enough), unless you use
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-access &mdash; npm@4.5.0</p>
<p id="footer">npm-access &mdash; npm@5.0.0-beta.56</p>

View File

@ -81,5 +81,5 @@ username/password entry in legacy npm.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-adduser &mdash; npm@4.5.0</p>
<p id="footer">npm-adduser &mdash; npm@5.0.0-beta.56</p>

View File

@ -35,5 +35,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-bin &mdash; npm@4.5.0</p>
<p id="footer">npm-bin &mdash; npm@5.0.0-beta.56</p>

View File

@ -55,5 +55,5 @@ a <code>package.json</code> in the current folder and use the <code>name</code>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-bugs &mdash; npm@4.5.0</p>
<p id="footer">npm-bugs &mdash; npm@5.0.0-beta.56</p>

View File

@ -40,5 +40,5 @@ directly, run:</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-build &mdash; npm@4.5.0</p>
<p id="footer">npm-build &mdash; npm@5.0.0-beta.56</p>

View File

@ -31,5 +31,5 @@ install packages into the local space.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-bundle &mdash; npm@4.5.0</p>
<p id="footer">npm-bundle &mdash; npm@5.0.0-beta.56</p>

View File

@ -82,5 +82,5 @@ they do not make an HTTP request to the registry.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-cache &mdash; npm@4.5.0</p>
<p id="footer">npm-cache &mdash; npm@5.0.0-beta.56</p>

View File

@ -43,5 +43,5 @@ completions based on the arguments.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-completion &mdash; npm@4.5.0</p>
<p id="footer">npm-completion &mdash; npm@5.0.0-beta.56</p>

View File

@ -67,5 +67,5 @@ global config.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-config &mdash; npm@4.5.0</p>
<p id="footer">npm-config &mdash; npm@5.0.0-beta.56</p>

View File

@ -61,5 +61,5 @@ result in new modules being installed.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-dedupe &mdash; npm@4.5.0</p>
<p id="footer">npm-dedupe &mdash; npm@5.0.0-beta.56</p>

View File

@ -38,5 +38,5 @@ something like this:</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-deprecate &mdash; npm@4.5.0</p>
<p id="footer">npm-deprecate &mdash; npm@5.0.0-beta.56</p>

View File

@ -86,5 +86,5 @@ begin with a number or the letter <code>v</code>.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-dist-tag &mdash; npm@4.5.0</p>
<p id="footer">npm-dist-tag &mdash; npm@5.0.0-beta.56</p>

View File

@ -56,5 +56,5 @@ the current folder and use the <code>name</code> property.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-docs &mdash; npm@4.5.0</p>
<p id="footer">npm-docs &mdash; npm@5.0.0-beta.56</p>

View File

@ -103,4 +103,4 @@ cache, you should probably run <code>npm cache clean</code> and reset the cache.
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-doctor &mdash; npm@4.5.0</p>
<p id="footer">npm-doctor &mdash; npm@5.0.0-beta.56</p>

View File

@ -49,5 +49,5 @@ or <code>&quot;notepad&quot;</code> on Windows.</li>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-edit &mdash; npm@4.5.0</p>
<p id="footer">npm-edit &mdash; npm@5.0.0-beta.56</p>

View File

@ -11,7 +11,7 @@
<h1><a href="../cli/npm-explore.html">npm-explore</a></h1> <p>Browse an installed package</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm explore &lt;pkg&gt; [ -- &lt;cmd&gt;]
<pre><code>npm explore &lt;pkg&gt; [ -- &lt;command&gt;]
</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Spawn a subshell in the directory of the installed package specified.</p>
<p>If a command is specified, then it is run in the subshell, which then
@ -49,5 +49,5 @@ Windows</li>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-explore &mdash; npm@4.5.0</p>
<p id="footer">npm-explore &mdash; npm@5.0.0-beta.56</p>

View File

@ -45,5 +45,5 @@ where the terms were found in the documentation.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-help-search &mdash; npm@4.5.0</p>
<p id="footer">npm-help-search &mdash; npm@5.0.0-beta.56</p>

View File

@ -50,5 +50,5 @@ matches are equivalent to specifying a topic name.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-help &mdash; npm@4.5.0</p>
<p id="footer">npm-help &mdash; npm@5.0.0-beta.56</p>

View File

@ -48,5 +48,5 @@ defaults and not prompt you for any options.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-init &mdash; npm@4.5.0</p>
<p id="footer">npm-init &mdash; npm@5.0.0-beta.56</p>

View File

@ -42,5 +42,5 @@ takes exactly the same arguments as <code>npm install</code>.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-install-test &mdash; npm@4.5.0</p>
<p id="footer">npm-install-test &mdash; npm@5.0.0-beta.56</p>

View File

@ -316,5 +316,5 @@ affects a real use-case, it will be investigated.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-install &mdash; npm@4.5.0</p>
<p id="footer">npm-install &mdash; npm@5.0.0-beta.56</p>

View File

@ -74,5 +74,5 @@ include that scope, e.g.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-link &mdash; npm@4.5.0</p>
<p id="footer">npm-link &mdash; npm@5.0.0-beta.56</p>

View File

@ -51,5 +51,5 @@ it takes precedence.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-logout &mdash; npm@4.5.0</p>
<p id="footer">npm-logout &mdash; npm@5.0.0-beta.56</p>

View File

@ -21,7 +21,7 @@ installed, as well as their dependencies, in a tree-structure.</p>
limit the results to only the paths to the packages named. Note that
nested packages will <em>also</em> show the paths to the specified packages.
For example, running <code>npm ls promzard</code> in npm&#39;s source tree will show:</p>
<pre><code>npm@4.5.0 /path/to/npm
<pre><code>npm@5.0.0-beta.56 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre><p>It will print out extraneous, missing, and invalid packages.</p>
@ -104,5 +104,5 @@ project.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-ls &mdash; npm@4.5.0</p>
<p id="footer">npm-ls &mdash; npm@5.0.0-beta.56</p>

View File

@ -116,5 +116,5 @@ project.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-outdated &mdash; npm@4.5.0</p>
<p id="footer">npm-outdated &mdash; npm@5.0.0-beta.56</p>

View File

@ -51,5 +51,5 @@ that is not implemented at this time.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-owner &mdash; npm@4.5.0</p>
<p id="footer">npm-owner &mdash; npm@5.0.0-beta.56</p>

View File

@ -41,5 +41,5 @@ overwritten the second time.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-pack &mdash; npm@4.5.0</p>
<p id="footer">npm-pack &mdash; npm@5.0.0-beta.56</p>

View File

@ -32,5 +32,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-ping &mdash; npm@4.5.0</p>
<p id="footer">npm-ping &mdash; npm@5.0.0-beta.56</p>

View File

@ -38,5 +38,5 @@ to contain a package.json file unless <code>-g</code> is also specified.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-prefix &mdash; npm@4.5.0</p>
<p id="footer">npm-prefix &mdash; npm@5.0.0-beta.56</p>

View File

@ -40,5 +40,5 @@ negate <code>NODE_ENV</code> being set to <code>production</code>.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-prune &mdash; npm@4.5.0</p>
<p id="footer">npm-prune &mdash; npm@5.0.0-beta.56</p>

View File

@ -76,5 +76,5 @@ packs them into a tarball to be uploaded to the registry.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-publish &mdash; npm@4.5.0</p>
<p id="footer">npm-publish &mdash; npm@5.0.0-beta.56</p>

View File

@ -35,5 +35,5 @@ the new binary.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-rebuild &mdash; npm@4.5.0</p>
<p id="footer">npm-rebuild &mdash; npm@5.0.0-beta.56</p>

View File

@ -41,5 +41,5 @@ a <code>package.json</code> in the current folder and use the <code>name</code>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-repo &mdash; npm@4.5.0</p>
<p id="footer">npm-repo &mdash; npm@5.0.0-beta.56</p>

View File

@ -53,5 +53,5 @@ behavior will be accompanied by an increase in major version number</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-restart &mdash; npm@4.5.0</p>
<p id="footer">npm-restart &mdash; npm@5.0.0-beta.56</p>

View File

@ -35,5 +35,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-root &mdash; npm@4.5.0</p>
<p id="footer">npm-root &mdash; npm@5.0.0-beta.56</p>

View File

@ -66,5 +66,5 @@ you will be given a warning to run <code>npm install</code>, just in case you&#3
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-run-script &mdash; npm@4.5.0</p>
<p id="footer">npm-run-script &mdash; npm@5.0.0-beta.56</p>

View File

@ -109,5 +109,5 @@ setting.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-search &mdash; npm@4.5.0</p>
<p id="footer">npm-search &mdash; npm@5.0.0-beta.56</p>

View File

@ -180,5 +180,5 @@ contents rather than versions.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-shrinkwrap &mdash; npm@4.5.0</p>
<p id="footer">npm-shrinkwrap &mdash; npm@5.0.0-beta.56</p>

View File

@ -36,5 +36,5 @@ a vaguely positive way to show that you care.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-star &mdash; npm@4.5.0</p>
<p id="footer">npm-star &mdash; npm@5.0.0-beta.56</p>

View File

@ -36,5 +36,5 @@ you will most certainly enjoy this command.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-stars &mdash; npm@4.5.0</p>
<p id="footer">npm-stars &mdash; npm@5.0.0-beta.56</p>

View File

@ -39,5 +39,5 @@ more details.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-start &mdash; npm@4.5.0</p>
<p id="footer">npm-start &mdash; npm@5.0.0-beta.56</p>

View File

@ -34,5 +34,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-stop &mdash; npm@4.5.0</p>
<p id="footer">npm-stop &mdash; npm@5.0.0-beta.56</p>

View File

@ -67,5 +67,5 @@ use the <code>npm access</code> command to grant or revoke the appropriate permi
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-team &mdash; npm@4.5.0</p>
<p id="footer">npm-team &mdash; npm@5.0.0-beta.56</p>

View File

@ -36,5 +36,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-test &mdash; npm@4.5.0</p>
<p id="footer">npm-test &mdash; npm@5.0.0-beta.56</p>

View File

@ -60,5 +60,5 @@ npm uninstall dtrace-provider --save-optional
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-uninstall &mdash; npm@4.5.0</p>
<p id="footer">npm-uninstall &mdash; npm@5.0.0-beta.56</p>

View File

@ -51,5 +51,5 @@ contact support@npmjs.com.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-unpublish &mdash; npm@4.5.0</p>
<p id="footer">npm-unpublish &mdash; npm@5.0.0-beta.56</p>

View File

@ -118,5 +118,5 @@ be <em>downgraded</em>.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-update &mdash; npm@4.5.0</p>
<p id="footer">npm-update &mdash; npm@5.0.0-beta.56</p>

View File

@ -73,6 +73,13 @@ the commit and/or tag.</li>
adds everything in the <code>dist</code> directory to the commit. After the commit, it pushes the new commit
and tag up to the server, and deletes the <code>build/temp</code> directory.</p>
<h2 id="configuration">CONFIGURATION</h2>
<h3 id="allow-same-version">allow-same-version</h3>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>Prevents throwing an error when <code>npm version</code> is used to set the new version
to the same value as the current version.</p>
<h3 id="git-tag-version">git-tag-version</h3>
<ul>
<li>Default: true</li>
@ -107,5 +114,5 @@ and tag up to the server, and deletes the <code>build/temp</code> directory.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-version &mdash; npm@4.5.0</p>
<p id="footer">npm-version &mdash; npm@5.0.0-beta.56</p>

View File

@ -86,5 +86,5 @@ the field name.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-view &mdash; npm@4.5.0</p>
<p id="footer">npm-view &mdash; npm@5.0.0-beta.56</p>

View File

@ -33,5 +33,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-whoami &mdash; npm@4.5.0</p>
<p id="footer">npm-whoami &mdash; npm@5.0.0-beta.56</p>

View File

@ -13,7 +13,7 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm &lt;command&gt; [args]
</code></pre><h2 id="version">VERSION</h2>
<p>4.5.0</p>
<p>5.0.0-beta.56</p>
<h2 id="description">DESCRIPTION</h2>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
@ -126,7 +126,7 @@ will no doubt tell you to put the output in a gist or email.</p>
<p><a href="http://blog.izs.me/">Isaac Z. Schlueter</a> ::
<a href="https://github.com/isaacs/">isaacs</a> ::
<a href="http://twitter.com/izs">@izs</a> ::
<a href="&#109;&#x61;&#105;&#x6c;&#x74;&#x6f;&#58;&#105;&#x40;&#105;&#x7a;&#x73;&#x2e;&#x6d;&#x65;">&#105;&#x40;&#105;&#x7a;&#x73;&#x2e;&#x6d;&#x65;</a></p>
<a href="&#x6d;&#x61;&#105;&#108;&#116;&#111;&#x3a;&#x69;&#64;&#105;&#x7a;&#115;&#46;&#109;&#101;">&#x69;&#64;&#105;&#x7a;&#115;&#46;&#109;&#101;</a></p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-help.html">npm-help(1)</a></li>
@ -150,5 +150,5 @@ will no doubt tell you to put the output in a gist or email.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm &mdash; npm@4.5.0</p>
<p id="footer">npm &mdash; npm@5.0.0-beta.56</p>

View File

@ -182,5 +182,5 @@ cannot be found elsewhere. See <code><a href="../files/package.json.html">packa
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-folders &mdash; npm@4.5.0</p>
<p id="footer">npm-folders &mdash; npm@5.0.0-beta.56</p>

View File

@ -182,5 +182,5 @@ cannot be found elsewhere. See <code><a href="../files/package.json.html">packa
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-folders &mdash; npm@4.5.0</p>
<p id="footer">npm-folders &mdash; npm@5.0.0-beta.56</p>

View File

@ -115,7 +115,7 @@ array of license objects:</p>
{ &quot;license&quot;: &quot;(MIT OR Apache-2.0)&quot; }
</code></pre><p>Finally, if you do not wish to grant others the right to use a private or
unpublished package under any terms:</p>
<pre><code>{ &quot;license&quot;: &quot;UNLICENSED&quot;}
<pre><code>{ &quot;license&quot;: &quot;UNLICENSED&quot; }
</code></pre><p>Consider also setting <code>&quot;private&quot;: true</code> to prevent accidental publication.</p>
<h2 id="people-fields-author-contributors">people fields: author, contributors</h2>
<p>The &quot;author&quot; is one person. &quot;contributors&quot; is an array of people. A &quot;person&quot;
@ -586,5 +586,5 @@ ignored.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">package.json &mdash; npm@4.5.0</p>
<p id="footer">package.json &mdash; npm@5.0.0-beta.56</p>

View File

@ -85,5 +85,5 @@ manner.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npmrc &mdash; npm@4.5.0</p>
<p id="footer">npmrc &mdash; npm@5.0.0-beta.56</p>

View File

@ -115,7 +115,7 @@ array of license objects:</p>
{ &quot;license&quot;: &quot;(MIT OR Apache-2.0)&quot; }
</code></pre><p>Finally, if you do not wish to grant others the right to use a private or
unpublished package under any terms:</p>
<pre><code>{ &quot;license&quot;: &quot;UNLICENSED&quot;}
<pre><code>{ &quot;license&quot;: &quot;UNLICENSED&quot; }
</code></pre><p>Consider also setting <code>&quot;private&quot;: true</code> to prevent accidental publication.</p>
<h2 id="people-fields-author-contributors">people fields: author, contributors</h2>
<p>The &quot;author&quot; is one person. &quot;contributors&quot; is an array of people. A &quot;person&quot;
@ -586,5 +586,5 @@ ignored.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">package.json &mdash; npm@4.5.0</p>
<p id="footer">package.json &mdash; npm@5.0.0-beta.56</p>

View File

@ -162,5 +162,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-index &mdash; npm@4.5.0</p>
<p id="footer">npm-index &mdash; npm@5.0.0-beta.56</p>

View File

@ -153,5 +153,5 @@ set to anything.&quot;</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-coding-style &mdash; npm@4.5.0</p>
<p id="footer">npm-coding-style &mdash; npm@5.0.0-beta.56</p>

View File

@ -105,6 +105,13 @@ this:</p>
you want your scoped package to be publicly viewable (and installable) set
<code>--access=public</code>. The only valid values for <code>access</code> are <code>public</code> and
<code>restricted</code>. Unscoped packages <em>always</em> have an access level of <code>public</code>.</p>
<h3 id="allow-same-version">allow-same-version</h3>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>Prevents throwing an error when <code>npm version</code> is used to set the new version
to the same value as the current version.</p>
<h3 id="always-auth">always-auth</h3>
<ul>
<li>Default: false</li>
@ -193,19 +200,15 @@ well as for the CA information to be stored in a file on disk.</p>
<li>Default: Infinity</li>
<li>Type: Number</li>
</ul>
<p>The maximum time (in seconds) to keep items in the registry cache before
re-checking against the registry.</p>
<p>Note that no purging is done unless the <code>npm cache clean</code> command is
explicitly used, and that only GET requests use the cache.</p>
<p><strong>DEPRECATED</strong>: This option has been deprecated in favor of <code>--prefer-online</code>.</p>
<p><code>--cache-max=0</code> is an alias for <code>--prefer-online</code>.</p>
<h3 id="cache-min">cache-min</h3>
<ul>
<li>Default: 10</li>
<li>Type: Number</li>
</ul>
<p>The minimum time (in seconds) to keep items in the registry cache before
re-checking against the registry.</p>
<p>Note that no purging is done unless the <code>npm cache clean</code> command is
explicitly used, and that only GET requests use the cache.</p>
<p><strong>DEPRECATED</strong>: This option has been deprecated in favor of <code>--prefer-offline</code>.</p>
<p><code>--cache-min=9999 (or bigger)</code> is an alias for <code>--prefer-offline</code>.</p>
<h3 id="cert">cert</h3>
<ul>
<li>Default: <code>null</code></li>
@ -386,6 +389,12 @@ a script that isn&#39;t defined in the <code>scripts</code> section of <code>pac
option can be used when it&#39;s desirable to optionally run a script when it&#39;s
present and fail if the script fails. This is useful, for example, when running
scripts that may only apply for some builds in an otherwise generic CI setup.</p>
<h3 id="ignore-prepublish">ignore-prepublish</h3>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>If true, npm will not run <code>prepublish</code> scripts.</p>
<h3 id="ignore-scripts">ignore-scripts</h3>
<ul>
<li>Default: false</li>
@ -541,6 +550,13 @@ combination). Passed to the <code>http</code> <code>Agent</code> used to make th
<li>Type: semver or false</li>
</ul>
<p>The node version to use when checking a package&#39;s <code>engines</code> map.</p>
<h3 id="offline">offline</h3>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>Force offline mode: no network requests will be done during install. To allow
the CLI to fill in missing cache data, see <code>--prefer-offline</code>.</p>
<h3 id="onload-script">onload-script</h3>
<ul>
<li>Default: false</li>
@ -577,6 +593,21 @@ process is not aborted.</p>
</ul>
<p>Output parseable results from commands that write to
standard output. For <code>npm search</code>, this will be tab-separated table format.</p>
<h3 id="prefer-offline">prefer-offline</h3>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>If true, staleness checks for cached data will be bypassed, but missing data
will be requested from the server. To force full offline mode, use <code>--offline</code>.</p>
<p>This option is effectively equivalent to <code>--cache-min=9999999</code>.</p>
<h3 id="prefer-online">prefer-online</h3>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>If true, staleness checks for cached data will be forced, making the CLI look
for updates immediately even for fresh package data.</p>
<h3 id="prefix">prefix</h3>
<ul>
<li>Default: see <a href="../files/npm-folders.html">npm-folders(5)</a></li>
@ -821,6 +852,16 @@ to the empty string: <code>&quot;&quot;</code>.</p>
<p>Because other tools may rely on the convention that npm version tags look like
<code>v1.0.0</code>, <em>only use this property if it is absolutely necessary</em>. In
particular, use care when overriding this setting for public packages.</p>
<h3 id="timing">timing</h3>
<ul>
<li>Default: <code>false</code></li>
<li>Type: Boolean</li>
</ul>
<p>If true, writes an <code>npm-debug</code> log to <code>_logs</code> and timing information to
<code>_timing.json</code>, both in your cache. <code>_timing.json</code> is a newline delimited
list of JSON objects. You can quickly view it with this
<a href="https://www.npmjs.com/package/json">json</a> command line:
<code>json -g &lt; ~/.npm/_timing.json</code>.</p>
<h3 id="tmp">tmp</h3>
<ul>
<li>Default: TMPDIR environment variable, or &quot;/tmp&quot;</li>
@ -920,5 +961,5 @@ exit successfully.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-config &mdash; npm@4.5.0</p>
<p id="footer">npm-config &mdash; npm@5.0.0-beta.56</p>

View File

@ -194,5 +194,5 @@ from a fresh checkout.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-developers &mdash; npm@4.5.0</p>
<p id="footer">npm-developers &mdash; npm@5.0.0-beta.56</p>

View File

@ -20,7 +20,7 @@ Conduct.</p>
<h2 id="tl-dr">TL;DR</h2>
<ol>
<li>Get the author email with <code>npm owner ls &lt;pkgname&gt;</code></li>
<li>Email the author, CC <a href="&#109;&#97;&#105;&#108;&#x74;&#x6f;&#x3a;&#115;&#x75;&#x70;&#112;&#111;&#x72;&#x74;&#64;&#110;&#112;&#109;&#x6a;&#x73;&#x2e;&#99;&#x6f;&#x6d;">&#115;&#x75;&#x70;&#112;&#111;&#x72;&#x74;&#64;&#110;&#112;&#109;&#x6a;&#x73;&#x2e;&#99;&#x6f;&#x6d;</a></li>
<li>Email the author, CC <a href="&#x6d;&#97;&#105;&#108;&#x74;&#111;&#58;&#115;&#x75;&#x70;&#x70;&#x6f;&#x72;&#x74;&#64;&#x6e;&#112;&#109;&#106;&#x73;&#46;&#99;&#111;&#x6d;">&#115;&#x75;&#x70;&#x70;&#x6f;&#x72;&#x74;&#64;&#x6e;&#112;&#109;&#106;&#x73;&#46;&#99;&#111;&#x6d;</a></li>
<li>After a few weeks, if there&#39;s no resolution, we&#39;ll sort it out.</li>
</ol>
<p>Don&#39;t squat on package names. Publish code or move out of the way.</p>
@ -55,12 +55,12 @@ because Yusuf&#39;s <code>foo</code> is in the way.</p>
</li>
<li>Alice emails Yusuf, explaining the situation <strong>as respectfully as possible</strong>,
and what she would like to do with the module name. She adds the npm support
staff <a href="&#109;&#x61;&#x69;&#x6c;&#116;&#111;&#x3a;&#x73;&#x75;&#112;&#112;&#x6f;&#114;&#116;&#64;&#110;&#112;&#109;&#x6a;&#115;&#x2e;&#x63;&#x6f;&#109;">&#x73;&#x75;&#112;&#112;&#x6f;&#114;&#116;&#64;&#110;&#112;&#109;&#x6a;&#115;&#x2e;&#x63;&#x6f;&#109;</a> to the CC list of the email. Mention in the email
staff <a href="&#109;&#x61;&#105;&#x6c;&#x74;&#x6f;&#x3a;&#115;&#117;&#112;&#112;&#111;&#x72;&#x74;&#64;&#110;&#x70;&#109;&#106;&#115;&#46;&#x63;&#x6f;&#109;">&#115;&#117;&#112;&#112;&#111;&#x72;&#x74;&#64;&#110;&#x70;&#109;&#106;&#115;&#46;&#x63;&#x6f;&#109;</a> to the CC list of the email. Mention in the email
that Yusuf can run npm owner <code>add alice foo</code> to add Alice as an owner of the
foo package.</li>
<li>After a reasonable amount of time, if Yusuf has not responded, or if Yusuf
and Alice can&#39;t come to any sort of resolution, email support
<a href="&#109;&#97;&#105;&#x6c;&#x74;&#111;&#58;&#115;&#x75;&#112;&#x70;&#111;&#x72;&#x74;&#x40;&#110;&#x70;&#109;&#x6a;&#115;&#46;&#99;&#x6f;&#109;">&#115;&#x75;&#112;&#x70;&#111;&#x72;&#x74;&#x40;&#110;&#x70;&#109;&#x6a;&#115;&#46;&#99;&#x6f;&#109;</a> and we&#39;ll sort it out. (&quot;Reasonable&quot; is usually at least
<a href="&#x6d;&#97;&#105;&#x6c;&#x74;&#x6f;&#58;&#x73;&#117;&#112;&#112;&#x6f;&#114;&#116;&#x40;&#x6e;&#112;&#109;&#106;&#x73;&#46;&#x63;&#x6f;&#x6d;">&#x73;&#117;&#112;&#112;&#x6f;&#114;&#116;&#x40;&#x6e;&#112;&#109;&#106;&#x73;&#46;&#x63;&#x6f;&#x6d;</a> and we&#39;ll sort it out. (&quot;Reasonable&quot; is usually at least
4 weeks.)</li>
</ol>
<h2 id="reasoning">REASONING</h2>
@ -96,12 +96,12 @@ application database or otherwise putting non-packagey things into it.</li>
<a href="https://www.npmjs.com/policies/conduct">Code of Conduct</a> such as hateful
language, pornographic content, or harassment.</li>
</ol>
<p>If you see bad behavior like this, please report it to <a href="&#x6d;&#x61;&#105;&#x6c;&#x74;&#111;&#x3a;&#x61;&#98;&#117;&#115;&#x65;&#64;&#x6e;&#112;&#x6d;&#106;&#115;&#46;&#99;&#111;&#x6d;">&#x61;&#98;&#117;&#115;&#x65;&#64;&#x6e;&#112;&#x6d;&#106;&#115;&#46;&#99;&#111;&#x6d;</a> right
<p>If you see bad behavior like this, please report it to <a href="&#109;&#97;&#x69;&#x6c;&#x74;&#111;&#x3a;&#x61;&#98;&#x75;&#x73;&#x65;&#64;&#x6e;&#x70;&#x6d;&#106;&#115;&#46;&#x63;&#111;&#109;">&#x61;&#98;&#x75;&#x73;&#x65;&#64;&#x6e;&#x70;&#x6d;&#106;&#115;&#46;&#x63;&#111;&#109;</a> right
away. <strong>You are never expected to resolve abusive behavior on your own. We are
here to help.</strong></p>
<h2 id="trademarks">TRADEMARKS</h2>
<p>If you think another npm publisher is infringing your trademark, such as by
using a confusingly similar package name, email <a href="&#109;&#97;&#105;&#108;&#x74;&#111;&#58;&#97;&#98;&#117;&#115;&#101;&#64;&#110;&#x70;&#x6d;&#x6a;&#x73;&#46;&#x63;&#x6f;&#x6d;">&#97;&#98;&#117;&#115;&#101;&#64;&#110;&#x70;&#x6d;&#x6a;&#x73;&#46;&#x63;&#x6f;&#x6d;</a> with a link to
using a confusingly similar package name, email <a href="&#109;&#x61;&#x69;&#x6c;&#x74;&#x6f;&#58;&#97;&#x62;&#117;&#115;&#101;&#x40;&#x6e;&#112;&#109;&#x6a;&#115;&#46;&#99;&#x6f;&#109;">&#97;&#x62;&#117;&#115;&#101;&#x40;&#x6e;&#112;&#109;&#x6a;&#115;&#46;&#99;&#x6f;&#109;</a> with a link to
the package or user account on <a href="https://npmjs.com">https://npmjs.com</a>. Attach a
copy of your trademark registration certificate.</p>
<p>If we see that the package&#39;s publisher is intentionally misleading others by
@ -134,5 +134,5 @@ License.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-disputes &mdash; npm@4.5.0</p>
<p id="footer">npm-disputes &mdash; npm@5.0.0-beta.56</p>

View File

@ -162,5 +162,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-index &mdash; npm@4.5.0</p>
<p id="footer">npm-index &mdash; npm@5.0.0-beta.56</p>

View File

@ -86,5 +86,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-orgs &mdash; npm@4.5.0</p>
<p id="footer">npm-orgs &mdash; npm@5.0.0-beta.56</p>

View File

@ -90,5 +90,5 @@ effectively implement the entire CouchDB API anyway.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-registry &mdash; npm@4.5.0</p>
<p id="footer">npm-registry &mdash; npm@5.0.0-beta.56</p>

View File

@ -99,5 +99,5 @@ that registry instead.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-scope &mdash; npm@4.5.0</p>
<p id="footer">npm-scope &mdash; npm@5.0.0-beta.56</p>

View File

@ -237,5 +237,5 @@ scripts is for compilation which must be done on the target architecture.</li>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-scripts &mdash; npm@4.5.0</p>
<p id="footer">npm-scripts &mdash; npm@5.0.0-beta.56</p>

View File

@ -57,5 +57,5 @@ modules. To track those down, you can do the following:</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">removing-npm &mdash; npm@4.5.0</p>
<p id="footer">removing-npm &mdash; npm@5.0.0-beta.56</p>

View File

@ -325,5 +325,5 @@ range, use the <code>satisfies(version, range)</code> function.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">semver &mdash; npm@4.5.0</p>
<p id="footer">semver &mdash; npm@5.0.0-beta.56</p>

View File

@ -211,7 +211,7 @@ function linkBins (pkg, folder, parent, gtop, cb) {
var out = npm.config.get('parseable')
? dest + '::' + src + ':BINFILE'
: dest + ' -> ' + src
output(out)
if (!npm.config.get('json') && !npm.config.get('parseable')) output(out)
cb()
})
}

378
deps/npm/lib/cache.js vendored
View File

@ -1,367 +1,135 @@
// XXX lib/utils/tar.js and this file need to be rewritten.
'use strict'
// URL-to-cache folder mapping:
// : -> !
// @ -> _
// http://registry.npmjs.org/foo/version -> cache/http!/...
//
const BB = require('bluebird')
/*
fetching a URL:
1. Check for URL in inflight URLs. If present, add cb, and return.
2. Acquire lock at {cache}/{sha(url)}.lock
retries = {cache-lock-retries, def=10}
stale = {cache-lock-stale, def=60000}
wait = {cache-lock-wait, def=10000}
3. if lock can't be acquired, then fail
4. fetch url, clear lock, call cbs
cache folders:
1. urls: http!/server.com/path/to/thing
2. c:\path\to\thing: file!/c!/path/to/thing
3. /path/to/thing: file!/path/to/thing
4. git@ private: git_github.com!npm/npm
5. git://public: git!/github.com/npm/npm
6. git+blah:// git-blah!/server.com/foo/bar
adding a folder:
1. tar into tmp/random/package.tgz
2. untar into tmp/random/contents/package, stripping one dir piece
3. tar tmp/random/contents/package to cache/n/v/package.tgz
4. untar cache/n/v/package.tgz into cache/n/v/package
5. rm tmp/random
Adding a url:
1. fetch to tmp/random/package.tgz
2. goto folder(2)
adding a name@version:
1. registry.get(name/version)
2. if response isn't 304, add url(dist.tarball)
adding a name@range:
1. registry.get(name)
2. Find a version that satisfies
3. add name@version
adding a local tarball:
1. untar to tmp/random/{blah}
2. goto folder(2)
adding a namespaced package:
1. lookup registry for @namespace
2. namespace_registry.get('name')
3. add url(namespace/latest.tarball)
*/
exports = module.exports = cache
cache.unpack = unpack
cache.clean = clean
cache.read = read
var npm = require('./npm.js')
var fs = require('graceful-fs')
var writeFileAtomic = require('write-file-atomic')
var assert = require('assert')
var rm = require('./utils/gently-rm.js')
var readJson = require('read-package-json')
var log = require('npmlog')
var path = require('path')
var asyncMap = require('slide').asyncMap
var tar = require('./utils/tar.js')
var fileCompletion = require('./utils/completion/file-completion.js')
var deprCheck = require('./utils/depr-check.js')
var addNamed = require('./cache/add-named.js')
var addLocal = require('./cache/add-local.js')
var addRemoteTarball = require('./cache/add-remote-tarball.js')
var addRemoteGit = require('./cache/add-remote-git.js')
var inflight = require('inflight')
var realizePackageSpecifier = require('realize-package-specifier')
var npa = require('npm-package-arg')
var getStat = require('./cache/get-stat.js')
var cachedPackageRoot = require('./cache/cached-package-root.js')
var mapToRegistry = require('./utils/map-to-registry.js')
var output = require('./utils/output.js')
const assert = require('assert')
const cacache = require('cacache')
const log = require('npmlog')
const npa = require('npm-package-arg')
const npm = require('./npm.js')
const output = require('./utils/output.js')
const pacote = require('pacote')
const pacoteOpts = require('./config/pacote')
const path = require('path')
const rm = BB.promisify(require('./utils/gently-rm.js'))
const unbuild = BB.promisify(npm.commands.unbuild)
cache.usage = 'npm cache add <tarball file>' +
'\nnpm cache add <folder>' +
'\nnpm cache add <tarball url>' +
'\nnpm cache add <git url>' +
'\nnpm cache add <name>@<version>' +
'\nnpm cache ls [<path>]' +
'\nnpm cache clean [<pkg>[@<version>]]'
'\nnpm cache clean' +
'\nnpm cache verify'
cache.completion = function (opts, cb) {
var argv = opts.conf.argv.remain
if (argv.length === 2) {
return cb(null, ['add', 'ls', 'clean'])
return cb(null, ['add', 'clean'])
}
// TODO - eventually...
switch (argv[2]) {
case 'clean':
case 'ls':
// cache and ls are easy, because the completion is
// what ls_ returns anyway.
// just get the partial words, minus the last path part
var p = path.dirname(opts.partialWords.slice(3).join('/'))
if (p === '.') p = ''
return ls_(p, 2, cb)
case 'add':
// Same semantics as install and publish.
return npm.commands.install.completion(opts, cb)
return cb(null, [])
}
}
exports = module.exports = cache
function cache (args, cb) {
var cmd = args.shift()
const cmd = args.shift()
let result
switch (cmd) {
case 'rm': case 'clear': case 'clean': return clean(args, cb)
case 'list': case 'sl': case 'ls': return ls(args, cb)
case 'add': return add(args, npm.prefix, cb)
case 'rm': case 'clear': case 'clean':
result = clean(args)
break
case 'add':
result = add(args, npm.prefix)
break
case 'verify': case 'check':
result = verify()
break
default: return cb('Usage: ' + cache.usage)
}
if (!result || !result.then) {
throw new Error(`npm cache ${cmd} handler did not return a Promise`)
}
result.then(() => cb(), cb)
}
// if the pkg and ver are in the cache, then
// just do a readJson and return.
// if they're not, then fetch them from the registry.
function read (name, ver, forceBypass, cb) {
assert(typeof name === 'string', 'must include name of module to install')
assert(typeof cb === 'function', 'must include callback')
if (forceBypass === undefined || forceBypass === null) forceBypass = true
var root = cachedPackageRoot({name: name, version: ver})
function c (er, data) {
if (er) log.verbose('cache', 'addNamed error for', name + '@' + ver, er)
if (data) deprCheck(data)
return cb(er, data)
}
if (forceBypass && npm.config.get('force')) {
log.verbose('using force', 'skipping cache')
return addNamed(name, ver, null, c)
}
readJson(path.join(root, 'package', 'package.json'), function (er, data) {
if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er)
if (data) {
if (!data.name) return cb(new Error('No name provided'))
if (!data.version) return cb(new Error('No version provided'))
}
if (er) return addNamed(name, ver, null, c)
else c(er, data)
})
}
function normalize (args) {
var normalized = ''
if (args.length > 0) {
var a = npa(args[0])
if (a.name) normalized = a.name
if (a.rawSpec) normalized = [normalized, a.rawSpec].join('/')
if (args.length > 1) normalized = [normalized].concat(args.slice(1)).join('/')
}
if (normalized.substr(-1) === '/') {
normalized = normalized.substr(0, normalized.length - 1)
}
normalized = path.normalize(normalized)
log.silly('ls', 'normalized', normalized)
return normalized
}
// npm cache ls [<path>]
function ls (args, cb) {
var prefix = npm.config.get('cache')
if (prefix.indexOf(process.env.HOME) === 0) {
prefix = '~' + prefix.substr(process.env.HOME.length)
}
ls_(normalize(args), npm.config.get('depth'), function (er, files) {
output(files.map(function (f) {
return path.join(prefix, f)
}).join('\n').trim())
cb(er, files)
})
}
// Calls cb with list of cached pkgs matching show.
function ls_ (req, depth, cb) {
return fileCompletion(npm.cache, req, depth, cb)
}
// npm cache clean [<path>]
function clean (args, cb) {
assert(typeof cb === 'function', 'must include callback')
// npm cache clean [pkg]*
cache.clean = clean
function clean (args) {
if (!args) args = []
var f = path.join(npm.cache, normalize(args))
if (f === npm.cache) {
fs.readdir(npm.cache, function (er, files) {
if (er) return cb()
asyncMap(
files.filter(function (f) {
return npm.config.get('force') || f !== '-'
}).map(function (f) {
return path.join(npm.cache, f)
}),
rm,
cb
)
})
} else {
rm(f, cb)
if (args.length) {
return BB.reject(new Error('npm cache clear does not accept arguments'))
}
const cachePath = path.join(npm.cache, '_cacache')
if (!npm.config.get('force')) {
return BB.reject(new Error("As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead.\n\nIf you're sure you want to delete the entire cache, rerun this command with --force."))
}
// TODO - remove specific packages or package versions
return rm(cachePath)
}
// npm cache add <tarball-url>
// npm cache add <pkg> <ver>
// npm cache add <tarball>
// npm cache add <folder>
cache.add = function (pkg, ver, where, scrub, cb) {
cache.add = function (pkg, ver, where, scrub) {
assert(typeof pkg === 'string', 'must include name of package to install')
assert(typeof cb === 'function', 'must include callback')
if (scrub) {
return clean([], function (er) {
if (er) return cb(er)
add([pkg, ver], where, cb)
return clean([]).then(() => {
return add([pkg, ver], where)
})
}
return add([pkg, ver], where, cb)
return add([pkg, ver], where)
}
var adding = 0
function add (args, where, cb) {
// this is hot code. almost everything passes through here.
// the args can be any of:
// ['url']
// ['pkg', 'version']
// ['pkg@version']
// ['pkg', 'url']
// This is tricky, because urls can contain @
// Also, in some cases we get [name, null] rather
// that just a single argument.
function add (args, where) {
var usage = 'Usage:\n' +
' npm cache add <tarball-url>\n' +
' npm cache add <pkg>@<ver>\n' +
' npm cache add <tarball>\n' +
' npm cache add <folder>\n'
var spec
log.silly('cache add', 'args', args)
if (args[1] === undefined) args[1] = null
// at this point the args length must ==2
if (args[1] !== null) {
spec = args[0] + '@' + args[1]
} else if (args.length === 2) {
spec = args[0]
}
log.verbose('cache add', 'spec', spec)
if (!spec) return BB.reject(new Error(usage))
log.silly('cache add', 'parsed spec', spec)
return pacote.prefetch(spec, pacoteOpts({where}))
}
if (!spec) return cb(usage)
adding++
cb = afterAdd(cb)
realizePackageSpecifier(spec, where, function (err, p) {
if (err) return cb(err)
log.silly('cache add', 'parsed spec', p)
switch (p.type) {
case 'local':
case 'directory':
addLocal(p, null, cb)
break
case 'remote':
// get auth, if possible
mapToRegistry(p.raw, npm.config, function (err, uri, auth) {
if (err) return cb(err)
addRemoteTarball(p.spec, { name: p.name }, null, auth, cb)
})
break
case 'git':
case 'hosted':
addRemoteGit(p.rawSpec, cb)
break
default:
if (p.name) return addNamed(p.name, p.spec, null, cb)
cb(new Error("couldn't figure out how to install " + spec))
cache.verify = verify
function verify () {
const cache = path.join(npm.config.get('cache'), '_cacache')
let prefix = cache
if (prefix.indexOf(process.env.HOME) === 0) {
prefix = '~' + prefix.substr(process.env.HOME.length)
}
return cacache.verify(cache).then((stats) => {
output(`Cache verified and compressed (${prefix}):`)
output(`Content verified: ${stats.verifiedContent} (${stats.keptSize} bytes)`)
stats.badContentCount && output(`Corrupted content removed: ${stats.badContentCount}`)
stats.reclaimedCount && output(`Content garbage-collected: ${stats.reclaimedCount} (${stats.reclaimedSize} bytes)`)
stats.missingContent && output(`Missing content: ${stats.missingContent}`)
output(`Index entries: ${stats.totalEntries}`)
output(`Finished in ${stats.runTime.total / 1000}s`)
})
}
function unpack (pkg, ver, unpackTarget, dMode, fMode, uid, gid, cb) {
if (typeof cb !== 'function') {
cb = gid
gid = null
}
if (typeof cb !== 'function') {
cb = uid
uid = null
}
if (typeof cb !== 'function') {
cb = fMode
fMode = null
}
if (typeof cb !== 'function') {
cb = dMode
dMode = null
}
read(pkg, ver, false, function (er) {
if (er) {
log.error('unpack', 'Could not read data for %s', pkg + '@' + ver)
return cb(er)
}
npm.commands.unbuild([unpackTarget], true, function (er) {
if (er) return cb(er)
tar.unpack(
path.join(cachedPackageRoot({ name: pkg, version: ver }), 'package.tgz'),
unpackTarget,
dMode, fMode,
uid, gid,
cb
)
})
cache.unpack = unpack
function unpack (pkg, ver, unpackTarget, dmode, fmode, uid, gid) {
return unbuild([unpackTarget], true).then(() => {
const opts = pacoteOpts({dmode, fmode, uid, gid, offline: true})
return pacote.extract(npa.resolve(pkg, ver), unpackTarget, opts)
})
}
function afterAdd (cb) {
return function (er, data) {
adding--
if (er || !data || !data.name || !data.version) return cb(er, data)
log.silly('cache', 'afterAdd', data.name + '@' + data.version)
// 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)
if (!done) return log.verbose('afterAdd', pj, 'already in flight; not writing')
log.verbose('afterAdd', pj, 'not in flight; writing')
getStat(function (er, cs) {
if (er) return done(er)
writeFileAtomic(pj, JSON.stringify(data), { chown: cs }, function (er) {
if (!er) log.verbose('afterAdd', pj, 'written')
return done(null, data)
})
})
}
}

View File

@ -1,175 +0,0 @@
var mkdir = require('mkdirp')
var assert = require('assert')
var fs = require('graceful-fs')
var writeFileAtomic = require('write-file-atomic')
var path = require('path')
var sha = require('sha')
var npm = require('../npm.js')
var log = require('npmlog')
var tar = require('../utils/tar.js')
var pathIsInside = require('path-is-inside')
var getCacheStat = require('./get-stat.js')
var cachedPackageRoot = require('./cached-package-root.js')
var chownr = require('chownr')
var inflight = require('inflight')
var once = require('once')
var writeStreamAtomic = require('fs-write-stream-atomic')
var tempFilename = require('../utils/temp-filename.js')
var rimraf = require('rimraf')
var packageId = require('../utils/package-id.js')
module.exports = addLocalTarball
function addLocalTarball (p, pkgData, shasum, cb) {
assert(typeof p === 'string', 'must have path')
assert(typeof cb === 'function', 'must have callback')
if (!pkgData) pkgData = {}
// If we don't have a shasum yet, compute it.
if (!shasum) {
return sha.get(p, function (er, shasum) {
if (er) return cb(er)
log.silly('addLocalTarball', 'shasum (computed)', shasum)
addLocalTarball(p, pkgData, shasum, cb)
})
}
if (pathIsInside(p, npm.cache)) {
if (path.basename(p) !== 'package.tgz') {
return cb(new Error('Not a valid cache tarball name: ' + p))
}
log.verbose('addLocalTarball', 'adding from inside cache', p)
return addPlacedTarball(p, pkgData, shasum, cb)
}
addTmpTarball(p, pkgData, shasum, function (er, data) {
if (data) {
data._resolved = p
data._shasum = data._shasum || shasum
}
return cb(er, data)
})
}
function addPlacedTarball (p, pkgData, shasum, cb) {
assert(pkgData, 'should have package data by now')
assert(typeof cb === 'function', 'cb function required')
getCacheStat(function (er, cs) {
if (er) return cb(er)
return addPlacedTarball_(p, pkgData, cs.uid, cs.gid, shasum, cb)
})
}
function addPlacedTarball_ (p, pkgData, uid, gid, resolvedSum, cb) {
var folder = path.join(cachedPackageRoot(pkgData), 'package')
// First, make sure we have the shasum, if we don't already.
if (!resolvedSum) {
sha.get(p, function (er, shasum) {
if (er) return cb(er)
addPlacedTarball_(p, pkgData, uid, gid, shasum, cb)
})
return
}
mkdir(folder, function (er) {
if (er) return cb(er)
var pj = path.join(folder, 'package.json')
var json = JSON.stringify(pkgData, null, 2)
writeFileAtomic(pj, json, function (er) {
cb(er, pkgData)
})
})
}
function addTmpTarball (tgz, pkgData, shasum, cb) {
assert(typeof cb === 'function', 'must have callback function')
assert(shasum, 'must have shasum by now')
cb = inflight('addTmpTarball:' + tgz, cb)
if (!cb) return log.verbose('addTmpTarball', tgz, 'already in flight; not adding')
log.verbose('addTmpTarball', tgz, 'not in flight; adding')
// we already have the package info, so just move into place
if (pkgData && pkgData.name && pkgData.version) {
log.verbose(
'addTmpTarball',
'already have metadata; skipping unpack for',
packageId(pkgData)
)
return addTmpTarball_(tgz, pkgData, shasum, cb)
}
// This is a tarball we probably downloaded from the internet. The shasum's
// already been checked, but we haven't ever had a peek inside, so we unpack
// it here just to make sure it is what it says it is.
//
// NOTE: we might not have any clue what we think it is, for example if the
// user just did `npm install ./foo.tgz`
var target = tempFilename('unpack')
getCacheStat(function (er, cs) {
if (er) return cb(er)
log.verbose('addTmpTarball', 'validating metadata from', tgz)
tar.unpack(tgz, target, null, null, cs.uid, cs.gid, function (unpackEr, data) {
// cleanup the extracted package and move on with the metadata
rimraf(target, function () {
if (unpackEr) return cb(unpackEr)
// check that this is what we expected.
if (!data.name) {
return cb(new Error('No name provided'))
} else if (pkgData.name && data.name !== pkgData.name) {
return cb(new Error('Invalid Package: expected ' + pkgData.name +
' but found ' + data.name))
}
if (!data.version) {
return cb(new Error('No version provided'))
} else if (pkgData.version && data.version !== pkgData.version) {
return cb(new Error('Invalid Package: expected ' +
packageId(pkgData) +
' but found ' + packageId(data)))
}
addTmpTarball_(tgz, data, shasum, cb)
})
})
})
}
function addTmpTarball_ (tgz, data, shasum, cb) {
assert(typeof cb === 'function', 'must have callback function')
cb = once(cb)
assert(data.name, 'should have package name by now')
assert(data.version, 'should have package version by now')
var root = cachedPackageRoot(data)
var pkg = path.resolve(root, 'package')
var target = path.resolve(root, 'package.tgz')
getCacheStat(function (er, cs) {
if (er) return cb(er)
mkdir(pkg, function (er, created) {
// chown starting from the first dir created by mkdirp,
// or the root dir, if none had to be created, so that
// we know that we get all the children.
function chown () {
chownr(created || root, cs.uid, cs.gid, done)
}
if (er) return cb(er)
var read = fs.createReadStream(tgz)
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)
})
})
function done () {
data._shasum = data._shasum || shasum
cb(null, data)
}
}

View File

@ -1,153 +0,0 @@
var assert = require('assert')
var path = require('path')
var mkdir = require('mkdirp')
var chownr = require('chownr')
var pathIsInside = require('path-is-inside')
var readJson = require('read-package-json')
var log = require('npmlog')
var npm = require('../npm.js')
var tar = require('../utils/tar.js')
var deprCheck = require('../utils/depr-check.js')
var prepublishWarning = require('../utils/warn-deprecated.js')('prepublish-on-install')
var getCacheStat = require('./get-stat.js')
var cachedPackageRoot = require('./cached-package-root.js')
var addLocalTarball = require('./add-local-tarball.js')
var sha = require('sha')
var inflight = require('inflight')
var lifecycle = require('../utils/lifecycle.js')
var iferr = require('iferr')
var chain = require('slide').chain
module.exports = addLocal
function addLocal (p, pkgData, cb_) {
assert(typeof p === 'object', 'must have spec info')
assert(typeof cb_ === 'function', 'must have callback')
pkgData = pkgData || {}
function cb (er, data) {
if (er) {
log.error('addLocal', 'Could not install %s', p.spec)
return cb_(er)
}
if (data && !data._fromHosted) {
data._from = path.relative(npm.prefix, p.spec) || '.'
var resolved = path.relative(npm.prefix, p.spec)
if (resolved) data._resolved = 'file:' + resolved
}
return cb_(er, data)
}
if (p.type === 'directory') {
addLocalDirectory(p.spec, pkgData, null, cb)
} else {
addLocalTarball(p.spec, pkgData, null, cb)
}
}
// At this point, if shasum is set, it's something that we've already
// read and checked. Just stashing it in the data at this point.
function addLocalDirectory (p, pkgData, shasum, cb) {
assert(pkgData, 'must pass package data')
assert(typeof cb === 'function', 'must have callback')
// if it's a folder, then read the package.json,
// tar it to the proper place, and add the cache tar
if (pathIsInside(p, npm.cache)) {
return cb(new Error(
'Adding a cache directory to the cache will make the world implode.'
))
}
readJson(path.join(p, 'package.json'), false, function (er, data) {
if (er) return cb(er)
if (!data.name) {
return cb(new Error('No name provided in package.json'))
} else if (pkgData.name && pkgData.name !== data.name) {
return cb(new Error(
'Invalid package: expected ' + pkgData.name + ' but found ' + data.name
))
}
if (!data.version) {
return cb(new Error('No version provided in package.json'))
} else if (pkgData.version && pkgData.version !== data.version) {
return cb(new Error(
'Invalid package: expected ' + pkgData.name + '@' + pkgData.version +
' but found ' + data.name + '@' + data.version
))
}
deprCheck(data)
// pack to {cache}/name/ver/package.tgz
var root = cachedPackageRoot(data)
var tgz = path.resolve(root, 'package.tgz')
var pj = path.resolve(root, 'package/package.json')
var wrapped = inflight(tgz, next)
if (!wrapped) return log.verbose('addLocalDirectory', tgz, 'already in flight; waiting')
log.verbose('addLocalDirectory', tgz, 'not in flight; packing')
getCacheStat(function (er, cs) {
mkdir(path.dirname(pj), function (er, made) {
if (er) return wrapped(er)
var doPrePublish = !pathIsInside(p, npm.tmp)
if (doPrePublish) {
// TODO: for `npm@5`, change the behavior and remove this warning.
// see https://github.com/npm/npm/issues/10074 for details
if (data && data.scripts && data.scripts.prepublish) {
prepublishWarning([
'As of npm@5, `prepublish` scripts will run only for `npm publish`.',
'(In npm@4 and previous versions, it also runs for `npm install`.)',
'See the deprecation note in `npm help scripts` for more information.'
])
}
chain(
[
[lifecycle, data, 'prepublish', p],
[lifecycle, data, 'prepare', p]
],
iferr(wrapped, thenPack)
)
} else {
thenPack()
}
function thenPack () {
tar.pack(tgz, p, data, function (er) {
if (er) {
log.error('addLocalDirectory', 'Could not pack', p, 'to', tgz)
return wrapped(er)
}
if (!cs || isNaN(cs.uid) || isNaN(cs.gid)) return wrapped()
chownr(made || tgz, cs.uid, cs.gid, function (er) {
if (er && er.code === 'ENOENT') return wrapped()
wrapped(er)
})
})
}
})
})
function next (er) {
if (er) return cb(er)
// if we have the shasum already, just add it
if (shasum) {
return addLocalTarball(tgz, data, shasum, cb)
} else {
sha.get(tgz, function (er, shasum) {
if (er) {
return cb(er)
}
data._shasum = shasum
return addLocalTarball(tgz, data, shasum, cb)
})
}
}
})
}

View File

@ -1,289 +0,0 @@
var path = require('path')
var assert = require('assert')
var fs = require('graceful-fs')
var http = require('http')
var log = require('npmlog')
var semver = require('semver')
var readJson = require('read-package-json')
var url = require('url')
var npm = require('../npm.js')
var deprCheck = require('../utils/depr-check.js')
var inflight = require('inflight')
var addRemoteTarball = require('./add-remote-tarball.js')
var cachedPackageRoot = require('./cached-package-root.js')
var mapToRegistry = require('../utils/map-to-registry.js')
var pulseTillDone = require('../utils/pulse-till-done.js')
var packageId = require('../utils/package-id.js')
var pickManifestFromRegistryMetadata = require('../utils/pick-manifest-from-registry-metadata.js')
module.exports = addNamed
function getOnceFromRegistry (name, from, next, done) {
function fixName (err, data, json, resp) {
// this is only necessary until npm/npm-registry-client#80 is fixed
if (err && err.pkgid && err.pkgid !== name) {
err.message = err.message.replace(
new RegExp(': ' + err.pkgid.replace(/(\W)/g, '\\$1') + '$'),
': ' + name
)
err.pkgid = name
}
next(err, data, json, resp)
}
mapToRegistry(name, npm.config, function (er, uri, auth) {
if (er) return done(er)
var key = 'registry:' + uri
next = inflight(key, next)
if (!next) return log.verbose(from, key, 'already in flight; waiting')
else log.verbose(from, key, 'not in flight; fetching')
npm.registry.get(uri, { auth: auth }, pulseTillDone('fetchRegistry', fixName))
})
}
function addNamed (name, version, data, cb_) {
assert(typeof name === 'string', 'must have module name')
assert(typeof cb_ === 'function', 'must have callback')
var key = name + '@' + version
log.silly('addNamed', key)
function cb (er, data) {
if (data && !data._fromHosted) data._from = key
cb_(er, data)
}
if (semver.valid(version, true)) {
log.verbose('addNamed', JSON.stringify(version), 'is a plain semver version for', name)
addNameVersion(name, version, data, cb)
} else if (semver.validRange(version, true)) {
log.verbose('addNamed', JSON.stringify(version), 'is a valid semver range for', name)
addNameRange(name, version, data, cb)
} else {
log.verbose('addNamed', JSON.stringify(version), 'is being treated as a dist-tag for', name)
addNameTag(name, version, data, cb)
}
}
function addNameTag (name, tag, data, cb) {
log.info('addNameTag', [name, tag])
var explicit = true
if (!tag) {
explicit = false
tag = npm.config.get('tag')
}
getOnceFromRegistry(name, 'addNameTag', next, cb)
function next (er, data, json, resp) {
if (!er) er = errorResponse(name, resp)
if (er) return cb(er)
log.silly('addNameTag', 'next cb for', name, 'with tag', tag)
engineFilter(data)
if (data['dist-tags'] && data['dist-tags'][tag] &&
data.versions[data['dist-tags'][tag]]) {
var ver = data['dist-tags'][tag]
return addNamed(name, ver, data.versions[ver], cb)
}
if (!explicit && Object.keys(data.versions).length) {
return addNamed(name, '*', data, cb)
}
er = installTargetsError(tag, data)
return cb(er)
}
}
function engineFilter (data) {
var npmv = npm.version
var nodev = npm.config.get('node-version')
var strict = npm.config.get('engine-strict')
if (!nodev || npm.config.get('force')) return data
Object.keys(data.versions || {}).forEach(function (v) {
var eng = data.versions[v].engines
if (!eng) return
if (!strict) return
if (eng.node && !semver.satisfies(nodev, eng.node, true) ||
eng.npm && !semver.satisfies(npmv, eng.npm, true)) {
delete data.versions[v]
}
})
}
function addNameVersion (name, v, data, cb) {
var ver = semver.valid(v, true)
if (!ver) return cb(new Error('Invalid version: ' + v))
var response
if (data) {
response = null
return next()
}
getOnceFromRegistry(name, 'addNameVersion', setData, cb)
function setData (er, d, json, resp) {
if (!er) {
er = errorResponse(name, resp)
}
if (er) return cb(er)
data = d && d.versions[ver]
if (!data) {
er = new Error('version not found: ' + name + '@' + ver)
er.package = name
er.statusCode = 404
return cb(er)
}
response = resp
next()
}
function next () {
deprCheck(data)
var dist = data.dist
if (!dist) return cb(new Error('No dist in ' + packageId(data) + ' package'))
if (!dist.tarball) {
return cb(new Error(
'No dist.tarball in ' + packageId(data) + ' package'
))
}
if ((response && response.statusCode !== 304) || npm.config.get('force')) {
return fetchit()
}
// we got cached data, so let's see if we have a tarball.
var pkgroot = cachedPackageRoot({ name: name, version: ver })
var pkgtgz = path.join(pkgroot, 'package.tgz')
var pkgjson = path.join(pkgroot, 'package', 'package.json')
fs.stat(pkgtgz, function (er) {
if (!er) {
readJson(pkgjson, function (er, data) {
if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er)
if (data) {
if (!data.name) return cb(new Error('No name provided'))
if (!data.version) return cb(new Error('No version provided'))
// check the SHA of the package we have, to ensure it wasn't installed
// from somewhere other than the registry (eg, a fork)
if (data._shasum && dist.shasum && data._shasum !== dist.shasum) {
return fetchit()
}
}
if (er) return fetchit()
else return cb(null, data)
})
} else return fetchit()
})
function fetchit () {
mapToRegistry(name, npm.config, function (er, _, auth, ruri) {
if (er) return cb(er)
// Use the same protocol as the registry. https registry --> https
// tarballs, but only if they're the same hostname, or else detached
// tarballs may not work.
var tb = url.parse(dist.tarball)
var rp = url.parse(ruri)
if (tb.hostname === rp.hostname && tb.protocol !== rp.protocol) {
tb.protocol = rp.protocol
// If a different port is associated with the other protocol
// we need to update that as well
if (rp.port !== tb.port) {
tb.port = rp.port
delete tb.host
}
delete tb.href
}
tb = url.format(tb)
// Only add non-shasum'ed packages if --forced. Only ancient things
// would lack this for good reasons nowadays.
if (!dist.shasum && !npm.config.get('force')) {
return cb(new Error('package lacks shasum: ' + packageId(data)))
}
addRemoteTarball(tb, data, dist.shasum, auth, cb)
})
}
}
}
function addNameRange (name, range, data, cb) {
range = semver.validRange(range, true)
if (range === null) {
return cb(new Error(
'Invalid version range: ' + range
))
}
log.silly('addNameRange', { name: name, range: range, hasData: !!data })
if (data) return next()
getOnceFromRegistry(name, 'addNameRange', setData, cb)
function setData (er, d, json, resp) {
if (!er) {
er = errorResponse(name, resp)
}
if (er) return cb(er)
data = d
next()
}
function next () {
log.silly(
'addNameRange',
'number 2', { name: name, range: range, hasData: !!data }
)
engineFilter(data)
log.silly('addNameRange', 'versions'
, [data.name, Object.keys(data.versions || {})])
var versions = Object.keys(data.versions).filter(function (v) { return semver.valid(v) })
var picked = pickManifestFromRegistryMetadata(range, npm.config.get('tag'), versions, data)
if (picked) return addNamed(name, picked.resolvedTo, picked.manifest, cb)
return cb(installTargetsError(range, data))
}
}
function installTargetsError (requested, data) {
var targets = Object.keys(data['dist-tags']).filter(function (f) {
return (data.versions || {}).hasOwnProperty(f)
}).concat(Object.keys(data.versions || {}))
requested = data.name + (requested ? "@'" + requested + "'" : '')
targets = targets.length
? 'Valid install targets:\n' + targets.join(', ') + '\n'
: 'No valid targets found.\n' +
'Perhaps not compatible with your version of node?'
var er = new Error('No compatible version found: ' + requested + '\n' + targets)
er.code = 'ETARGET'
return er
}
function errorResponse (name, response) {
var er
if (response.statusCode >= 400) {
er = new Error(http.STATUS_CODES[response.statusCode])
er.statusCode = response.statusCode
er.code = 'E' + er.statusCode
er.pkgid = name
}
return er
}

View File

@ -1,496 +0,0 @@
var assert = require('assert')
var fs = require('graceful-fs')
var path = require('path')
var url = require('url')
var chownr = require('chownr')
var dezalgo = require('dezalgo')
var hostedFromURL = require('hosted-git-info').fromUrl
var inflight = require('inflight')
var log = require('npmlog')
var mkdir = require('mkdirp')
var normalizeGitUrl = require('normalize-git-url')
var npa = require('npm-package-arg')
var realizePackageSpecifier = require('realize-package-specifier')
var uniqueFilename = require('unique-filename')
var addLocal = require('./add-local.js')
var correctMkdir = require('../utils/correct-mkdir.js')
var git = require('../utils/git.js')
var npm = require('../npm.js')
var rm = require('../utils/gently-rm.js')
var tempFilename = require('../utils/temp-filename.js')
var remotes = path.resolve(npm.config.get('cache'), '_git-remotes')
var templates = path.join(remotes, '_templates')
var VALID_VARIABLES = [
'GIT_ASKPASS',
'GIT_EXEC_PATH',
'GIT_PROXY_COMMAND',
'GIT_SSH',
'GIT_SSH_COMMAND',
'GIT_SSL_CAINFO',
'GIT_SSL_NO_VERIFY'
]
module.exports = addRemoteGit
function addRemoteGit (uri, _cb) {
assert(typeof uri === 'string', 'must have git URL')
assert(typeof _cb === 'function', 'must have callback')
var cb = dezalgo(_cb)
log.verbose('addRemoteGit', 'caching', uri)
// the URL comes in exactly as it was passed on the command line, or as
// normalized by normalize-package-data / read-package-json / read-installed,
// so figure out what to do with it using hosted-git-info
var parsed = hostedFromURL(uri)
if (parsed) {
// normalize GitHub syntax to org/repo (for now)
var from
if (parsed.type === 'github' && parsed.getDefaultRepresentation() === 'shortcut') {
from = parsed.path()
} else {
from = parsed.toString()
}
log.verbose('addRemoteGit', from, 'is a repository hosted by', parsed.type)
// prefer explicit URLs to pushing everything through shortcuts
if (parsed.getDefaultRepresentation() !== 'shortcut') {
return tryClone(from, parsed.toString(), false, cb)
}
// try git:, then git+ssh:, then git+https: before failing
tryGitProto(from, parsed, cb)
} else {
// verify that this is a Git URL before continuing
parsed = npa(uri)
if (parsed.type !== 'git') {
return cb(new Error(uri + 'is not a Git or GitHub URL'))
}
tryClone(parsed.rawSpec, uri, false, cb)
}
}
function tryGitProto (from, hostedInfo, cb) {
var gitURL = hostedInfo.git()
if (!gitURL) return tryHTTPS(from, hostedInfo, cb)
log.silly('tryGitProto', 'attempting to clone', gitURL)
tryClone(from, gitURL, true, function (er) {
if (er) return tryHTTPS(from, hostedInfo, cb)
cb.apply(this, arguments)
})
}
function tryHTTPS (from, hostedInfo, cb) {
var httpsURL = hostedInfo.https()
if (!httpsURL) {
return cb(new Error(from + ' can not be cloned via Git, SSH, or HTTPS'))
}
log.silly('tryHTTPS', 'attempting to clone', httpsURL)
tryClone(from, httpsURL, true, function (er) {
if (er) return trySSH(from, hostedInfo, cb)
cb.apply(this, arguments)
})
}
function trySSH (from, hostedInfo, cb) {
var sshURL = hostedInfo.ssh()
if (!sshURL) return tryHTTPS(from, hostedInfo, cb)
log.silly('trySSH', 'attempting to clone', sshURL)
tryClone(from, sshURL, false, cb)
}
function tryClone (from, combinedURL, silent, cb) {
log.silly('tryClone', 'cloning', from, 'via', combinedURL)
var normalized = normalizeGitUrl(combinedURL)
var cloneURL = normalized.url
var treeish = normalized.branch
// ensure that similarly-named remotes don't collide
var cachedRemote = uniqueFilename(remotes, combinedURL.replace(/[^a-zA-Z0-9]+/g, '-'), cloneURL)
var repoID = path.relative(remotes, cachedRemote)
cachedRemote = path.join(remotes, repoID)
cb = inflight(repoID, cb)
if (!cb) {
return log.verbose('tryClone', repoID, 'already in flight; waiting')
}
log.verbose('tryClone', repoID, 'not in flight; caching')
// initialize the remotes cache with the correct perms
getGitDir(function (er) {
if (er) return cb(er)
fs.stat(cachedRemote, function (er, s) {
if (er) return mirrorRemote(from, cloneURL, treeish, cachedRemote, silent, finish)
if (!s.isDirectory()) return resetRemote(from, cloneURL, treeish, cachedRemote, finish)
validateExistingRemote(from, cloneURL, treeish, cachedRemote, finish)
})
// always set permissions on the cached remote
function finish (er, data) {
if (er) return cb(er, data)
addModeRecursive(cachedRemote, npm.modes.file, function (er) {
return cb(er, data)
})
}
})
}
// don't try too hard to hold on to a remote
function resetRemote (from, cloneURL, treeish, cachedRemote, cb) {
log.info('resetRemote', 'resetting', cachedRemote, 'for', from)
rm(cachedRemote, function (er) {
if (er) return cb(er)
mirrorRemote(from, cloneURL, treeish, cachedRemote, false, cb)
})
}
// reuse a cached remote when possible, but nuke it if it's in an
// inconsistent state
function validateExistingRemote (from, cloneURL, treeish, cachedRemote, cb) {
git.whichAndExec(
['config', '--get', 'remote.origin.url'],
{ cwd: cachedRemote, env: gitEnv() },
function (er, stdout, stderr) {
var originURL
if (stdout) {
originURL = stdout.trim()
log.silly('validateExistingRemote', from, 'remote.origin.url:', originURL)
}
if (stderr) stderr = stderr.trim()
if (stderr || er) {
log.warn('addRemoteGit', from, 'resetting remote', cachedRemote, 'because of error:', stderr || er)
return resetRemote(from, cloneURL, treeish, cachedRemote, cb)
} else if (cloneURL !== originURL) {
log.warn(
'addRemoteGit',
from,
'pre-existing cached repo', cachedRemote, 'points to', originURL, 'and not', cloneURL
)
return resetRemote(from, cloneURL, treeish, cachedRemote, cb)
}
log.verbose('validateExistingRemote', from, 'is updating existing cached remote', cachedRemote)
updateRemote(from, cloneURL, treeish, cachedRemote, cb)
}
)
}
// make a complete bare mirror of the remote repo
// NOTE: npm uses a blank template directory to prevent weird inconsistencies
// https://github.com/npm/npm/issues/5867
function mirrorRemote (from, cloneURL, treeish, cachedRemote, silent, cb) {
mkdir(cachedRemote, function (er) {
if (er) return cb(er)
var args = [
'clone',
'--template=' + templates,
'--mirror',
cloneURL, cachedRemote
]
git.whichAndExec(
['clone', '--template=' + templates, '--mirror', cloneURL, cachedRemote],
{ cwd: cachedRemote, env: gitEnv() },
function (er, stdout, stderr) {
if (er) {
var combined = (stdout + '\n' + stderr).trim()
var command = 'git ' + args.join(' ') + ':'
if (silent) {
log.verbose(command, combined)
} else {
log.error(command, combined)
}
return cb(er)
}
log.verbose('mirrorRemote', from, 'git clone ' + cloneURL, stdout.trim())
setPermissions(from, cloneURL, treeish, cachedRemote, cb)
}
)
})
}
function setPermissions (from, cloneURL, treeish, cachedRemote, cb) {
if (process.platform === 'win32') {
log.verbose('setPermissions', from, 'skipping chownr on Windows')
resolveHead(from, cloneURL, treeish, cachedRemote, cb)
} else {
getGitDir(function (er, cs) {
if (er) {
log.error('setPermissions', from, 'could not get cache stat')
return cb(er)
}
chownr(cachedRemote, cs.uid, cs.gid, function (er) {
if (er) {
log.error(
'setPermissions',
'Failed to change git repository ownership under npm cache for',
cachedRemote
)
return cb(er)
}
log.verbose('setPermissions', from, 'set permissions on', cachedRemote)
resolveHead(from, cloneURL, treeish, cachedRemote, cb)
})
})
}
}
// always fetch the origin, even right after mirroring, because this way
// permissions will get set correctly
function updateRemote (from, cloneURL, treeish, cachedRemote, cb) {
git.whichAndExec(
['fetch', '-a', 'origin'],
{ cwd: cachedRemote, env: gitEnv() },
function (er, stdout, stderr) {
if (er) {
var combined = (stdout + '\n' + stderr).trim()
log.error('git fetch -a origin (' + cloneURL + ')', combined)
return cb(er)
}
log.verbose('updateRemote', 'git fetch -a origin (' + cloneURL + ')', stdout.trim())
setPermissions(from, cloneURL, treeish, cachedRemote, cb)
}
)
}
// branches and tags are both symbolic labels that can be attached to different
// commits, so resolve the commit-ish to the current actual treeish the label
// corresponds to
//
// important for shrinkwrap
function resolveHead (from, cloneURL, treeish, cachedRemote, cb) {
log.verbose('resolveHead', from, 'original treeish:', treeish)
var args = ['rev-list', '-n1', treeish]
git.whichAndExec(
args,
{ cwd: cachedRemote, env: gitEnv() },
function (er, stdout, stderr) {
if (er) {
log.error('git ' + args.join(' ') + ':', stderr)
return cb(er)
}
var resolvedTreeish = stdout.trim()
log.silly('resolveHead', from, 'resolved treeish:', resolvedTreeish)
var resolvedURL = getResolved(cloneURL, resolvedTreeish)
if (!resolvedURL) {
return cb(new Error(
'unable to clone ' + from + ' because git clone string ' +
cloneURL + ' is in a form npm can\'t handle'
))
}
log.verbose('resolveHead', from, 'resolved Git URL:', resolvedURL)
// generate a unique filename
var tmpdir = path.join(tempFilename('git-cache'), resolvedTreeish)
log.silly('resolveHead', 'Git working directory:', tmpdir)
mkdir(tmpdir, function (er) {
if (er) return cb(er)
cloneResolved(from, resolvedURL, resolvedTreeish, cachedRemote, tmpdir, cb)
})
}
)
}
// make a clone from the mirrored cache so we have a temporary directory in
// which we can check out the resolved treeish
function cloneResolved (from, resolvedURL, resolvedTreeish, cachedRemote, tmpdir, cb) {
var args = ['clone', cachedRemote, tmpdir]
git.whichAndExec(
args,
{ cwd: cachedRemote, env: gitEnv() },
function (er, stdout, stderr) {
stdout = (stdout + '\n' + stderr).trim()
if (er) {
log.error('git ' + args.join(' ') + ':', stderr)
return cb(er)
}
log.verbose('cloneResolved', from, 'clone', stdout)
checkoutTreeish(from, resolvedURL, resolvedTreeish, tmpdir, cb)
}
)
}
// there is no safe way to do a one-step clone to a treeish that isn't
// guaranteed to be a branch, so explicitly check out the treeish once it's
// cloned
function checkoutTreeish (from, resolvedURL, resolvedTreeish, tmpdir, cb) {
var args = ['checkout', resolvedTreeish]
git.whichAndExec(
args,
{ cwd: tmpdir, env: gitEnv() },
function (er, stdout, stderr) {
stdout = (stdout + '\n' + stderr).trim()
if (er) {
log.error('git ' + args.join(' ') + ':', stderr)
return cb(er)
}
log.verbose('checkoutTreeish', from, 'checkout', stdout)
updateSubmodules(from, resolvedURL, tmpdir, cb)
}
)
}
function updateSubmodules (from, resolvedURL, tmpdir, cb) {
var args = ['submodule', '-q', 'update', '--init', '--recursive']
git.whichAndExec(
args,
{ cwd: tmpdir, env: gitEnv() },
function (er, stdout, stderr) {
stdout = (stdout + '\n' + stderr).trim()
if (er) {
log.error('git ' + args.join(' ') + ':', stderr)
return cb(er)
}
log.verbose('updateSubmodules', from, 'submodule update', stdout)
// convince addLocal that the checkout is a local dependency
realizePackageSpecifier(tmpdir, function (er, spec) {
if (er) {
log.error('addRemoteGit', 'Failed to map', tmpdir, 'to a package specifier')
return cb(er)
}
// ensure pack logic is applied
// https://github.com/npm/npm/issues/6400
addLocal(spec, null, function (er, data) {
if (data) {
if (npm.config.get('save-exact')) {
log.verbose('addRemoteGit', 'data._from:', resolvedURL, '(save-exact)')
data._from = resolvedURL
} else {
log.verbose('addRemoteGit', 'data._from:', from)
data._from = from
}
log.verbose('addRemoteGit', 'data._resolved:', resolvedURL)
data._resolved = resolvedURL
}
cb(er, data)
})
})
}
)
}
function getGitDir (cb) {
correctMkdir(remotes, function (er, stats) {
if (er) return cb(er)
// We don't need global templates when cloning. Use an empty directory for
// the templates, creating it (and setting its permissions) if necessary.
mkdir(templates, function (er) {
if (er) return cb(er)
// Ensure that both the template and remotes directories have the correct
// permissions.
fs.chown(templates, stats.uid, stats.gid, function (er) {
cb(er, stats)
})
})
})
}
var gitEnv_
function gitEnv () {
// git responds to env vars in some weird ways in post-receive hooks
// so don't carry those along.
if (gitEnv_) return gitEnv_
// allow users to override npm's insistence on not prompting for
// passphrases, but default to just failing when credentials
// aren't available
gitEnv_ = { GIT_ASKPASS: 'echo' }
for (var k in process.env) {
if (!~VALID_VARIABLES.indexOf(k) && k.match(/^GIT/)) continue
gitEnv_[k] = process.env[k]
}
return gitEnv_
}
addRemoteGit.getResolved = getResolved
function getResolved (uri, treeish) {
// normalize hosted-git-info clone URLs back into regular URLs
// this will only work on URLs that hosted-git-info recognizes
// https://github.com/npm/npm/issues/7961
var rehydrated = hostedFromURL(uri)
if (rehydrated) uri = rehydrated.toString()
var parsed = url.parse(uri)
// Checks for known protocols:
// http:, https:, ssh:, and git:, with optional git+ prefix.
if (!parsed.protocol ||
!parsed.protocol.match(/^(((git\+)?(https?|ssh|file))|git|file):$/)) {
uri = 'git+ssh://' + uri
}
if (!/^git[+:]/.test(uri)) {
uri = 'git+' + uri
}
// Not all URIs are actually URIs, so use regex for the treeish.
return uri.replace(/(?:#.*)?$/, '#' + treeish)
}
// similar to chmodr except it add permissions rather than overwriting them
// adapted from https://github.com/isaacs/chmodr/blob/master/chmodr.js
function addModeRecursive (cachedRemote, mode, cb) {
fs.readdir(cachedRemote, function (er, children) {
// Any error other than ENOTDIR means it's not readable, or doesn't exist.
// Give up.
if (er && er.code !== 'ENOTDIR') return cb(er)
if (er || !children.length) return addMode(cachedRemote, mode, cb)
var len = children.length
var errState = null
children.forEach(function (child) {
addModeRecursive(path.resolve(cachedRemote, child), mode, then)
})
function then (er) {
if (errState) return undefined
if (er) return cb(errState = er)
if (--len === 0) return addMode(cachedRemote, dirMode(mode), cb)
}
})
}
function addMode (cachedRemote, mode, cb) {
fs.stat(cachedRemote, function (er, stats) {
if (er) return cb(er)
mode = stats.mode | mode
fs.chmod(cachedRemote, mode, cb)
})
}
// taken from https://github.com/isaacs/chmodr/blob/master/chmodr.js
function dirMode (mode) {
if (mode & parseInt('0400', 8)) mode |= parseInt('0100', 8)
if (mode & parseInt('040', 8)) mode |= parseInt('010', 8)
if (mode & parseInt('04', 8)) mode |= parseInt('01', 8)
return mode
}

View File

@ -1,132 +0,0 @@
var mkdir = require('mkdirp')
var assert = require('assert')
var log = require('npmlog')
var path = require('path')
var sha = require('sha')
var retry = require('retry')
var writeStreamAtomic = require('fs-write-stream-atomic')
var PassThrough = require('readable-stream').PassThrough
var npm = require('../npm.js')
var inflight = require('inflight')
var addLocalTarball = require('./add-local-tarball.js')
var cacheFile = require('npm-cache-filename')
var rimraf = require('rimraf')
var pulseTillDone = require('../utils/pulse-till-done.js')
module.exports = addRemoteTarball
function addRemoteTarball (u, pkgData, shasum, auth, cb_) {
assert(typeof u === 'string', 'must have module URL')
assert(typeof cb_ === 'function', 'must have callback')
function cb (er, data) {
if (data) {
data._from = u
data._resolved = u
data._shasum = data._shasum || shasum
}
cb_(er, data)
}
cb_ = inflight(u, cb_)
if (!cb_) return log.verbose('addRemoteTarball', u, 'already in flight; waiting')
log.verbose('addRemoteTarball', u, 'not in flight; adding')
// XXX Fetch direct to cache location, store tarballs under
// ${cache}/registry.npmjs.org/pkg/-/pkg-1.2.3.tgz
var tmp = cacheFile(npm.tmp, u)
function next (er, resp, shasum) {
if (er) return cb(er)
addLocalTarball(tmp, pkgData, shasum, cleanup)
}
function cleanup (er, data) {
if (er) return cb(er)
rimraf(tmp, function () {
cb(er, data)
})
}
log.verbose('addRemoteTarball', [u, shasum])
mkdir(path.dirname(tmp), function (er) {
if (er) return cb(er)
addRemoteTarball_(u, tmp, shasum, auth, next)
})
}
function addRemoteTarball_ (u, tmp, shasum, auth, cb) {
// Tuned to spread 3 attempts over about a minute.
// See formula at <https://github.com/tim-kos/node-retry>.
var operation = retry.operation({
retries: npm.config.get('fetch-retries'),
factor: npm.config.get('fetch-retry-factor'),
minTimeout: npm.config.get('fetch-retry-mintimeout'),
maxTimeout: npm.config.get('fetch-retry-maxtimeout')
})
operation.attempt(function (currentAttempt) {
log.info(
'retry',
'fetch attempt', currentAttempt,
'at', (new Date()).toLocaleTimeString()
)
fetchAndShaCheck(u, tmp, shasum, auth, function (er, response, shasum) {
// Only retry on 408, 5xx or no `response`.
var sc = response && response.statusCode
var statusRetry = !sc || (sc === 408 || sc >= 500)
if (er && statusRetry && operation.retry(er)) {
log.warn('retry', 'will retry, error on last attempt: ' + er)
return
}
cb(er, response, shasum)
})
})
}
function fetchAndShaCheck (u, tmp, shasum, auth, cb) {
cb = pulseTillDone('fetchTarball', cb)
npm.registry.fetch(u, { auth: auth }, function (er, response) {
if (er) {
log.error('fetch failed', u)
return cb(er, response)
}
var tarball = writeStreamAtomic(tmp, { mode: npm.modes.file })
tarball.on('error', function (er) {
cb(er)
tarball.destroy()
})
tarball.on('finish', function () {
if (!shasum) {
// Well, we weren't given a shasum, so at least sha what we have
// in case we want to compare it to something else later
return sha.get(tmp, function (er, shasum) {
log.silly('fetchAndShaCheck', 'shasum', shasum)
cb(er, response, shasum)
})
}
// validate that the url we just downloaded matches the expected shasum.
log.silly('fetchAndShaCheck', 'shasum', shasum)
sha.check(tmp, shasum, function (er) {
if (er && er.message) {
// add original filename for better debuggability
er.message = er.message + '\n' + 'From: ' + u
}
return cb(er, response, shasum)
})
})
// 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)
})
}

View File

@ -1,14 +0,0 @@
var assert = require('assert')
var resolve = require('path').resolve
var npm = require('../npm.js')
module.exports = getCacheRoot
function getCacheRoot (data) {
assert(data, 'must pass package metadata')
assert(data.name, 'package metadata must include name')
assert(data.version, 'package metadata must include version')
return resolve(npm.cache, data.name, data.version)
}

View File

@ -1,220 +0,0 @@
module.exports = CachingRegistryClient
var path = require('path')
var fs = require('graceful-fs')
var url = require('url')
var assert = require('assert')
var inherits = require('util').inherits
var RegistryClient = require('npm-registry-client')
var npm = require('../npm.js')
var log = require('npmlog')
var getCacheStat = require('./get-stat.js')
var cacheFile = require('npm-cache-filename')
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
var chownr = require('chownr')
var writeFile = require('write-file-atomic')
var parseJSON = require('../utils/parse-json')
function CachingRegistryClient (config) {
RegistryClient.call(this, adaptConfig(config))
this._mapToCache = cacheFile(config.get('cache'))
// swizzle in our custom cache invalidation logic
this._request = this.request
this.request = this._invalidatingRequest
this.get = get
}
inherits(CachingRegistryClient, RegistryClient)
CachingRegistryClient.prototype._invalidatingRequest = function (uri, params, cb) {
var client = this
this._request(uri, params, function () {
var args = arguments
var method = params.method
if (method !== 'HEAD' && method !== 'GET') {
var invalidated = client._mapToCache(uri)
// invalidate cache
//
// This is irrelevant for commands that do etag / last-modified caching,
// but ls and view also have a timed cache, so this keeps the user from
// thinking that it didn't work when it did.
// Note that failure is an acceptable option here, since the only
// result will be a stale cache for some helper commands.
log.verbose('request', 'invalidating', invalidated, 'on', method)
return rimraf(invalidated, function () {
cb.apply(undefined, args)
})
}
cb.apply(undefined, args)
})
}
function get (uri, params, cb) {
assert(typeof uri === 'string', 'must pass registry URI to get')
assert(params && typeof params === 'object', 'must pass params to get')
assert(typeof cb === 'function', 'must pass callback to get')
var parsed = url.parse(uri)
assert(
parsed.protocol === 'http:' || parsed.protocol === 'https:',
'must have a URL that starts with http: or https:'
)
var cacheBase = cacheFile(npm.config.get('cache'))(uri)
var cachePath = path.join(cacheBase, '.cache.json')
// If the GET is part of a write operation (PUT or DELETE), then
// skip past the cache entirely, but still save the results.
if (uri.match(/\?write=true$/)) {
log.verbose('get', 'GET as part of write; not caching result')
return get_.call(this, uri, cachePath, params, cb)
}
if (params.skipCache) {
return get_.call(this, uri, cachePath, params, cb)
}
var client = this
fs.stat(cachePath, function (er, stat) {
if (!er) {
fs.readFile(cachePath, function (er, data) {
data = parseJSON.noExceptions(data)
params.stat = stat
params.data = data
get_.call(client, uri, cachePath, params, cb)
})
} else {
get_.call(client, uri, cachePath, params, cb)
}
})
}
function get_ (uri, cachePath, params, cb) {
var staleOk = params.staleOk === undefined ? false : params.staleOk
var timeout = params.timeout === undefined ? -1 : params.timeout
var data = params.data
var stat = params.stat
var etag
var lastModified
timeout = Math.min(timeout, npm.config.get('cache-max') || 0)
timeout = Math.max(timeout, npm.config.get('cache-min') || -Infinity)
if (process.env.COMP_CWORD !== undefined &&
process.env.COMP_LINE !== undefined &&
process.env.COMP_POINT !== undefined) {
timeout = Math.max(timeout, 60000)
}
if (data) {
if (data._etag) etag = data._etag
if (data._lastModified) lastModified = data._lastModified
data._cached = true
if (stat && timeout && timeout > 0) {
if ((Date.now() - stat.mtime.getTime()) / 1000 < timeout) {
log.verbose('get', uri, 'not expired, no request')
delete data._etag
delete data._lastModified
return cb(null, data, JSON.stringify(data), { statusCode: 304 })
}
if (staleOk) {
log.verbose('get', uri, 'staleOk, background update')
delete data._etag
delete data._lastModified
process.nextTick(
cb.bind(null, null, data, JSON.stringify(data), { statusCode: 304 })
)
cb = function () {}
}
}
}
var options = {
etag: etag,
lastModified: lastModified,
follow: params.follow,
auth: params.auth
}
this.request(uri, options, function (er, remoteData, raw, response) {
// if we get an error talking to the registry, but we have it
// from the cache, then just pretend we got it.
if (er && cachePath && data && !data.error) {
er = null
response = { statusCode: 304 }
}
if (response) {
log.silly('get', 'cb', [response.statusCode, response.headers])
if (response.statusCode === 304 && (etag || lastModified)) {
remoteData = data
log.verbose(etag ? 'etag' : 'lastModified', uri + ' from cache')
}
}
data = remoteData
if (!data) er = er || new Error('failed to fetch from registry: ' + uri)
if (er) return cb(er, data, raw, response)
saveToCache(cachePath, data, saved)
// just give the write the old college try. if it fails, whatever.
function saved () {
delete data._etag
delete data._lastModified
cb(er, data, raw, response)
}
function saveToCache (cachePath, data, saved) {
log.verbose('get', 'saving', data.name, 'to', cachePath)
getCacheStat(function (er, st) {
mkdirp(path.dirname(cachePath), function (er, made) {
if (er) return saved()
writeFile(cachePath, JSON.stringify(data), function (er) {
if (er) return saved()
chownr(made || cachePath, st.uid, st.gid, saved)
})
})
})
}
})
}
function adaptConfig (config) {
return {
proxy: {
http: config.get('proxy'),
https: config.get('https-proxy'),
localAddress: config.get('local-address')
},
ssl: {
certificate: config.get('cert'),
key: config.get('key'),
ca: config.get('ca'),
strict: config.get('strict-ssl')
},
retry: {
retries: config.get('fetch-retries'),
factor: config.get('fetch-retry-factor'),
minTimeout: config.get('fetch-retry-mintimeout'),
maxTimeout: config.get('fetch-retry-maxtimeout')
},
userAgent: config.get('user-agent'),
log: log,
defaultTag: config.get('tag'),
couchToken: config.get('_token'),
maxSockets: config.get('maxsockets'),
scope: npm.projectScope
}
}

View File

@ -1,6 +0,0 @@
var npm = require('../npm.js')
var correctMkdir = require('../utils/correct-mkdir.js')
module.exports = function getCacheStat (cb) {
correctMkdir(npm.cache, cb)
}

View File

@ -106,6 +106,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
defaults = {
access: null,
'allow-same-version': false,
'always-auth': false,
also: null,
'auth-type': 'legacy',
@ -152,6 +153,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
'ham-it-up': false,
heading: 'npm',
'if-present': false,
'ignore-prepublish': false,
'ignore-scripts': false,
'init-module': path.resolve(home, '.npm-init.js'),
'init-author-name': '',
@ -164,7 +166,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
'legacy-bundling': false,
link: false,
'local-address': undefined,
loglevel: 'warn',
loglevel: 'notice',
logstream: process.stderr,
'logs-max': 10,
long: false,
@ -172,10 +174,13 @@ Object.defineProperty(exports, 'defaults', {get: function () {
message: '%s',
'metrics-registry': null,
'node-version': process.version,
'offline': false,
'onload-script': false,
only: null,
optional: true,
parseable: false,
'prefer-offline': false,
'prefer-online': false,
prefix: globalPrefix,
production: process.env.NODE_ENV === 'production',
'progress': !process.env.TRAVIS && !process.env.CI,
@ -189,7 +194,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
'rebuild-bundle': true,
registry: 'https://registry.npmjs.org/',
rollback: true,
save: false,
save: true,
'save-bundle': false,
'save-dev': false,
'save-exact': false,
@ -210,6 +215,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
'strict-ssl': true,
tag: 'latest',
'tag-version-prefix': 'v',
timing: false,
tmp: temp,
unicode: hasUnicode(),
'unsafe-perm': process.platform === 'win32' ||
@ -233,6 +239,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
exports.types = {
access: [null, 'restricted', 'public'],
'allow-same-version': Boolean,
'always-auth': Boolean,
also: [null, 'dev', 'development'],
'auth-type': ['legacy', 'sso', 'saml', 'oauth'],
@ -270,6 +277,7 @@ exports.types = {
'ham-it-up': Boolean,
'heading': String,
'if-present': Boolean,
'ignore-prepublish': Boolean,
'ignore-scripts': Boolean,
'init-module': path,
'init-author-name': String,
@ -284,7 +292,7 @@ exports.types = {
// local-address must be listed as an IP for a local network interface
// must be IPv4 due to node bug
'local-address': getLocalAddresses(),
loglevel: ['silent', 'error', 'warn', 'http', 'info', 'verbose', 'silly'],
loglevel: ['silent', 'error', 'warn', 'notice', 'http', 'timing', 'info', 'verbose', 'silly'],
logstream: Stream,
'logs-max': Number,
long: Boolean,
@ -292,10 +300,13 @@ exports.types = {
message: String,
'metrics-registry': [null, String],
'node-version': [null, semver],
offline: Boolean,
'onload-script': [null, String],
only: [null, 'dev', 'development', 'prod', 'production'],
optional: Boolean,
parseable: Boolean,
'prefer-offline': Boolean,
'prefer-online': Boolean,
prefix: path,
production: Boolean,
progress: Boolean,
@ -324,6 +335,7 @@ exports.types = {
'sso-type': [null, 'oauth', 'saml'],
'strict-ssl': Boolean,
tag: String,
timing: Boolean,
tmp: path,
unicode: Boolean,
'unsafe-perm': Boolean,

175
deps/npm/lib/config/pacote.js vendored Normal file
View File

@ -0,0 +1,175 @@
'use strict'
const BB = require('bluebird')
const cp = require('child_process')
const npm = require('../npm')
const log = require('npmlog')
const packToStream = require('../utils/tar').packToStream
const path = require('path')
const pipe = BB.promisify(require('mississippi').pipe)
const readJson = BB.promisify(require('read-package-json'))
const PassThrough = require('stream').PassThrough
let effectiveOwner
module.exports = pacoteOpts
function pacoteOpts (moreOpts) {
const ownerStats = calculateOwner()
const opts = {
cache: path.join(npm.config.get('cache'), '_cacache'),
defaultTag: npm.config.get('tag'),
dirPacker: prepareAndPack,
hashAlgorithm: 'sha1',
localAddress: npm.config.get('local-address'),
log: log,
maxAge: npm.config.get('cache-min'),
maxSockets: npm.config.get('maxsockets'),
offline: npm.config.get('offline'),
preferOffline: npm.config.get('prefer-offline') || npm.config.get('cache-min') > 9999,
preferOnline: npm.config.get('prefer-online') || npm.config.get('cache-max') <= 0,
projectScope: npm.projectScope,
proxy: npm.config.get('https-proxy') || npm.config.get('proxy'),
refer: npm.registry.refer,
registry: npm.config.get('registry'),
retry: {
retries: npm.config.get('fetch-retries'),
factor: npm.config.get('fetch-retry-factor'),
minTimeout: npm.config.get('fetch-retry-mintimeout'),
maxTimeout: npm.config.get('fetch-retry-maxtimeout')
},
scope: npm.config.get('scope'),
strictSSL: npm.config.get('strict-ssl'),
userAgent: npm.config.get('user-agent')
}
if (ownerStats.uid || ownerStats.gid) {
Object.assign(opts, ownerStats, {
cacheUid: ownerStats.uid,
cacheGid: ownerStats.gid
})
}
npm.config.keys.forEach(function (k) {
if (k[0] === '/' && k.match(/.*:_authToken$/)) {
if (!opts.auth) { opts.auth = {} }
opts.auth[k.replace(/:_authToken$/, '')] = {
token: npm.config.get(k)
}
}
if (k[0] === '@') {
if (!opts.scopeTargets) { opts.scopeTargets = {} }
opts.scopeTargets[k.replace(/:registry$/, '')] = npm.config.get(k)
}
})
Object.keys(moreOpts || {}).forEach((k) => {
opts[k] = moreOpts[k]
})
return opts
}
function calculateOwner () {
if (!effectiveOwner) {
effectiveOwner = { uid: 0, gid: 0 }
// Pretty much only on windows
if (!process.getuid) {
return effectiveOwner
}
effectiveOwner.uid = +process.getuid()
effectiveOwner.gid = +process.getgid()
if (effectiveOwner.uid === 0) {
if (process.env.SUDO_UID) effectiveOwner.uid = +process.env.SUDO_UID
if (process.env.SUDO_GID) effectiveOwner.gid = +process.env.SUDO_GID
}
}
return effectiveOwner
}
const PASSTHROUGH_OPTS = [
'always-auth',
'auth-type',
'ca',
'cafile',
'cert',
'git',
'local-address',
'maxsockets',
'offline',
'prefer-offline',
'prefer-online',
'proxy',
'https-proxy',
'registry',
'send-metrics',
'sso-poll-frequency',
'sso-type',
'strict-ssl'
]
function prepareAndPack (manifest, dir) {
const stream = new PassThrough()
readJson(path.join(dir, 'package.json')).then((pkg) => {
if (pkg.scripts && pkg.scripts.prepare) {
log.verbose('prepareGitDep', `${manifest._spec}: installing devDeps and running prepare script.`)
const cliArgs = PASSTHROUGH_OPTS.reduce((acc, opt) => {
if (npm.config.get(opt, 'cli') != null) {
acc.push(`--${opt}=${npm.config.get(opt)}`)
}
return acc
}, [])
const child = cp.spawn(process.env.NODE || process.execPath, [
require.main.filename,
'install',
'--ignore-prepublish',
'--no-progress',
'--no-save'
].concat(cliArgs), {
cwd: dir,
env: process.env
})
let errData = []
let errDataLen = 0
let outData = []
let outDataLen = 0
child.stdout.on('data', (data) => {
outData.push(data)
outDataLen += data.length
log.gauge.pulse('preparing git package')
})
child.stderr.on('data', (data) => {
errData.push(data)
errDataLen += data.length
log.gauge.pulse('preparing git package')
})
return BB.fromNode((cb) => {
child.on('error', cb)
child.on('exit', (code, signal) => {
if (code > 0) {
const err = new Error(`${signal}: npm exited with code ${code} while attempting to build ${manifest._requested}. Clone the repository manually and run 'npm install' in it for more information.`)
err.code = code
err.signal = signal
cb(err)
} else {
cb()
}
})
}).then(() => {
if (outDataLen > 0) log.silly('prepareGitDep', '1>', Buffer.concat(outData, outDataLen).toString())
if (errDataLen > 0) log.silly('prepareGitDep', '2>', Buffer.concat(errData, errDataLen).toString())
}, (err) => {
if (outDataLen > 0) log.error('prepareGitDep', '1>', Buffer.concat(outData, outDataLen).toString())
if (errDataLen > 0) log.error('prepareGitDep', '2>', Buffer.concat(errData, errDataLen).toString())
throw err
})
}
}).then(() => {
return pipe(packToStream(manifest, dir), stream)
}).catch((err) => stream.emit('error', err))
return stream
}

View File

@ -13,13 +13,13 @@ var earliestInstallable = require('./install/deps.js').earliestInstallable
var checkPermissions = require('./install/check-permissions.js')
var decomposeActions = require('./install/decompose-actions.js')
var loadExtraneous = require('./install/deps.js').loadExtraneous
var filterInvalidActions = require('./install/filter-invalid-actions.js')
var recalculateMetadata = require('./install/deps.js').recalculateMetadata
var computeMetadata = require('./install/deps.js').computeMetadata
var sortActions = require('./install/diff-trees.js').sortActions
var moduleName = require('./utils/module-name.js')
var packageId = require('./utils/package-id.js')
var childPath = require('./utils/child-path.js')
var usage = require('./utils/usage')
var getRequested = require('./install/get-requested.js')
module.exports = dedupe
module.exports.Deduper = Deduper
@ -36,6 +36,7 @@ function dedupe (args, cb) {
var dryrun = false
if (npm.command.match(/^find/)) dryrun = true
if (npm.config.get('dry-run')) dryrun = true
if (dryrun && !npm.config.get('json')) npm.config.set('parseable', true)
new Deduper(where, dryrun).run(cb)
}
@ -64,10 +65,16 @@ Deduper.prototype.loadIdealTree = function (cb) {
} ],
[this, this.finishTracker, 'loadAllDepsIntoIdealTree'],
[this, function (next) { recalculateMetadata(this.idealTree, log, next) }]
[this, andComputeMetadata(this.idealTree)]
], cb)
}
function andComputeMetadata (tree) {
return function (next) {
next(null, computeMetadata(tree))
}
}
Deduper.prototype.generateActionsToTake = function (cb) {
validate('F', arguments)
log.silly('dedupe', 'generateActionsToTake')
@ -81,7 +88,6 @@ Deduper.prototype.generateActionsToTake = function (cb) {
next()
}],
[this, this.finishTracker, 'sort-actions'],
[filterInvalidActions, this.where, this.differences],
[checkPermissions, this.differences],
[decomposeActions, this.differences, this.todo]
], cb)
@ -129,18 +135,18 @@ function hoistChildren_ (tree, diff, seen, next) {
seen[tree.path] = true
asyncMap(tree.children, function (child, done) {
if (!tree.parent) return hoistChildren_(child, diff, seen, done)
var better = findRequirement(tree.parent, moduleName(child), child.package._requested || npa(packageId(child)))
var better = findRequirement(tree.parent, moduleName(child), getRequested(child) || npa(packageId(child)))
if (better) {
return chain([
[remove, child, diff],
[recalculateMetadata, tree, log]
[andComputeMetadata(tree)]
], done)
}
var hoistTo = earliestInstallable(tree, tree.parent, child.package)
if (hoistTo) {
move(child, hoistTo, diff)
chain([
[recalculateMetadata, hoistTo, log],
[andComputeMetadata(hoistTo)],
[hoistChildren_, child, diff, seen],
[ function (next) {
moveRemainingChildren(child, diff)

View File

@ -39,13 +39,13 @@ function deprecate (args, cb) {
// npa makes the default spec "latest", but for deprecation
// "*" is the appropriate default.
if (p.rawSpec === '') p.spec = '*'
var spec = p.rawSpec === '' ? '*' : p.fetchSpec
mapToRegistry(p.name, npm.config, function (er, uri, auth) {
if (er) return cb(er)
var params = {
version: p.spec,
version: spec,
message: msg,
auth: auth
}

View File

@ -1,22 +1,27 @@
var path = require('path')
var chain = require('slide').chain
var table = require('text-table')
var color = require('ansicolors')
var styles = require('ansistyles')
var semver = require('semver')
var npm = require('./npm.js')
var log = require('npmlog')
var ansiTrim = require('./utils/ansi-trim.js')
var output = require('./utils/output.js')
var defaultRegistry = require('./config/defaults.js').defaults.registry
var checkPing = require('./doctor/check-ping.js')
var getGitPath = require('./doctor/get-git-path.js')
var checksumCachedFiles = require('./doctor/checksum-cached-files.js')
var checkFilesPermission = require('./doctor/check-files-permission.js')
var getLatestNodejsVersion = require('./doctor/get-latest-nodejs-version.js')
var getLatestNpmVersion = require('./doctor/get-latest-npm-version')
var globalNodeModules = path.join(npm.config.globalPrefix, 'lib', 'node_modules')
var localNodeModules = path.join(npm.config.localPrefix, 'node_modules')
'use strict'
const ansiTrim = require('./utils/ansi-trim')
const chain = require('slide').chain
const color = require('ansicolors')
const defaultRegistry = require('./config/defaults').defaults.registry
const log = require('npmlog')
const npm = require('./npm')
const output = require('./utils/output')
const path = require('path')
const semver = require('semver')
const styles = require('ansistyles')
const table = require('text-table')
// steps
const checkFilesPermission = require('./doctor/check-files-permission')
const checkPing = require('./doctor/check-ping')
const getGitPath = require('./doctor/get-git-path')
const getLatestNodejsVersion = require('./doctor/get-latest-nodejs-version')
const getLatestNpmVersion = require('./doctor/get-latest-npm-version')
const verifyCachedFiles = require('./doctor/verify-cached-files')
const globalNodeModules = path.join(npm.config.globalPrefix, 'lib', 'node_modules')
const localNodeModules = path.join(npm.config.localPrefix, 'node_modules')
module.exports = doctor
@ -29,7 +34,7 @@ function doctor (args, silent, cb) {
silent = false
}
var actionsToRun = [
const actionsToRun = [
[checkPing],
[getLatestNpmVersion],
[getLatestNodejsVersion, args['node-url']],
@ -37,15 +42,15 @@ function doctor (args, silent, cb) {
[checkFilesPermission, npm.cache, 6],
[checkFilesPermission, globalNodeModules, 4],
[checkFilesPermission, localNodeModules, 6],
[checksumCachedFiles]
[verifyCachedFiles, path.join(npm.cache, '_cacache')]
]
log.info('doctor', 'Running checkup')
chain(actionsToRun, function (stderr, stdout) {
if (stderr && stderr.message !== 'not found: git') return cb(stderr)
var outHead = ['Check', 'Value', 'Recommendation']
var list = makePretty(stdout)
var outBody = list
const list = makePretty(stdout)
let outHead = ['Check', 'Value', 'Recommendation']
let outBody = list
if (npm.color) {
outHead = outHead.map(function (item) {
@ -60,8 +65,8 @@ function doctor (args, silent, cb) {
})
}
var outTable = [outHead].concat(outBody)
var tableOpts = {
const outTable = [outHead].concat(outBody)
const tableOpts = {
stringLength: function (s) { return ansiTrim(s).length }
}
@ -72,18 +77,18 @@ function doctor (args, silent, cb) {
}
function makePretty (p) {
var ping = p[0] ? 'ok' : 'notOk'
var npmLTS = p[1]
var nodeLTS = p[2].replace('v', '')
var whichGit = p[3] || 'not installed'
var readbleCaches = p[4] ? 'ok' : 'notOk'
var executableGlobalModules = p[5] ? 'ok' : 'notOk'
var executableLocalModules = p[6] ? 'ok' : 'notOk'
var checksumCachedFiles = p[7] ? 'ok' : 'notOk'
var npmV = npm.version
var nodeV = process.version.replace('v', '')
var registry = npm.config.get('registry')
var list = [
const ping = p[1]
const npmLTS = p[2]
const nodeLTS = p[3].replace('v', '')
const whichGit = p[4] || 'not installed'
const readbleCaches = p[5] ? 'ok' : 'notOk'
const executableGlobalModules = p[6] ? 'ok' : 'notOk'
const executableLocalModules = p[7] ? 'ok' : 'notOk'
const cacheStatus = p[8] ? `verified ${p[8].verifiedContent} tarballs` : 'notOk'
const npmV = npm.version
const nodeV = process.version.replace('v', '')
const registry = npm.config.get('registry')
const list = [
['npm ping', ping],
['npm -v', 'v' + npmV],
['node -v', 'v' + nodeV],
@ -92,10 +97,10 @@ function makePretty (p) {
['Perms check on cached files', readbleCaches],
['Perms check on global node_modules', executableGlobalModules],
['Perms check on local node_modules', executableLocalModules],
['Checksum cached files', checksumCachedFiles]
['Verify cache contents', cacheStatus]
]
if (ping !== 'ok') list[0][2] = 'Check your internet connection'
if (p[0] !== 200) list[0][2] = 'Check your internet connection'
if (!semver.satisfies(npmV, '>=' + npmLTS)) list[1][2] = 'Use npm v' + npmLTS
if (!semver.satisfies(nodeV, '>=' + nodeLTS)) list[2][2] = 'Use node v' + nodeLTS
if (registry !== defaultRegistry) list[3][2] = 'Try `npm config set registry ' + defaultRegistry + '`'
@ -103,7 +108,6 @@ function makePretty (p) {
if (readbleCaches !== 'ok') list[5][2] = 'Check the permissions of your files in ' + npm.config.get('cache')
if (executableGlobalModules !== 'ok') list[6][2] = globalNodeModules + ' must be readable and writable by the current user.'
if (executableLocalModules !== 'ok') list[7][2] = localNodeModules + ' must be readable and writable by the current user.'
if (checksumCachedFiles !== 'ok') list[8][2] = 'You have some broken packages in your cache.'
return list
}

Some files were not shown because too many files have changed in this diff Show More