Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find entry file when using pnpm and crna #18156

Closed
vjpr opened this issue Mar 1, 2018 · 5 comments
Closed

Cannot find entry file when using pnpm and crna #18156

vjpr opened this issue Mar 1, 2018 · 5 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@vjpr
Copy link

vjpr commented Mar 1, 2018

When I create an app from create-react-native-app, and then running rm -rf node_modules; pnpm install, the following messaged appears:

2018-03-01 15:42:20.929 [fatal][tid:main] Cannot find entry file node_modules/react-native-scripts/build/bin/crna-entry.js in any of the roots1: [
"/dev/xxx",
"/dev/xxx/node_modules/.registry.npmjs.org/expo/25.0.0/node_modules/expo",
"/dev/xxx/node_modules/.registry.npmjs.org/jest-expo/25.0.0/node_modules/jest-expo","/dev/xxx/node_modules/.registry.npmjs.org/json-schema-traverse/0.3.1/node_modules/json-schema-traverse",
"/dev/xxx/node_modules/.registry.npmjs.org/react/16.2.0/node_modules/react",
"/dev/xxx/node_modules/.registry.npmjs.org/react-native/0.52.0/node_modules/react-native",
"/dev/xxx/node_modules/.registry.npmjs.org/react-native-scripts/1.11.1/node_modules/react-native-scripts",
"/dev/xxx/node_modules/.registry.npmjs.org/react-test-renderer/16.2.0/node_modules/

But it is in the /dev/xxx, but in pnpm all node_modules are symlinks.

In HasteFS in jest-haste-map:

exists(file) {
  console.log('exists?', file, this._files[file])
  return !!this._files[file];
}

...prints:

exists? /dev/xxx/node_modules/react-native-scripts/build/bin/crna-entry.js undefined

So it seems HasteFS is not handling symlinks correctly.

Environment

react-native info
Scanning folders for symlinks in /xxx/node_modules/.registry.npmjs.org/react-native/0.52.0/node_modules (7ms)

Environment:
  OS: macOS Sierra 10.12.6
  Node: 8.9.0
  Yarn: 1.3.2
  npm: 5.6.0
  Watchman: 4.7.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
  react: 16.2.0 => 16.2.0
  react-native: 0.52.0 => 0.52.0

Related

pnpm/pnpm#940

@vjpr
Copy link
Author

vjpr commented Mar 1, 2018

So it look like Haste doesn't follow symlinks. jestjs/jest#1477

And lack of symlink support seems to be a popular RN issue: facebook/metro#1

I think an easy fix might be to use a realpath for the entry file. Trying now.

@vjpr
Copy link
Author

vjpr commented Mar 1, 2018

You can do this by changing the package.json main entry to ./node_modules/.registry.npmjs.org/react-native-scripts/1.11.1/node_modules/react-native-scripts/build/bin/crna-entry.js.

After changing it you need to Dismiss the RSOD and then press Try Again or it won't update.

To check its using the right path you can add a console.log here: node_modules/.registry.npmjs.org/metro/0.24.7/node_modules/metro/src/node-haste/DependencyGraph.js:279


Still gets stuck after this and eventually times out. Must be more issues with symlinks.

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest stable release?

Thank you for your contributions.

How to ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added Old Version Ran Commands One of our bots successfully processed a command. labels Mar 3, 2018
@octogonz
Copy link

octogonz commented Mar 7, 2018

@dzearing FYI

@hramos
Copy link
Contributor

hramos commented May 24, 2018

Looks like this is something that should be reported in the create-react-native-app repository.

@hramos hramos closed this as completed May 24, 2018
@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label May 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants