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

Build failure when trying to run npm start #197

Closed
JasonArkens17 opened this issue Jul 26, 2016 · 12 comments
Closed

Build failure when trying to run npm start #197

JasonArkens17 opened this issue Jul 26, 2016 · 12 comments

Comments

@JasonArkens17
Copy link

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.

@eanplatter
Copy link
Contributor

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

@JasonArkens17
Copy link
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!

@mxstbr
Copy link
Contributor

mxstbr commented Jul 26, 2016

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!

@mxstbr mxstbr closed this as completed Jul 26, 2016
@mxstbr mxstbr removed the issue: bug label Jul 26, 2016
@JasonArkens17
Copy link
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?

@gaearon
Copy link
Contributor

gaearon commented Jul 26, 2016

Can you try creating another project?

@JasonArkens17
Copy link
Author

I have tried several times to no avail.

@gaearon
Copy link
Contributor

gaearon commented Jul 27, 2016

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?

@JasonArkens17
Copy link
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)

@JasonArkens17
Copy link
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)

@gaearon
Copy link
Contributor

gaearon commented Jul 27, 2016

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

@JasonArkens17
Copy link
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!

@gaearon
Copy link
Contributor

gaearon commented Jul 27, 2016

No problem, thanks for explaining!

@lock lock bot locked and limited conversation to collaborators Jan 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants