Luehang / react-paypal-button-v2

An easy and simple to use React button component to implement PayPal Checkout with Smart Payment Buttons V2 (Version 2).
https://luehangs.site/lue_hang/projects/react-paypal-button-v2
MIT License
275 stars 81 forks source link

[BUG] ssr rendering on netlify (rimraf issue) #23

Closed slk333 closed 5 years ago

slk333 commented 5 years ago

the version 2.4 didn't build on Netlify because your module tries to use rimraf without linking it as a dependency. npm install rimraf -s fixed it.

Luehang commented 5 years ago

Hi,

What is your use case? Those commands are only development purposes and the package should come completely compiled.

slk333 commented 5 years ago

2:58:40 PM: > react-paypal-button-v2@2.4.0 preinstall /opt/build/repo/node_modules/react-paypal-button-v2
2:58:40 PM: > rimraf dist

In the build log, Netlify uses rimraf. Before I installed manually, it would crash since rimraf was not installed.

I have no idea why Netlify uses rimraf to install your module!

slk333 commented 5 years ago

a different output that might help also:

2:35:49 PM: error /opt/build/repo/node_modules/react-paypal-button-v2: Command failed.
2:35:49 PM: Exit code: 127
2:35:49 PM: Command: rimraf dist
2:35:49 PM: Arguments:
2:35:49 PM: Directory: /opt/build/repo/node_modules/react-paypal-button-v2
2:35:49 PM: Output:
2:35:49 PM: /bin/sh: 1: rimraf: not found
pateljigar053 commented 5 years ago

I am experiencing the same issue. Please help.

error /builds/starr-project/tax-collector-registry/node_modules/react-paypal-button-v2: Command failed. Exit code: 127 Command: rimraf dist Arguments: Directory: /builds/starr-project/tax-collector-registry/node_modules/react-paypal-button-v2 Output: /bin/sh: 1: rimraf: not found info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.`

slk333 commented 5 years ago

try yarn global add rimraf

checor commented 5 years ago

I'm experiencing the same problem on the latest release. Does installing rimraf global is a solution to for netlify? I'm currently not using it but I will use it in the future.

codemacabre commented 5 years ago

Just encountered the same issue doing a local installation. Presumably rimraf is used without being required as a dependency. Fixed by installing rimraf as above.

EDIT: Fixed on my local machine, but neither yarn add rimraf nor yarn add -D rimraf solve the issue on Netlify. 😞

slk333 commented 5 years ago

@Luehang can you add rimraf as a dependency? thanks!

Luehang commented 5 years ago

Hi,

Install latest to solve that platform error. Thanks.

:large_blue_diamond: Install

$ npm install react-paypal-button-v2@2.4.1 --save

or

$ yarn add react-paypal-button-v2@2.4.1
fablanglet commented 5 years ago

Hello,

I still have the issue with 2.4.1 using GitLab CI Should I install package by myself?

react-paypal-button-v2@2.4.1 preinstall /builds/fablanglet/pasquinade-project/front-office/node_modules/react-paypal-button-v2 rimraf dist

sh: 1: rimraf: not found

Thank you

kyliepace commented 5 years ago

same.

Luehang commented 5 years ago

Hi,

You could try installing the rimraf package first.

$ npm install rimraf --save

or

$ yarn add rimraf

Let me know if that works!

Raghav-Maheshwari commented 4 years ago

@Luehang

Having trouble compiling the latest version of this package @2.6.0 on Heroku as well because rimraf is missing:

> rimraf dist
sh: 1: rimraf: not found

This happens even after I install the rimraf package to my repository

howdyhyber commented 4 years ago

I also encountered this issue.

It works fine in local machine but when i deploy my app to production, it will not work.

GabinhoJean commented 4 years ago

Hi everyone.

I also have this issue.

its works locally but not online.

i am using the version 2.6.0 of react-paypal-button-v2.

i tried to change the version for one more old like 2.4.1 and i tried to install manually rimraf with the command: npm install rimraf --save but the problem is not solved

npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! react-paypal-button-v2@2.6.0 preinstall: rimraf dist npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the react-paypal-button-v2@2.6.0 preinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

EDIT : i edited my automated script and i installed first the package rimraf with the command: npm install rimraf and then i done my global dependencies installation of package.json with: npm install and its works now. maybe react-paypal-button-v2 was installed before rimraf

Luehang commented 4 years ago

Hi,

Install latest to solve that error. Thanks.

:large_blue_diamond: Install

$ npm install react-paypal-button-v2@2.6.1 --save

or

$ yarn add react-paypal-button-v2@2.6.1
howdyhyber commented 4 years ago

It works! Thank you for the response!