react-native start report: Error: UNKNOWN: unknown error, open …\.babel.json

前端 未结 5 1857
既然无缘
既然无缘 2021-01-13 07:43

I have a RN developing environment on Windows 7. It works fine until yesterday it suddenly reports error after I run \"react-native\" start. The error Message:



        
5条回答
  •  南方客
    南方客 (楼主)
    2021-01-13 08:20

    Try deleting .babel.json, generate a new one and grant read permission to that file.

    You have a babel.json file at C:\Users\Me that is invalid. Fix that or remove that. This was not created by React Native and is not needed unless you want to set some global babel settings for every project on your machine.

    https://github.com/facebook/react-native/issues/11803

    1. Delete .babel.json
    2. react-native run-android (re-generates .babel.json)
    3. open C:\Users\yourUserName\ in Windows Explorer (not IE)
    4. right click on .babel.json > Properties
    5. Security tab > Advanced > Change Permissions... > Add...
    6. Enter the object name to select, type Everyone, click OK
    7. Permissions window, tick "Allow Full Control", click OK
    8. click OK
    9. react-native run-android (works now)

提交回复
热议问题