yoga: NPM build fails on Windows

When installing with yarn on Windows the following is produced:

> yoga-layout@1.0.1 copy-sources C:\Users\User\Documents\experiment-flex\node_modules\yoga-layout
> ! npm -- run is-monolithic || (rsync -r --checksum --delete ../yoga/ sources/yoga/)

'!' is not recognized as an internal or external command,
operable program or batch file.

Unfortunately bash is officially unsupported with npm on Windows, even when using cygwin or similar (see https://github.com/npm/npm/issues/9420). When trying to manually build the following is produced, meaning the native build is also broken:

..\node_modules\node-gyp\bin\node-gyp.js" "configure" "build" "--asmjs=1" )  else (node "" "configure" "build" "--asmjs=1" )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  Copying ../nbind/dist/em-api.js to Release\obj\nbind\\em-api.js
          1 file(s) copied.
  Copying ../nbind/src/pre.js to Release\obj\nbind\\pre.js
          1 file(s) copied.
  Copying ../nbind/src/post.js to Release\obj\nbind\\post.js
          1 file(s) copied.
  YGNodeList.c
  Yoga.c
  Node.cc
  global.cc
  nbind.cc
  common.cc
..\..\nbind\src\common.cc(6): error C2871: 'nbind': a namespace with this name does not exist [C:\Users\User\Documents\experiment-flex\node_modules\yoga-layout\build\nbi                                                                          nd.vcxproj]
..\..\nbind\src\common.cc(9): error C2653: 'nbind': is not a class or namespace name [C:\Users\User\Documents\experiment-flex\node_modules\yoga-layout\build\nbind.vcxpro                                                                          j]

Would building on Windows be possible in the future, or having a precompiled library included? It’s currently preventing us from using the library as many of our developers use Windows.

Also, version 1.1.0 was not published to npm, not sure if that was intentional.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

This issue should be re-opened. The scripts still rely on shell syntax that does not work on Windows.

Is there any chance it will be fixed?

If building on windows isn’t support, I really hope you’ll find a way to provide the precompiled javascript libs separately so developers can install from npm on any machine. something like npm install yoga-layout-js would be perfect!

At this point it’s going to take me a heck of a lot of work to get an environment set up that will allow me to even pull down the npm build, just so I can grab the asm files and then add them to my project manually since npm won’t install things on win7 due to these errors.

should be open