首页 > 解决方案 > React Native node_modules package errors

问题描述

enter image description hereWhile trying to run the server with the command 'node server', I'm getting an Error:

C:...path...\node_modules\react-native\index.js:13
import typeof AccessibilityInfo from './Libraries/Components/AccessibilityInfo/AccessibilityInfo';
^^^^^^

SyntaxError: Cannot use import statement outside a module

I tried to figure out the error, and got into that 'index', I saw a lot of errors like:

import typeof AccessibilityInfo from './Libraries/Components/AccessibilityInfo/AccessibilityInfo';

Error saying: ';' expected.

I did not mess with the node_modules package so I've no idea where did those errors came from.

Versions:

"react": "~16.11.0",


"react-native": "https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz",

Anyone who knows how to handle that problem ?

标签: javascriptnode.jsreactjsreact-nativeserver

解决方案


推荐阅读