Commit Graph

228 Commits

Author SHA1 Message Date
Alex Kocharin
ff46366bd4 append original filename to shasum error 2013-12-17 21:13:11 -05:00
Domenic Denicola
966373fad8 Use path-is-inside@1.0.0 to fix #4313. 2013-12-16 15:37:20 -08:00
Domenic Denicola
19b6d72f0f Fix incorrect is-inside-a-directory checking.
This caused me serious problems when my npm config had the cache
location set to `C:\Users\Domenic\AppData\Roaming\npm-cache`, but my
`process.cwd()` value was `c:\Users\...`, i.e. the drive letter casing
was mismatched.

In general, the problem was that is-inside-this-directory checking was
done with `potentialChild.indexOf(parent) === 0`, which fails for case
-insensitive filesystems. Anyone who had manually configured their
cache or tmp location, without matching the system's casing exactly,
would have run into this problem.

In particular, the failure to use the correct detection method caused
npm to try to run prepublish scripts for *everything*.

Why did this manifest now? It may be a Node 0.11 issue, or perhaps a
Windows 8.1 one. My other computer, running Node 0.10 and Windows 8,
does not exhibit the lowercase `process.cwd()` value.
2013-12-02 16:13:53 -08:00
Sergey Belov
c625de9177 Pass GIT_SSL_NO_VERIFY to git command execution 2013-12-02 16:08:09 -08:00
Robert Kowalski
baafe15bd1 Tell users it's not our fault when no compatible versions are found
Fixes #3810
2013-11-02 18:37:44 +01:00
isaacs
8713681cb3 Don't force tarballs to same proto as registry
Except if they are actually hosted on the registry as an attachment.

This is a requirement to make detached registry tarballs work.
2013-10-27 14:51:30 -07:00
isaacs
0ede484fa3 cache: Small style fixup
Needed to make this more readable because I had to read it,
and was failing.
2013-10-27 14:51:30 -07:00
isaacs
2389525a1d Run prepublish on tarball generation
Fixes #3854
2013-09-13 18:53:56 +01:00
François Frisch
7ac339c420 use getCacheStat before lock, fixes joyent/node#3821
Previous code did not handle the cache dir's permissions consistently.
If the first lock was done as sudo, the cache directory was not user
writable.
Removed the now unnecessary guard and collapsed the then function.
2013-08-14 18:36:50 -04:00
isaacs
081f43bac2 cache: Never be strict (for now) 2013-07-27 07:49:28 -07:00
Robert Kowalski
49fda3afb0 fix global leak 2013-07-12 20:42:15 -07:00
isaacs
c8596f30af Don't print 'unbuild' on install
Confusing to say 'this is being deleted' when that's the thing that
you're actually PUTTING there.  Only print the unbuilt pkg when it's
an explicit uninstall/unbuild command.
2013-07-11 00:31:30 -07:00
Robert Kowalski
dec660c2a1 ls: show git urls in parentheses
If a project specifies git urls for dependencies these are shown
in parentheses after the name@version to make it easier for
users to recognize potential forks of a project.

Fixes #3570
2013-06-25 01:19:08 -04:00
isaacs
b8db927278 Update everything to work with semver@2 2013-06-20 14:01:21 -07:00
isaacs
96cec36f82 cache: Handle cases where git url contains host more than once
Slight fixup for #3224
2013-06-06 14:18:40 -07:00
isaacs
54e68d429e Don't put a / on resolved gitosis-style git urls
Fixes #3224
2013-06-06 14:14:26 -07:00
Robert Kowalski
82b9e7d1da Show an error message if git is missing, fixes #3297 2013-05-10 17:04:28 -07:00
Raynos
291e854d74 pass silent flag into addRemoteGit to error silently
With the change to maybeGithub where it now tries both the
	public and private git uris we should allow
	addRemoteGit to not print errors to stdout since that
	function is now recoverable by means of retry.

We only call addRemoteGit with silent set to true the first time
	and call it with silent set to false the second time
	so that when the cloning process fails the second time
	it will print to stdout/stderr
2013-05-03 11:14:18 -07:00
Raynos
a03622cf18 Update maybeGithub to try private git repositories
- Fixes #3076
  - Will make namespace style lookups take a bit longer
  - Will make it a LOT easier to install private repos. Now it's
	`npm i Company/module` instead of remembering the
	specific ssh uri dance.
2013-05-03 10:59:43 -07:00
ForbesLindesay
f44b1fd093 replace ./lib/utils/sha.js with sha
closes #3381
2013-04-28 21:20:09 -07:00
Robert Kowalski
8e879f558e remove exec.js, use child_process.execFile
Fixes #3312
2013-04-28 21:06:52 -07:00
Maciej Małecki
60583077b9 Fail on empty name
Trying to install a package with an empty name globally leads to
removing all global node modules.
2013-03-28 01:09:55 +01:00
isaacs
463e6ec2e7 pass data along in addNamedTag 2013-03-19 22:49:54 -07:00
isaacs
ce14e1792c Handle gh shorthands that are not in the registry 2013-03-12 16:29:24 -07:00
Jaakko Manninen
48263bf152 set permissions after git clone, fix #3117 2013-03-04 08:17:20 -08:00
isaacs
a3d9965f10 cache: Remove race condition in git fetch/resolve
Fix #3199
2013-03-03 19:18:26 -08:00
isaacs
b7c2b1c398 Log _id of packages that lack a shasum 2013-02-15 19:18:24 -08:00
isaacs
3f2ade79d2 Make version and name optional (mostly)
Fix #3146

Version and name are still required to add to the cache folder,
or to publish, so you'll have to name your packages before installing
them in some other place.

However, this cleans up the process a bit for master branches and folks
using branches for releases that don't get folded back in.
2013-02-11 11:33:08 -08:00
isaacs
f468b62f01 Raise error if registry packages lack shasum, or if crypto is not available 2013-02-11 10:13:45 -08:00
isaacs
49c4b4ba7a cache: Stash shasum from registry all the way through the pipeline 2013-02-11 10:13:45 -08:00
isaacs
f71fb045c5 cache: Don't unlock files we didn't lock 2013-02-05 16:46:15 -08:00
isaacs
cb03d1da87 Fix missed origUrl arg passing 2013-01-29 22:21:28 -08:00
isaacs
f89d0ceea6 Save correct resolved git url, unmangled 2013-01-29 17:18:39 -08:00
Carl Lange
e4e0019dff added ENOTDIR check anywhere readJson is used 2013-01-18 14:06:41 -08:00
isaacs
8f77ea9cbe fix #3046 --save properly when installing github shorthands 2013-01-17 13:12:32 -08:00
isaacs
aaf7dab8c3 stash resolved data on data._resolved
Close #3054
2013-01-14 20:57:48 -08:00
isaacs
17c99c6590 cache.js: Minor refactoring and cleanup 2013-01-14 20:55:18 -08:00
isaacs
e79e774681 git-remotes: Refactor code out of one function
Also, this makes the exec util use the 'close' event instead of 'exit',
since we're assuming that the data is all out by that point.
2013-01-14 17:54:32 -08:00
Patrick Pfeiffer
29489b9ae0 cache git-dependencies 2013-01-13 16:30:27 -08:00
Ian Livingstone
b00bd7f9ca Add GIT_SSH to list of environment variables to copy 2013-01-02 01:13:01 +01:00
isaacs
00f781f6dc Crash on readJson errors other than ENOENT 2012-12-27 17:25:53 -08:00
Nathan Zadoks
115d67d0db use the archives from GitHub.
Uses GitHub-provided tars instead of using git directly. This also makes
providing refs work for GitHub deps.
2012-12-26 08:58:48 -08:00
isaacs
bfcd368e50 Support username/project as a shorthand for github urls 2012-10-12 14:34:07 -07:00
Marsup
0f48e69b18 Do not ignore GIT_PROXY_COMMAND on install 2012-08-06 12:46:27 -07:00
isaacs
1977584a97 Replace lib/utils/output.js with console.log 2012-07-16 13:28:37 -07:00
isaacs
af8c981c04 Fix #2597 Don't set GIT_* envs in child processes 2012-07-13 14:55:39 -07:00
isaacs
92c16c4236 cache: Let the registry client handle --no-reg 2012-07-11 10:06:02 -07:00
isaacs
a8d986e728 Fix #2590 Keep lockFile names short 2012-07-05 15:03:41 -07:00
isaacs
d517f420c2 Stronger protection around parallel installs
Now all tarball pack/unpack operations are wrapped in a lock
2012-06-29 11:40:10 -07:00
isaacs
419ffa0505 Make the fetch retry behavior configurable 2012-06-28 18:48:11 -07:00