forked from uber-archive/npm-shrinkwrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.js
79 lines (69 loc) · 2.39 KB
/
errors.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
var TypedError = require('error/typed');
var EmptyFile = TypedError({
message: 'npm-shrinkwrap must not be empty',
type: 'npm-shrinkwrap.missing'
});
var InvalidNPMVersion = TypedError({
type: 'npm-shrinkwrap.invalid_version',
message: 'Using an older version of npm-shrinkwrap.\n' +
'Expected version {existing} but found {current}.\n' +
'To fix: please run `npm install npm-shrinkwrap@{existing}`\n'
});
var NPMError = TypedError({
type: 'npm-shrinkwrap.npm-error',
message: 'Problems were encountered\n' +
'Please correct and try again.\n' +
'{problemsText}',
pkginfo: null,
problemsText: null
});
var InvalidVersionsNPMError = TypedError({
type: 'npm-shrinkwrap.npm-error.invalid-version',
message: 'Problems were encountered\n' +
'Please correct and try again\n' +
'invalid: {name}@{actual} {dirname}/node_modules/{name}',
errors: null,
name: null,
actual: null,
dirname: null
});
var NoTagError = TypedError({
type: 'missing.gitlink.tag',
message: 'Expected the git dependency {name} to have a ' +
'tag;\n instead I found {gitLink}'
});
var NonSemverTag = TypedError({
type: 'gitlink.tag.notsemver',
message: 'Expected the git dependency {name} to have a ' +
'valid version tag;\n instead I found {tag} for the ' +
'dependency {gitLink}'
});
var InvalidPackage = TypedError({
type: 'invalid.packagejson',
message: 'The package.json for module {name} in your ' +
'node_modules tree is malformed.\n Expected JSON with ' +
'a version field and instead got {json}'
});
var InvalidVersion = TypedError({
type: 'invalid.git.version',
message: 'The version of {name} installed is invalid.\n ' +
'Expected {expected} to be installed but instead ' +
'{actual} is installed.'
});
var MissingPackage = TypedError({
type: 'missing.package',
message: 'The version of {name} installed is missing.\n' +
'Expected {expected} to be installed but instead ' +
'found nothing installed.\n'
});
module.exports = {
EmptyFile: EmptyFile,
InvalidNPMVersion: InvalidNPMVersion,
NPMError: NPMError,
InvalidVersionsNPMError: InvalidVersionsNPMError,
NoTagError: NoTagError,
NonSemverTag: NonSemverTag,
InvalidPackage: InvalidPackage,
InvalidVersion: InvalidVersion,
MissingPackage: MissingPackage
};