Skip to content

Install fails #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
joehoyle opened this issue May 25, 2022 · 1 comment
Open

Install fails #90

joehoyle opened this issue May 25, 2022 · 1 comment

Comments

@joehoyle
Copy link
Member

Following the guidelines on the readme, running (node 16):

npx create-react-app dashboard --scripts-version react-wp-scripts --php-namespace="Dashboard" ./

I get this error:

 dashboard % npx create-react-app dashboard --scripts-version react-wp-scripts --php-namespace="Dashboard" ./
Need to install the following packages:
  create-react-app
Ok to proceed? (y) 
npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.

Creating a new React app in /Users/joe/altis/vantage-backend/content/themes/dashboard/dashboard.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-wp-scripts with cra-template...


added 1743 packages in 39s

73 packages are looking for funding
  run `npm fund` for details
Could not locate supplied template: /Users/joe/altis/vantage-backend/content/themes/dashboard/cra-template
React WP Scripts loader could not be copied to your root folder. Error details:
Error: ENOENT: no such file or directory, open '/Users/joe/altis/vantage-backend/content/themes/dashboard/dashboard/src/index.js'
@sorensenjg
Copy link

sorensenjg commented Oct 27, 2022

@joehoyle I found the solution to this problem. The project only works with create-react-app up to version 2. This command works:

npx create-react-app@2 app-name --scripts-version react-wp-scripts --php-namespace="Your_Namespace" /path/to/your/project/folder

Looks like react-wp-scripts needs to be updated to support the latest create-react-app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants