Your version looks like it’s a compiled/transpiled version of the original source, so it looks to me like it’s basically the same as the one Brent linked to.
What happens if you edit it to add some console.log()
statements? Is it actually being called? Which return
statement is being called?
I actually don’t think that’s the right place to look for your issue.
If I have a look on my machine I see this:
$ pwd
/Users/michael/.config/yarn/global/node_modules/expo-cli
$ grep -rl 'currently only supports managed workflow apps' .
./build/commands/build/utils.js
./build/commands/build/utils.js.map
The message is coming from utils.js in the following function:
async function maybeBailOnWorkflowWarning({
projectRoot,
platform,
nonInteractive
}) {
const {
workflow
} = await ProjectUtils().findProjectRootAsync(projectRoot);
if (workflow === 'managed') {
return false;
}
const command = `expo build:${platform}`;
_log().default.warn(_chalk().default.bold(`⚠️ ${command} currently only supports managed workflow apps.`));
[...]
So workflow
is set by calling findProjectRootAsync()
which is in ./build/commands/utils/ProjectUtils.js
:
async function findProjectRootAsync(base) {
let previous = null;
let dir = base;
do {
try {
var _pkg$dependencies, _pkg$dependencies2;
// This will throw if there is no package.json in the directory
const pkg = await _jsonFile().default.readAsync(_path().default.join(dir, 'package.json'));
const hasReactNativeUnimodules = (_pkg$dependencies = pkg.dependencies) === null || _pkg$dependencies === void 0 ? void 0 : _pkg$dependencies.hasOwnProperty('react-native-unimodules');
const hasExpo = (_pkg$dependencies2 = pkg.dependencies) === null || _pkg$dependencies2 === void 0 ? void 0 : _pkg$dependencies2.hasOwnProperty('expo');
const isManaged = hasExpo && !hasReactNativeUnimodules;
const workflow = isManaged ? 'managed' : 'bare';
return {
projectRoot: dir,
workflow
};
} catch {// Expected to throw if no package.json is present
} finally {
previous = dir;
dir = _path().default.dirname(dir);
}
} while (dir !== previous);
throw new (_CommandError().default)('NO_PROJECT', 'No managed or bare projects found. Please make sure you are inside a project folder.');
} // If we get here and can't find expo-updates or package.json we just assume
// that we are not using the old expo-updates
That looks like it tries to find a package.json
in your current directory and if it doesn’t find one it keeps searching parent, grandparent, etc. directories until it gets to the root. I assume you do have a package.json
in the root of your project, and that it is checked in to Git and not in your .gitignore
file.
Once it has a package.json
it does some checks on the dependencies. If there are no dependencies, or if one of your dependencies is called “react-native-unimodules
” it sets hasReactNativeUnimodules
to true.
hasExpo
is set to true if one of your dependencies is called “expo
”.
If hasExpo
is true and also, hasReactNativeUnimodules
is false, then isManaged
is set to true. Otherwise it’s set to false.
If isManaged
is true, then workflow
is set to “managed
”. Otherwise “bare
”.
If I were to guess, you have previously run expo prebuild
or expo run:ios
and it added react-native-unimodules
to your dependencies. Then you deleted the android
and ios
directories, but did not notice the additional deps.