Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --ignore-engines to yarn default options #135

Merged
merged 1 commit into from
Jul 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/dependency-manager-adapters/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,15 @@ module.exports = CoreObject.extend({
debug('Run npm install with options %s', mgrOptions);

var cmd = this.useYarnCommand ? 'yarn' : 'npm';
if (this.useYarnCommand && mgrOptions.indexOf('--no-lockfile') === -1) {
mgrOptions = mgrOptions.concat(['--no-lockfile']);
if (this.useYarnCommand) {
if (mgrOptions.indexOf('--no-lockfile') === -1) {
mgrOptions = mgrOptions.concat(['--no-lockfile']);
}
// npm warns on incompatible engines
// yarn errors, not a good experience
if (mgrOptions.indexOf('--ignore-engines') === -1) {
mgrOptions = mgrOptions.concat(['--ignore-engines']);
}
}

return this.run(cmd, [].concat(['install'], mgrOptions), { cwd: this.cwd }).then(function() {
Expand Down
4 changes: 2 additions & 2 deletions test/dependency-manager-adapters/npm-adapter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('npmAdapter', function() {
writeJSONFile('package.json', fixturePackage);
var runCount = 0;
var stubbedRun = generateMockRun([{
command: 'yarn install --no-lockfile',
command: 'yarn install --no-lockfile --ignore-engines',
callback: function(command, args, opts) {
runCount++;
expect(opts).to.have.property('cwd', tmpdir);
Expand All @@ -139,7 +139,7 @@ describe('npmAdapter', function() {
writeJSONFile('package.json', fixturePackage);
var runCount = 0;
var stubbedRun = generateMockRun([{
command: 'yarn install --flat --no-lockfile',
command: 'yarn install --flat --no-lockfile --ignore-engines',
callback: function() {
runCount++;
return RSVP.resolve();
Expand Down