Last change
on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
729 bytes
|
Line | |
---|
1 | # npm-install-checks
|
---|
2 |
|
---|
3 | Check the engines and platform fields in package.json
|
---|
4 |
|
---|
5 | ## API
|
---|
6 |
|
---|
7 | Both functions will throw an error if the check fails, or return
|
---|
8 | `undefined` if everything is ok.
|
---|
9 |
|
---|
10 | Errors have a `required` and `current` fields.
|
---|
11 |
|
---|
12 | ### .checkEngine(pkg, npmVer, nodeVer, force = false)
|
---|
13 |
|
---|
14 | Check if node/npm version is supported by the package. If it isn't
|
---|
15 | supported, an error is thrown.
|
---|
16 |
|
---|
17 | `force` argument will override the node version check, but not the npm
|
---|
18 | version check, as this typically would indicate that the current version of
|
---|
19 | npm is unable to install the package properly for some reason.
|
---|
20 |
|
---|
21 | Error code: 'EBADENGINE'
|
---|
22 |
|
---|
23 | ### .checkPlatform(pkg, force)
|
---|
24 |
|
---|
25 | Check if OS/Arch is supported by the package.
|
---|
26 |
|
---|
27 | Error code: 'EBADPLATFORM'
|
---|
Note:
See
TracBrowser
for help on using the repository browser.