-2

when i try to create a react app by npx create-react-app my-app then throw me this error -

npm ERR! Cannot read properties of null (reading 'pickAlgorithm')

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Tech Point\AppData\Local\npm-cache_logs\2021-12-28T05_28_34_105Z-debug-0.log

Deleting generated file... package.json Deleting my-app5/ from C:\Users\Tech Point Done.

Najmus Sayam
  • 13
  • 1
  • 5

3 Answers3

1

Try the following -

  • Delete node-modules.
  • Delete the given file.
  • Run npm cache clear --force

If the above steps don't work then try the following -

Upgrade the NPM version to v7.23.0 or the latest stable version and do npm install.

The upgrade step was taken from this Solution.

maxagno3
  • 110
  • 2
  • 9
0

Had a similar issue recently. Which Node version are you currently using?

npx create-react myapp worked when I upgraded from Node 12.22.7 to Node 16.13.1 .

Simply switching to Node version 14.0.0 or higher and npm 5.6 or higher should do the trick.

For your reference

Peter Csala
  • 17,736
  • 16
  • 35
  • 75
sandramsc
  • 53
  • 6
-1

check your internet connection then try again "npm create-react-app" command this thing worked in my case.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 04 '22 at 16:13