Skip to content

Build failure when trying to run npm start  #197

Closed

Description

@JasonArkens17

Whenever I run npm start I get the following error:

Failed to compile.

Error in ./src/index.js
Module build failed: Error: EISDIR: illegal operation on a directory, read
at Error (native)
@ multi main

I have tried uninstalling and reinstalling node and npm.

Activity

  1. eanplatter commented on Jul 26, 2016

    @eanplatter
    Contributor

    Hrm, weird. Can you give some more details? What node version are you running on? What operating system are you running?

  2. JasonArkens17 commented on Jul 26, 2016

    @JasonArkens17
    Author

    I am currently running node 4.4.3 via nvm. Before I had been running 6.3.1 but thought maybe that was the problem. I have tried uninstalling and reinstalling node several times as well. I am currently running the latest version of OS X which I updated two days ago. Thanks for getting back to me btw!

  3. mxstbr commented on Jul 26, 2016

    @mxstbr
    Contributor

    This is likely a problem with your .npmrc, this means that somewhere within it there's a path to a directory that no longer exists.

    This is not a problem with create-react-app but with your environment, so I'll close this for now – feel free to continue talking though!

  4. JasonArkens17 commented on Jul 26, 2016

    @JasonArkens17
    Author

    So after trying to find my .npmrc folder I do not seem to have one? All of the paths listed on the npm website as to where it should live do not exists. Any one have any suggestions?

  5. gaearon commented on Jul 26, 2016

    @gaearon
    Contributor

    Can you try creating another project?

  6. JasonArkens17 commented on Jul 26, 2016

    @JasonArkens17
    Author

    I have tried several times to no avail.

  7. gaearon commented on Jul 27, 2016

    @gaearon
    Contributor

    Is

    Module build failed: Error: EISDIR: illegal operation on a directory, read
    at Error (native)
    @ multi main

    the complete stack trace you have?

    Can you try creating the project in different folders?

    Which guide have you followed for reinstalling Node?

  8. JasonArkens17 commented on Jul 27, 2016

    @JasonArkens17
    Author

    I have tried the project build in several locations both on my desktop and root directory. That is unfortunately the full stack trace I get back. I am also running into the problem when trying to do react-native builds and regular react project builds. I have pasted in the stack trace for those below. As far as deleting node, I have tried several different methods. I found a guide on GitHub gist that listed all the relevant file paths to manually delete. I used a shell script put someone put together. I tried installing with HomeBrew and uninstalling with HomeBrew as well. Someone suggested it has something to do with my .npmrc file. When I went looking for that it seems I do not even have one.

    ERROR in ./index.jsx
    Module build failed: Error: EISDIR: illegal operation on a directory, read
        at Error (native)
        at Object.fs.readSync (fs.js:603:19)
        at Object.fs.readFileSync (fs.js:438:24)
        at ConfigChainBuilder.addConfig (/Users/jasondavenport/Desktop/RealTime/ReelTime/node_modules/babel-core/lib/transformation/file/options/build-config-chain.js:151:32)
        at ConfigChainBuilder.findConfigs (/Users/jasondavenport/Desktop/RealTime/ReelTime/node_modules/babel-core/lib/transformation/file/options/build-config-chain.js:107:30)
        at buildConfigChain (/Users/jasondavenport/Desktop/RealTime/ReelTime/node_modules/babel-core/lib/transformation/file/options/build-config-chain.js:66:13)
        at OptionManager.init (/Users/jasondavenport/Desktop/RealTime/ReelTime/node_modules/babel-core/lib/transformation/file/options/option-manager.js:346:58)
        at File.initOptions (/Users/jasondavenport/Desktop/RealTime/ReelTime/node_modules/babel-core/lib/transformation/file/index.js:223:65)
        at new File (/Users/jasondavenport/Desktop/RealTime/ReelTime/node_modules/babel-core/lib/transformation/file/index.js:140:24)
        at Pipeline.transform (/Users/jasondavenport/Desktop/RealTime/ReelTime/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
        at transpile (/Users/jasondavenport/Desktop/RealTime/ReelTime/node_modules/babel-loader/index.js:14:22)
        at Object.module.exports (/Users/jasondavenport/Desktop/RealTime/ReelTime/node_modules/babel-loader/index.js:88:12)
  9. JasonArkens17 commented on Jul 27, 2016

    @JasonArkens17
    Author

    Here is another stack trace when trying to run a react-native build

    fs.js:603
      var r = binding.read(fd, buffer, offset, length, position);
                      ^
    
    Error: EISDIR: illegal operation on a directory, read
        at Error (native)
        at Object.fs.readSync (fs.js:603:19)
        at Object.fs.readFileSync (fs.js:438:24)
        at ConfigChainBuilder.addConfig (/Users/jasondavenport/hello-world-2/Test3/node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/build-config-chain.js:151:32)
        at ConfigChainBuilder.findConfigs (/Users/jasondavenport/hello-world-2/Test3/node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/build-config-chain.js:107:30)
        at buildConfigChain (/Users/jasondavenport/hello-world-2/Test3/node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/build-config-chain.js:66:13)
        at OptionManager.init (/Users/jasondavenport/hello-world-2/Test3/node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:346:58)
        at compile (/Users/jasondavenport/hello-world-2/Test3/node_modules/react-native/node_modules/babel-register/lib/node.js:104:45)
        at loader (/Users/jasondavenport/hello-world-2/Test3/node_modules/react-native/node_modules/babel-register/lib/node.js:151:14)
        at Object.require.extensions.(anonymous function) [as .js] (/Users/jasondavenport/hello-world-2/Test3/node_modules/react-native/node_modules/babel-register/lib/node.js:161:7)
  10. gaearon commented on Jul 27, 2016

    @gaearon
    Contributor

    Try logging fs.readFileSync arguments. This should give you a good guess as to which file it’s looking for.

  11. JasonArkens17 commented on Jul 27, 2016

    @JasonArkens17
    Author

    You are the man. I went ahead and logged the directory fs.readFileSync was trying to open and it was some random package.json folder living in my home directory. I deleted it and everything is working. I am assuming this is due to npm's behavior of looking up into parent directories for any package.json it can find for commands. In this case it was finding the random folder, trying to read it and failing. I cannot thank you enough!

  12. gaearon commented on Jul 27, 2016

    @gaearon
    Contributor

    No problem, thanks for explaining!

  13. locked and limited conversation to collaborators on Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions