fix: skip sha check when providing PKG_NODE_PATH (#50)
This commit is contained in:
parent
e436d74e4c
commit
76bc9d0bbf
11
lib/index.ts
11
lib/index.ts
@ -62,9 +62,7 @@ export function satisfyingNodeVersion(nodeRange: string) {
|
||||
const nodeVersion = versions.pop();
|
||||
|
||||
if (!nodeVersion) {
|
||||
throw wasReported(
|
||||
`No available node version satisfies '${nodeRange}'`
|
||||
);
|
||||
throw wasReported(`No available node version satisfies '${nodeRange}'`);
|
||||
}
|
||||
|
||||
return nodeVersion;
|
||||
@ -85,7 +83,6 @@ export function getNodeVersion(nodeRange: string) {
|
||||
return nodeVersion;
|
||||
}
|
||||
|
||||
|
||||
export async function need(opts: NeedOptions) {
|
||||
// eslint-disable-line complexity
|
||||
const { forceFetch, forceBuild, dryRun, output, nodeRange } = opts || {};
|
||||
@ -126,7 +123,11 @@ export async function need(opts: NeedOptions) {
|
||||
return 'exists';
|
||||
}
|
||||
|
||||
if ((await hash(fetched)) === EXPECTED_HASHES[remote.name]) {
|
||||
// when node path is set, skip hash check
|
||||
if (
|
||||
!!process.env.PKG_NODE_PATH ||
|
||||
(await hash(fetched)) === EXPECTED_HASHES[remote.name]
|
||||
) {
|
||||
return fetched;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user