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

react-native run-android throw new TypeError('invalid data');^ TypeError: invalid data at WriteStream.Socket.write (net.js:617:11) #6074

Closed
ducpm0301 opened this issue Feb 22, 2016 · 8 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@ducpm0301
Copy link

I use ubuntu 14.04. I have finished install follow link : https://facebook.github.io/react-native/docs/getting-started.html. And create : react-native init AwesomeProject success but when i run command : react-native run-android, i have problem : net.js:617
throw new TypeError('invalid data');
^

TypeError: invalid data
at WriteStream.Socket.write (net.js:617:11)
at Object.execFileSync (child_process.js:482:20)
at Object.run (/AwesomeProject/node_modules/react-native/local-cli/cli.js:77:16)
at Object. (/usr/local/lib/node_modules/react-native-cli/index.js:73:7)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:134:18)

My envirement :

  • uname -a
    Linux cpu-duclh 3.16.0-60-generic Cannot run examples #80~14.04.1-Ubuntu SMP Wed Jan 20 13:37:48 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    -nodejs -v
    v4.3.1
    npm -v
    2.14.12
    Please help me!!!
@ducpm0301 ducpm0301 changed the title Hi react-native run-android throw new TypeError('invalid data');^ TypeError: invalid data at WriteStream.Socket.write (net.js:617:11) Feb 22, 2016
@sebluy
Copy link

sebluy commented Mar 18, 2016

This worked on my machine:
chmod +x /node_modules/react-native/local-cli/setup_env.sh

Problem seems to be at
https://github.com/facebook/react-native/blob/master/local-cli/cli.js#L77
when the cli tries to run that setup script.

In my case I was copying my project between machines, so setup_env.sh could have just lost its execute bits somewhere along the line.

@mvnnn
Copy link

mvnnn commented May 24, 2016

i get same error

@BoluoPi
Copy link

BoluoPi commented Aug 22, 2016

i get same error
@mvnnn @sebluy @ducpm0301
Would you please share your solution?

@ducpm0301
Copy link
Author

Because some file haven't permission so it errors. I use Ubuntu with two
hard disk. I put code in mount disk with full permission(777) but also get
the errors. When i put code in home folder, it ok

On Mon, Aug 22, 2016 at 4:38 PM, BoluoPi notifications@github.com wrote:

i get same error
@mvnnn https://github.com/mvnnn @sebluy https://github.com/sebluy
@ducpm0301 https://github.com/ducpm0301
Would you please share your solution?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#6074 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AD3nhsRAz3ifYHfZ2NqVsbzK1-ynZp0gks5qiW4ngaJpZM4HfPHZ
.

@leo7r
Copy link

leo7r commented Aug 23, 2016

Same error here. Same solution of @ducpm0301. Thanks!

1 similar comment
@rahul-kamble
Copy link

Same error here. Same solution of @ducpm0301. Thanks!

@TangHuaiZhe
Copy link

TangHuaiZhe commented Oct 14, 2016

Almost Same error here.
Same solution of @sebluy.
Thanks!!!

TypeError: Invalid data, chunk must be a string or buffer, not object
at WriteStream.Socket.write (net.js:647:11)
at WriteStream.stream.write (/Users/tang/Code/sdpQrcodePay/node_modules/ansi/lib/newlines.js:36:21)
at Object.execFileSync (child_process.js:493:20)
at Object.run (/Users/tang/Code/sdpQrcodePay/node_modules/react-native/local-cli/cliEntry.js:154:16)
at Object. (/Users/tang/.nvm/versions/node/v6.2.0/lib/node_modules/react-native-cli/index.js:88:7)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)

@lacker
Copy link
Contributor

lacker commented Feb 10, 2017

It sounds like this is solved as a non-RN-bug, so I am going to close this issue. Thanks folks for chiming in with solutions!

@lacker lacker closed this as completed Feb 10, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

10 participants