How to resolve the error on 'react-native start'

后端 未结 19 2525
说谎
说谎 2020-11-29 15:41
  1. I just installed node.js & cli

    • installed node.js
    • installed react-native-cli

      npm -g react-native-cli
      
相关标签:
19条回答
  • 2020-11-29 16:27

    I found the regexp.source changed from node v12.11.0, maybe the new v8 engine caused. see more on https://github.com/nodejs/node/releases/tag/v12.11.0.

    D:\code\react-native>nvm use 12.10.0
    Now using node v12.10.0 (64-bit)
    
    D:\code\react-native>node
    Welcome to Node.js v12.10.0.
    Type ".help" for more information.
    > /node_modules[/\\]react[/\\]dist[/\\].*/.source
    'node_modules[\\/\\\\]react[\\/\\\\]dist[\\/\\\\].*'
    > /node_modules[/\\]react[/\\]dist[/\\].*/.source.replace(/\//g, path.sep)
    'node_modules[\\\\\\\\]react[\\\\\\\\]dist[\\\\\\\\].*'
    >
    (To exit, press ^C again or ^D or type .exit)
    >
    
    D:\code\react-native>nvm use 12.11.0
    Now using node v12.11.0 (64-bit)
    
    D:\code\react-native>node
    Welcome to Node.js v12.11.0.
    Type ".help" for more information.
    > /node_modules[/\\]react[/\\]dist[/\\].*/.source
    'node_modules[/\\\\]react[/\\\\]dist[/\\\\].*'
    > /node_modules[/\\]react[/\\]dist[/\\].*/.source.replace(/\//g, path.sep)
    'node_modules[\\\\\\]react[\\\\\\]dist[\\\\\\].*'
    >
    (To exit, press ^C again or ^D or type .exit)
    >
    
    D:\code\react-native>nvm use 12.13.0
    Now using node v12.13.0 (64-bit)
    
    D:\code\react-native>node
    Welcome to Node.js v12.13.0.
    Type ".help" for more information.
    > /node_modules[/\\]react[/\\]dist[/\\].*/.source
    'node_modules[/\\\\]react[/\\\\]dist[/\\\\].*'
    > /node_modules[/\\]react[/\\]dist[/\\].*/.source.replace(/\//g, path.sep)
    'node_modules[\\\\\\]react[\\\\\\]dist[\\\\\\].*'
    >
    (To exit, press ^C again or ^D or type .exit)
    >
    
    D:\code\react-native>nvm use 13.3.0
    Now using node v13.3.0 (64-bit)
    
    D:\code\react-native>node
    Welcome to Node.js v13.3.0.
    Type ".help" for more information.
    > /node_modules[/\\]react[/\\]dist[/\\].*/.source
    'node_modules[/\\\\]react[/\\\\]dist[/\\\\].*'
    > /node_modules[/\\]react[/\\]dist[/\\].*/.source.replace(/\//g, path.sep)
    'node_modules[\\\\\\]react[\\\\\\]dist[\\\\\\].*'
    >
    
    0 讨论(0)
提交回复
热议问题