Yarn start Failed with "Error: Unable to resolve module react-redux" (#883)

Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/883

https://github.com/facebook/flipper/issues/835

Reviewed By: passy

Differential Revision: D20363818

fbshipit-source-id: 66b7cb7236c7b066db32473a9e993ba2ace529bc
This commit is contained in:
Anton Nikolaev
2020-03-10 09:16:23 -07:00
committed by Facebook Github Bot
parent 8a7e0578ff
commit 82881b7463
5 changed files with 31 additions and 20 deletions

View File

@@ -11,10 +11,8 @@ import path from 'path';
import util from 'util';
import globImport from 'glob';
import {exec as execImport} from 'child_process';
import {exists as existsImport, copyFile} from 'fs';
const glob = util.promisify(globImport);
const exec = util.promisify(execImport);
const exists = util.promisify(existsImport);
const PACKAGES = [
'headless-tests',
'static',
@@ -28,9 +26,6 @@ const YARN_PATH =
? path.join(__dirname, process.argv[2])
: 'yarn' + (WINDOWS ? '.cmd' : '');
prepareWatchmanConfig(path.join(__dirname, '..'));
prepareWatchmanConfig(path.join(__dirname, '..', 'static'));
Promise.all(
PACKAGES.map(pattern =>
glob(path.join(__dirname, '..', pattern, 'package.json')),
@@ -68,15 +63,3 @@ Promise.all(
console.error(err);
process.exit(1);
});
async function prepareWatchmanConfig(dir: string) {
const hasGit = exists(path.join(__dirname, '..', '.git'));
const hasWatchmanConfig = exists(path.join(dir, '.watchmanconfig'));
if ((await hasGit) && !(await hasWatchmanConfig)) {
console.log(`Creating .watchmanconfig in ${dir}`);
await util.promisify(copyFile)(
path.join(dir, '_watchmanconfig'),
path.join(dir, '.watchmanconfig'),
);
}
}