OS: windows 10
React-pdf version: 0.7.5
Description: I get the error below when I do
"yarn add @react-pdf/core"
error An unexpected error occurred: "C:\Code\kenleyr\Projects\JavaScript\DaveyJS3
ode_modules\yoga-layout: Command failed.
Exit code: 1
Command: C:\WINDOWS\system32\cmd.exe
Arguments: /d /s /c npm run build:node
Directory: C:\Code\kenleyr\Projects\JavaScript\DaveyJS3
ode_modules\yoga-layout
Output:
[email protected] build:node C:\Code\kenleyr\Projects\JavaScript\DaveyJS3
ode_modules\yoga-layout
npm run copy-sources && autogypi && node-gyp configure build
[email protected] copy-sources C:\Code\kenleyr\Projects\JavaScript\DaveyJS3
ode_modules\yoga-layout
! npm -s run is-monolithic || (rsync -r --checksum --delete ../yoga/ sources/yoga/)
'!' is not recognized as an internal or external command,
operable program or batch file.
'rsync' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] copy-sources: ! npm -s run is-monolithic || (rsync -r --checksum --delete ../yoga/ sources/yoga/)
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] copy-sources script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\kenleyr\AppData\Roaming
pm-cache\_logs\2018-03-21T20_18_11_578Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:node: npm run copy-sources && autogypi && node-gyp configure build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:node script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
May be related to #185
I don't have a Windows machine to test. I've been trying to find the time to setup a windows VM to test the lib, but I couldn't yet. Some help in here would be very welcomed. Are you open to contribute somehow with the fixes needed for Windows?
Sure. How can I help?
It seems to be a yoga issue. Maybe the first test can be creating a new project and installing yoga in there to see if it installs correctly in windows.
That was my first thought and I can confirm that you are correct that yoga is the main culprit.
I tried both yarn and npm when trying to install yoga only. I was able to get past the rsync error.
https://itefix.net/cwrsync
But I can't figure out the rest.
! npm -s run is-monolithic || (rsync -r --checksum --delete ../yoga/ sources/yoga/)
'!' is not recognized as an internal or external command,
operable program or batch file.
rsync: change_dir "/cygdrive/c/Code/kenleyr/Projects/JavaScript/DaveyJS3/node_modules/yoga-layout//../yoga" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
npm ERR! code ELIFECYCLE
npm ERR! errno 23
npm ERR! [email protected] copy-sources: ! npm -s run is-monolithic || (rsync -r --checksum --delete ../yoga/ sources/yoga/)
npm ERR! Exit status 23
@diegomura
I tried running the install under git bash. No luck there either.
I tried installing yoga first in git bash, got a little bit further although I had to skip the copy-sources, but still ended up with a TON of build errors.
@rexkenley
Temp workaround is to run yarn in bash under WSL (Windows Subsystem for Linux).
1) Install Ubuntu WSL from MS Store
2) Install node (your node modules sync, you don't even need to download/install them again)
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash
sudo apt-get install -y nodejs
3) bash & yarn install 馃憣
There's even a config option for VSCode (if you use it) to use as default WSL node version
https://blogs.msdn.microsoft.com/commandline/2017/10/27/running-node-js-on-wsl-from-visual-studio-code/
This refers to old react-pdf build. Closing this now, and in case there still issues please open a new one related to last version
I am having this issue right now .
@diegomura what / where is the newer build that you are referencing?
When I run
npm i @react-pdf/renderer
I am getting the same error :
Failed at the [email protected] install script
I also tried the yoga-layout-windows, but to no avail. I probably did not use it properly?
any advice would be great!
Thanks all.
we got the same issue too.
you can check a build (pretty a same): https://travis-ci.org/GroceriStar/showcase/jobs/435321047
I also found that it required rsync. This can be installed by running the following command:
choco install rsync
I also found that the yoga layout for windows worked for me but it needed to come before react pdf in the package.json.
just to let know( I actually test it on my windows machine)
With the latest release 1.0.0 - packages installation and builds working fine.
i deleted yoga-layout and react-pdf renderer and reinstall only react-pdf renderer
so in my case - everything is working perfectly. Big thanks to @diegomura & @DuncanMacWeb
Likewise here! I clean install of react-pdf renderer is working very nicely. :) 馃巻 馃帀
Most helpful comment
just to let know( I actually test it on my windows machine)
With the latest release 1.0.0 - packages installation and builds working fine.
i deleted
yoga-layoutandreact-pdf rendererand reinstall onlyreact-pdf rendererso in my case - everything is working perfectly. Big thanks to @diegomura & @DuncanMacWeb