Create-react-app: Full Windows support

Created on 17 Jul 2016  路  17Comments  路  Source: facebook/create-react-app

I believe @insin has access to Windows鈥攚ould be great if we could keep track of things that are still broken/missing there. Let鈥檚 close this issue when the support is complete.

@insin Can I ask you to write up a checklist if there鈥檚 more than a few broken things so we keep track of them?

TODO:

  • [x] fix eject
  • [x] fix fs-events crash on install
  • [x] fix fs-events crash on eject
  • [x] bundle-deps shouldn't be in dependencies

All 17 comments

Sure, I'll try all the commands & scripts from scratch when I get some time and report back.

I'm your worst case user - using npm2 on Windows, running on the cheapest Lenovo laptop Amazon UK had 5 months ago, with a crap CPU and an HDD :smile_cat:

Anything which uses vanilla Babel 6 presets is pretty miserable to install on npm2 with this setup due to the duplicated dependencies for each plugin.

Yeah.. I wonder if we can do something crazy like put all non-binary deps in a tarball or something.

Until the packages are public, you can do this to test the full flow:

npm i -g counter-redux@qwertyuiop
create-react-app whatever --scripts-version react-elmish-example@bundled

Tried it with npm 2.15.8 (currently the default suggested windows install flow). Tiny problem: the unicode hourglass shows up as a square in powershell. Larger problem: fsevents apparently depends on having python installed. (I don't normally use this as a dev machine.) I'll see if there's a workaround. Here's the error for the record.
nopython

Interesting. fsevents is optional, on OS X it gets installed for faster rebuilds but webpack should work without it. Can you also try

create-react-app whatever --scripts-version react-elmish-example@no-bundle

to see if fsevents doesn't show up this way?

Ah I see fsevents is OS X only. With @no-bundle now both the create-react-app phase and the npm start are working for me. I'll poke around to see if I can break anything else.

Eh, that鈥檚 not fun. Maybe I could exclude whatever depends on fsevents from the bundle but keep the rest bundled.

Another problem - when I eject and then run start, it can't find webpack any more. But when I manually run a npm install after that, it works fine. I suspect that whatever logic runs an npm install immediately after ejecting is not working on Windows.
eject-then-start

A little nitpick: the message for npm run build is incorrect on Windows.

You can now serve it with any static server:
  cd build
  python -m SimpleHTTPServer 9000
  open http://localhost:9000

because open isn't a windows thing. AFAICT there is no Windows command line equivalent so unless someone has a good idea maybe just leave this message as is.

Yeah, I was hoping that maybe people would just read it as a word if they know there is no such command. Open to better ideas (can check platform?)

OK I can't find any more ways to break it. So just two big things, fsevents in the bundle and the eject-then-start problem. Unrelated: @gaearon would you mind briefly checking FB messenger? I just wanted to ask you a quick question there. :P

For the build message, you could check for process.platform being 'win32' and use start instead of open.

Windows doesn't ship with a Python installation, though - a handy alternative would be to recommend npm install -g http-server and running hs.

955ea330df0339cadf337a72bafbf806163dfd8c

Do you have an AppVeyor account to run CI on Windows?

Better to have things checked automatically on all platforms, but new tests would need to be written.

I think we鈥檙e good. I鈥檒l double check now.

Okay, final prerelease:

npm i -g counter-redux@qwertyuiop
create-react-app my-app --scripts-version react-elmish-example@pretty-close

Also when installing, if it throws a "JSON" error and crashes, try running this command:

create-react-app appname --save

or create-react-app appname --save-exact and then try again.

if it persists you can try using a newer version of node.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DaveLindberg picture DaveLindberg  路  3Comments

jnachtigall picture jnachtigall  路  3Comments

alleroux picture alleroux  路  3Comments

fson picture fson  路  3Comments

adrice727 picture adrice727  路  3Comments