facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.76k stars 26.87k forks source link

Could not find a required file. Name: index.js #13035

Open SANKARAMDAS opened 1 year ago

SANKARAMDAS commented 1 year ago

After creating a react app using file extension tsx, > yarn start - showing error(images) - " yarn start yarn run v1.22.19 $ react-scripts start Could not find a required file. Name: index.js Searched in: E:\VS Code Project\portfoliov4\src error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. ation about this command. " 2023-02-27 2023-02-27 (2)

Any Idea what's the issue?

Jbonez87 commented 1 year ago

Could you share your package.json and what command you used to create the project? Did you add the --template typescript flag when your ran npx create-react-app portfoliov4?

SANKARAMDAS commented 1 year ago

Hi @Jbonez87, Actually, it's a project I clone from git.. Project link(https://github.com/bashleigh/another-portfolio)

And package.json is - { "name": "another-portfolio", "version": "1.0.0", "repository": "git@github.com:bashleigh/another-portfolio.git", "author": "Aaryanna Simonelli ashleighsimonelli@gmail.com", "license": "MIT", "devDependencies": { "@types/node": "^14.14.21", "@types/react": "^17.0.0", "@types/react-dom": "^17.0.0", "prettier": "^2.2.1" }, "browserslist": [ "defaults" ], "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.35", "@fortawesome/free-brands-svg-icons": "^5.15.3", "@fortawesome/free-solid-svg-icons": "^5.15.3", "@fortawesome/react-fontawesome": "^0.1.14", "@octokit/core": "^3.2.5", "bulma": "^0.9.1", "gatsby": "^2.30.3", "gatsby-image": "^2.9.0", "gatsby-plugin-google-gtag": "^2.7.0", "gatsby-plugin-react-helmet": "^3.9.0", "gatsby-plugin-react-svg": "^3.0.0", "gatsby-plugin-sass": "^3.0.0", "gatsby-plugin-sharp": "^2.12.2", "gatsby-plugin-typescript": "^2.10.0", "gatsby-source-filesystem": "^2.9.1", "gatsby-transformer-sharp": "^2.10.1", "node-sass": "^5.0.0", "react": "^17.0.1", "react-dom": "^17.0.1", "react-helmet": "^6.1.0", "react-highlight-words": "^0.17.0", "react-swipeable": "^6.0.1", "shleemy": "^1.2.2", "typescript": "^4.1.3" }, "scripts": { "start": "gatsby develop", "serve": "gatsby serve", "build": "gatsby build", "develop": "gatsby develop", "dev": "gatsby develop", "format": "prettier --write \"*/.{js,jsx,ts,tsx,json,md}\"" } }

Jbonez87 commented 1 year ago

I see. Well what happens when you run yarn build? It looks like it's not compiling index.tsx to index.js.

SANKARAMDAS commented 1 year ago

Yarn build - ERROR

[object Object] Processing E:/VS Code Project/another-portfolio-4/src/images/fordandsons.png failed

Original error: Command failed with ENOENT: E:\VS Code Project\another-portfolio-4\node_modules\pngquant-bin\vendor\pngquant.exe - --strip
--quality 50-75 spawn E:\VS Code Project\another-portfolio-4\node_modules\pngquant-bin\vendor\pngquant.exe ENOENT
'E:\VS Code Project\another-portfolio-4\node_modules\pngquant-bin\vendor\pngquant.exe' is not
recognized as an internal or external command, operable program or batch file.

WorkerError: Processing E:/VS Code Project/another-portfolio-4/src/images/fordandso ns.png failed Original error: Command failed with ENOENT: E:\VS Code Project\another-portfolio-4\node_modules\png quant-bin\vendor\pngquant.exe - --strip --quality 50-75 spawn E:\VS Code Project\another-portfolio-4\node_modules\pngquant-bin\vendor\pngqu ant.exe ENOENT 'E:\VS Code Project\another-portfolio-4\node_modules\pngquant-bin\vendor\pngquant.e xe' is not recognized as an internal or external command, operable program or batch file.

image are already there with .png extension.

If I run gatsby develop, It's showing - warn Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db

Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating

ERROR

error:0308010C:digital envelope routines::unsupported

Error: error:0308010C:digital envelope routines::unsupporte d

I already update npx browserslist@latest --update-db, still throwing the same error.

SANKARAMDAS commented 1 year ago

Even if I delete the node_module folder and clear the cache, and start yarn from starting, the same error is throwing.