npx expo-env-info tells it is a bare project and I wanted a managed one so I renamed ios and android folders, npx expo-env-info say it is managed now .
I tried Powershell but same result. It finally worked, the problem was that expo-modules-autolinking/mergeLinkingOptionsAsync/resolveSearchPathsAsync never returned.
It is called from @expo/prebuild-config.
I skipped that call as all the project files are in the same folder, but more research is needed.
can you share information about the full directory path that you are running this from? also, given that you’re comfortable patching this, can you also add some logging statements resolveSearchPathsAsync to see what is happening inside of it?
I narrowed it down to “findDefaultPathsAsync” in expo-modules-autolinking/build/autolinking. Sorry I couldn’t find that repository. The loops never exit when an empty directory is reached.
Project directory is “F:\expoprjs\iostest2” = cwd.
async function findDefaultPathsAsync(cwd) {
const paths = [];
let dir = cwd;
let pkgJsonPath;
while ((pkgJsonPath = await (0, find_up_1.default)('package.json', { cwd: dir }))) {
dir = path_1.default.dirname(path_1.default.dirname(pkgJsonPath));
console.log('findDefaultPathsAsync dir: ' + dir + ' paths: ' + JSON.stringify(paths)); //**//
paths.push(path_1.default.join(pkgJsonPath, '..', 'node_modules'));
}
return paths;
}
Hi, thank you for the report, investigation and fix proposal!
I think this issue is not really specific to Windows — I suspect you just have the package.json at the root path (F:\package.json) and that’s the only case where the loop may not exit. Is that right?
On macOS it’s not possible to write to /package.json though, so that’s probably why we haven’t encountered this issue before
I submitted a PR to fix this: [autolinking] Fixed an infinite loop when the package.json is placed at the root path by tsapeta · Pull Request #17440 · expo/expo · GitHub and I think we’ll publish it later this week.
Hi, you’re right! There was an unrelated old package.json in the root directory.
It’s good that there is already PR to fix this.
I wonder why -p android worked fine without fix
Anyway, thanks for checking it out!