hyva-themes / magento2-checkout-example

A React Checkout template that allows you to quickly create a customized Hyvä Checkout for your project.
11 stars 2 forks source link

fix hyva/react-checkout path #3

Closed Morgy93 closed 2 years ago

Morgy93 commented 2 years ago

The current path throws an error on npm install:

npm ERR! Could not install from "../../../vendor/hyva-themes/magento2-hyva-checkout/src/reactapp/src" as it does not contain a package.json file.

Because the package.json is one folder before the given path.

rajeev-k-tomy commented 2 years ago

@Morgy93 Thanks for this PR.

I tried to reproduce this issue. But, it is working fine in my case. Can you please provide the npm, nodejs version of yours. It will be helpful if you can provide the exact steps to reproduce this issue.

Can you try this by removing package-lock.json if it was already present inside reactapp directory?

Morgy93 commented 2 years ago

@progammer-rkt

I tried with: Node: v14.17.1 & NPM: 6.14.13 Node: v16.3.0 & NPM: 7.15.1

Steps:

cd to/magento2/root
cd app/code/
rm -rf Hyva/CheckoutExample
mkdir -p Hyva/CheckoutExample
git clone https://github.com/hyva-themes/magento2-checkout-example.git Hyva/CheckoutExample/
ls Hyva/CheckoutExample/reactapp/node_modules -> No such file or directory
ls Hyva/CheckoutExample/reactapp/package-lock.json -> No such file or directory

Checking the Checkout in Magento:

magento module:enable Hyva_CheckoutExample
magento setup:upgrade

-> The Checkout is broken at this point in Magento, it doesn't load.

image (It just pulsates all the time, no error is thrown)

However, trying to setup ReactApp:

cd Hyva/CheckoutExample/reactapp/
npm install

Results in:

npm ERR! code ENOLOCAL
npm ERR! Could not install from "../../../../../vendor/hyva-themes/magento2-hyva-checkout/src/reactapp/src" as it does not contain a package.json file.
Morgy93 commented 2 years ago

This must be some environment issue, this PR is irrelevant.

Closed~