-1

I have been working with react for years using NPX and yarn and I just got assign to built an app with react-native using react native-cli so i tried setting up my environment using the react native docs and some YouTube videos. But after following the instructions like downloading android studios and adding in my new environment variable, I'm getting an error every time i tired to run

"npx react-native init AwesomeProject" which gave me this error [![npx react-native init result][1]][1]

I also tried npm install and i got this error on git bash and also on my commandline

npm ERR! syscall spawn bash
npm ERR! path C:\Users\Dennis\Desktop\GitHub\LCRN01-travel-onboarding-app-master\LCRN01-travel-onboarding-app-master\node_modules\core-js
npm ERR! errno -4058
npm ERR! enoent spawn bash ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Dennis\AppData\Local\npm-cache\_logs\2021-11-13T05_50_35_592Z-debug.log```

and also npx react-native start is showing this error on git bash

```openssl config failed: error:02001003:system library:fopen:No such process
Command `start` unrecognized. Make sure that you have run `npm install` and that you are inside a react-native project.```

I have tried running "npm cache clean --force"
but still nothing changed

I can't even run npx create-react-app anymore because i keep getting this error

npx creat-react-app test npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/creat-react-app - Not found npm ERR! 404 npm ERR! 404 'creat-react-app@latest' is not in this registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Dennis\AppData\Local\npm-cache_logs\2021-11-13T06_05_46_068Z-debug.log


I'm currently using a windows 10 device

node -v 16.13.0

npm -v 8.1.3




  [1]: https://i.stack.imgur.com/OTLYj.png
Amila Senadheera
  • 12,229
  • 15
  • 27
  • 43
The Newbie
  • 11
  • 8
  • i used npx when working with react-native and i installed a new version of node recently, but what do you mean by clean up @cherryDT – The Newbie Nov 13 '21 at 08:43

1 Answers1

-1

It's create-react-app.

Not totally sure but another issue could be that your Git bash isn't in your PATH.

Plus, npx start and npx install doesn't sound right, maybe you meant npm start and npm install.

On top of that, it seems you have node v11 and not node v16, maybe you have different versions of node, some in Windows' PATH and some only accessible from bash.

It could help to clean up and reinstall your node versions and Git bash, also check your environment variables for remnants of previous versions, and make sure to not confuse npm and npx.

CherryDT
  • 25,571
  • 5
  • 49
  • 74