How to use the napi-build-utils.logUnsupportedVersion function in napi-build-utils

To help you get started, we’ve selected a few napi-build-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github prebuild / prebuild-install / bin.js View on Github external
if (!fs.existsSync('package.json')) {
  log.error('setup', 'No package.json found. Aborting...')
  process.exit(1)
}

if (rc.help) {
  console.error(fs.readFileSync(path.join(__dirname, 'help.txt'), 'utf-8'))
  process.exit(0)
}

log.info('begin', 'Prebuild-install version', prebuildClientVersion)

var opts = Object.assign({}, rc, { pkg: pkg, log: log })

if (napi.isNapiRuntime(rc.runtime)) napi.logUnsupportedVersion(rc.target, log)

var pm = whichPmRuns()
var isNpm = !pm || pm.name === 'npm'

if (!isNpm && /node_modules/.test(process.cwd())) {
  // From yarn repository
} 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 pkg._from === 'string')) {
  log.info('install', 'installing standalone, skipping download.')
  process.exit(1)
} else if (pkg._from.length > 4 && pkg._from.substr(0, 4) === 'git+') {
  log.info('install', 'installing from git repository, skipping download.')
  process.exit(1)
} else if (opts.compile === true || opts.prebuild === false) {

napi-build-utils

A set of utilities to assist developers of tools that build N-API native add-ons

MIT
Latest version published 5 years ago

Package Health Score

65 / 100
Full package analysis