create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

"npx create-react-app my-app" not working

Open prafullepili opened this issue 4 years ago • 3 comments

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

added 1901 packages, and audited 1902 packages in 1m

153 packages are looking for funding run npm fund for details

27 vulnerabilities (16 moderate, 9 high, 2 critical)

To address all issues, run: npm audit fix

Run npm audit for details. Git repo not initialized Error: Command failed: git --version at checkExecSyncError (node:child_process:826:11) at execSync (node:child_process:900:15) at tryGitInit (E:\nagesh'sFolder\my-app\node_modules\react-scripts\scripts\init.js:46:5) at module.exports (E:\nagesh'sFolder\my-app\node_modules\react-scripts\scripts\init.js:283:7) at [eval]:3:14 at Script.runInThisContext (node:vm:129:12) at Object.runInThisContext (node:vm:305:38) at node:internal/process/execution:81:19 at [eval]-wrapper:6:22 at evalScript (node:internal/process/execution:80:60) { status: 1, signal: null, output: [ null, null, null ], pid: 16888, stdout: null, stderr: null }

Installing template dependencies using npm...

added 57 packages, and audited 1959 packages in 6s

154 packages are looking for funding run npm fund for details

27 vulnerabilities (16 moderate, 9 high, 2 critical)

To address all issues (including breaking changes), run: npm audit fix --force

Run npm audit for details. Removing template package using npm...

removed 1 package, and audited 1958 packages in 4s

154 packages are looking for funding run npm fund for details

27 vulnerabilities (16 moderate, 9 high, 2 critical)

To address all issues (including breaking changes), run: npm audit fix --force

Run npm audit for details.

Success! Created my-app at E:\nagesh'sFolder\my-app Inside that directory, you can run several commands:

npm start Starts the development server.

npm run build Bundles the app into static files for production.

npm test Starts the test runner.

npm run eject Removes this tool and copies build dependencies, configuration files and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

cd my-app npm start

Happy hacking!

=======================after this, when I'm try 'npm start' then:===============

./src/index.js 1:38 Module parse failed: Unexpected token (1:38) File was processed with these loaders:

  • ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
  • ./node_modules/babel-loader/lib/index.js You may need an additional loader to handle the result of these loaders.

$RefreshRuntime$ = require('E:/nagesh'sFolder/my-app/node_modules/react-refresh/runtime.js'); | $RefreshSetup$(module.id); |

prafullepili avatar Dec 01 '21 09:12 prafullepili

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

stale[bot] avatar Jan 08 '22 22:01 stale[bot]

Hi, I bumped into this issue and this seems to be triggered by react-scripts versions >= 5.0.0.

I resolved it by reverting to version 4.X.X:

create-react-app YOUR-APP-NAME --scripts-version 4.0.3

kennyfrc avatar Oct 11 '22 08:10 kennyfrc

嗨,我遇到了这个问题,这似乎是由 react-scripts 版本 >= 5.0.0 触发的。

我通过恢复到版本 4.X.X 解决了它:

create-react-app YOUR-APP-NAME --scripts-version 4.0.3

Awesome, I'm running into this issue too

IntelliJCLion avatar Jan 06 '24 08:01 IntelliJCLion