Skip to content

Commit

Permalink
Breaking: don't skip downloads in standalone mode
Browse files Browse the repository at this point in the history
I.e. when running `npm install` in the working directory of a
project that uses prebuild-install, you must now run a more
explicit `npm install --build-from-source`.

This is necessary to support npm 7, where we do not have enough
information to automatically determine it and would erroneously
skip downloads on normal installs.
  • Loading branch information
vweevers committed Oct 23, 2020
1 parent 08eaf6d commit b6f3b36
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ if (!isNpm && /node_modules/.test(process.cwd())) {
} else if (opts.force) {
log.warn('install', 'prebuilt binaries enforced with --force!')
log.warn('install', 'prebuilt binaries may be out of date!')
} else if (typeof origin !== 'string') {
log.info('install', 'installing standalone, skipping download.')
process.exit(1)
} else if (origin.length > 4 && origin.substr(0, 4) === 'git+') {
} else if (origin && origin.length > 4 && origin.substr(0, 4) === 'git+') {
log.info('install', 'installing from git repository, skipping download.')
process.exit(1)
} else if (opts.compile === true || opts.prebuild === false) {
Expand Down

0 comments on commit b6f3b36

Please sign in to comment.