Skip to content

Commit

Permalink
Respect ignore engines flag.
Browse files Browse the repository at this point in the history
Fixes #638
  • Loading branch information
samccone committed Oct 11, 2016
1 parent 131bc3a commit 20836da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cli/commands/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export class Install {

this.resolver = new PackageResolver(config, lockfile);
this.fetcher = new PackageFetcher(config, this.resolver);
this.compatibility = new PackageCompatibility(config, this.resolver);
this.compatibility = new PackageCompatibility(config, this.resolver, this.flags.ignoreEngines);
this.linker = new PackageLinker(config, this.resolver, this.flags.ignoreOptional);
this.scripts = new PackageInstallScripts(config, this.resolver, this.flags.force);
}
Expand Down
5 changes: 3 additions & 2 deletions src/package-compatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,11 @@ export function testEngine(name: string, range: string, versions: Versions, loos
}

export default class PackageCompatibility {
constructor(config: Config, resolver: PackageResolver) {
constructor(config: Config, resolver: PackageResolver, ignoreEngines: boolean) {
this.reporter = config.reporter;
this.resolver = resolver;
this.config = config;
this.ignoreEngines = ignoreEngines;
}

resolver: PackageResolver;
Expand Down Expand Up @@ -148,7 +149,7 @@ export default class PackageCompatibility {
}
}

if (!this.config.ignoreEngines && typeof info.engines === 'object') {
if (!this.ignoreEngines && typeof info.engines === 'object') {
for (const entry of entries(info.engines)) {
let name = entry[0];
const range = entry[1];
Expand Down

0 comments on commit 20836da

Please sign in to comment.