Skip to content

init with local react-native fails with EISDIR #186

Closed
@fson

Description

@fson

Environment

Using fson/react-native@8048dc7 and @react-native-community/cli@1.2.4.


  React Native Environment Info:
    System:
      OS: macOS 10.14.3
      CPU: x64 Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz
      Memory: 814.21 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 11.9.0 - /usr/local/bin/node
      Yarn: 1.13.0 - /usr/local/bin/yarn
      npm: 6.8.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5199772
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react-native: /Users/ville/Projects/react-native => 1000.0.0 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Description

I was trying to test facebook/react-native#23563 end-to-end, so I ran react-native init HelloWorld --version <path-to-local-react-native-folder>. This failed with Error: EISDIR: illegal operation on a directory, read.

Output:

% react-native init HelloWorld --version /Users/ville/Projects/react-native
This will walk you through creating a new React Native project in /Users/ville/Projects/HelloWorld
Using yarn v1.13.0
Installing /Users/ville/Projects/react-native...
yarn add v1.13.0
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
...
✨  Done in 59.92s.
Setting up new React Native app in /Users/ville/Projects/HelloWorld
/Users/ville/Projects/HelloWorld/node_modules/react-native/node_modules/graceful-fs/polyfills.js:144
        throw er
        ^

Error: EISDIR: illegal operation on a directory, read
    at Object.readSync (fs.js:515:3)
    at Object.readSync (/Users/ville/Projects/HelloWorld/node_modules/react-native/node_modules/graceful-fs/polyfills.js:138:28)
    at tryReadSync (fs.js:338:20)
    at Object.readFileSync (fs.js:375:19)
    at copyAndReplace (/Users/ville/Projects/HelloWorld/node_modules/react-native/node_modules/@react-native-community/cli/build/util/copyAndReplace.js:77:22)
    at walk.forEach.absoluteSrcFilePath (/Users/ville/Projects/HelloWorld/node_modules/react-native/node_modules/@react-native-community/cli/build/generator/copyProjectTemplateAndReplace.js:94:5)
    at Array.forEach (<anonymous>)
    at copyProjectTemplateAndReplace (/Users/ville/Projects/HelloWorld/node_modules/react-native/node_modules/@react-native-community/cli/build/generator/copyProjectTemplateAndReplace.js:49:17)
    at createProjectFromTemplate (/Users/ville/Projects/HelloWorld/node_modules/react-native/node_modules/@react-native-community/cli/build/generator/templates.js:31:3)
    at generateProject (/Users/ville/Projects/HelloWorld/node_modules/react-native/node_modules/@react-native-community/cli/build/init/init.js:83:3)

Reproducible Demo

This is also reproducible in current master of facebook/react-native:

cd react-native
git checkout f32dc635467a2e93371f0cf2e40b07a712349288
yarn
cd ..
react-native init HelloWorld --version $PWD/react-native

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions