1'use strict'; 2 3const common = require('../common'); 4const assert = require('assert'); 5const child_process = require('child_process'); 6const path = require('path'); 7 8const releaseReg = /^v\d+\.\d+\.\d+$/; 9 10// Npm requires crypto support. 11if (!releaseReg.test(process.version) || !common.hasCrypto) { 12 common.skip('This test is only for release builds'); 13} 14 15{ 16 // Verify that npm does not print out a warning when executed. 17 18 const npmCli = path.join(__dirname, '../../deps/npm/bin/npm-cli.js'); 19 const npmExec = child_process.spawnSync(process.execPath, [npmCli]); 20 21 const stderr = npmExec.stderr.toString(); 22 assert.strictEqual(stderr.length, 0, 'npm is not ready for this release ' + 23 'and is going to print warnings to users:\n' + stderr); 24} 25