简体   繁体   English

如何解决 React Native package 错误问题并在 windows 系统中运行应用程序

[英]How to resolve React Native package error issue and run the app in windows system

I'm completely new into react native.我对本机反应完全陌生。 Trying to run an existing react native app after cloning it into my system => weather-app in windows but getting the below package error while trying to run the project in my windows system after doing npm start: Trying to run an existing react native app after cloning it into my system => weather-app in windows but getting the below package error while trying to run the project in my windows system after doing npm start:

$ npm start

> Weather@0.1.0 start C:\Users\subho\Desktop\subhojits-weather-app
> react-native-scripts start

7:22:54 PM: Starting packager...
***ERROR STARTING PACKAGER***
Warning: 'react' peer dependency missing. Run `npm ls` in C:\Users\subho\Desktop\subhojits-weather-app to see full warning.

If there is an issue running your project, please run `npm install` in C:\Users\subho\Desktop\subhojits-weather-app and restart.
Starting React Native packager...
Scanning folders for symlinks in C:\Users\subho\Desktop\subhojits-weather-app\node_modules (110ms)

Invalid regular expression: /(.*\\__fixtures__\\.*|node_modules[\\\]react[\\\]dist[\\\].*|website\\node_modules\\.*|heapCapture\\bundle\.js|.*\\__tests__\\.*)$/: Unterminated character class

I'm also unaware about what are the other process I need to follow to successfully run the app in my windows system.我也不知道在我的 windows 系统中成功运行应用程序需要遵循的其他过程是什么。 It would be nice if step by step process can be mentioned in the answer as well.如果答案中也可以提到逐步过程,那就太好了。 Any help would be appreciated regarding the issue.任何有关此问题的帮助将不胜感激。

Try downgrading your node version, to 12.9.1 it should work.尝试将您的节点版本降级到 12.9.1,它应该可以工作。

You should run this npx react-native-windows-init --overwrite and then try你应该运行这个npx react-native-windows-init --overwrite然后尝试

I see you have a regular expression error which is causing this problem.我看到你有一个导致这个问题的正则表达式错误。 Slash on windows and other OS differed and cause this problem. windows 和其他操作系统上的斜线不同并导致此问题。

The issue you see could be because of this issue.您看到的问题可能是由于这个问题。 https://github.com/microsoft/react-native-windows/issues/4698 https://github.com/microsoft/react-native-windows/issues/4698

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM