Skip to content

Commit

Permalink
Ensure we look for package json in the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfranklin authored and mathiasbynens committed Jun 25, 2020
1 parent c28c6f6 commit 1b4e7a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common/Puppeteer.ts
Expand Up @@ -173,7 +173,7 @@ export class Puppeteer {
this._lazyLauncher.product !== this._productName ||
this._changedProduct
) {
const { packageJson } = readPkgUp.sync();
const { packageJson } = readPkgUp.sync({ cwd: __dirname });
switch (this._productName) {
case 'firefox':
this._preferredRevision = packageJson.puppeteer.firefox_revision;
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Expand Up @@ -18,7 +18,9 @@ import { initializePuppeteer, InitOptions } from './initialize';
import * as path from 'path';
import readPkgUp from 'read-pkg-up';

const packageJsonResult = readPkgUp.sync();
const packageJsonResult = readPkgUp.sync({
cwd: __dirname,
});
const packageJson = packageJsonResult.packageJson as unknown;

const rootDir = path.dirname(packageJsonResult.path);
Expand Down

0 comments on commit 1b4e7a1

Please sign in to comment.