Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facing error (0 , (_wordwrap || _load_wordwrap(...)).default)(...)(...).trimStart is not a function on expo init

I am trying to create react native application with Expo. As per react native official documentation, I have installed Node 8+ (v8.12.0) & expo-cli on my windows system and then run command expo init AwesomeProject. But its giving error as

(0 , (_wordwrap || _load_wordwrap(...)).default)(...)(...).trimStart is not a function
Set EXPO_DEBUG=true in your env to view the stack trace.

When I enable expo debug, its giving

TypeError: (0 , (_wordwrap || _load_wordwrap(...)).default)(...)(...).trimStart
is not a function
    at C:\[email protected]\src\commands\init.js:105:19
    at Array.map (<anonymous>)
    at _callee$ (C:\[email protected]\src\commands\init.js:95:37)
    at tryCatch (C:\Users\shubhamt1\AppData\Roaming\npm\node_modules\expo-cli\no
de_modules\regenerator-runtime\runtime.js:62:40)
    at Generator.invoke [as _invoke] (C:\Users\shubhamt1\AppData\Roaming\npm\nod
e_modules\expo-cli\node_modules\regenerator-runtime\runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (C:\Users\shubhamt1\Ap
pData\Roaming\npm\node_modules\expo-cli\node_modules\regenerator-runtime\runtime
.js:114:21)
    at step (C:\Users\shubhamt1\AppData\Roaming\npm\node_modules\expo-cli\node_m
odules\babel-runtime\helpers\asyncToGenerator.js:17:30)
    at C:\Users\shubhamt1\AppData\Roaming\npm\node_modules\expo-cli\node_modules
\babel-runtime\helpers\asyncToGenerator.js:35:14
    at new Promise (<anonymous>)
    at new F (C:\Users\shubhamt1\AppData\Roaming\npm\node_modules\expo-cli\node_
modules\core-js\library\modules\_export.js:36:28)

Please help on this. I am missing something ?

like image 955
Shubham Takode Avatar asked Mar 01 '19 06:03

Shubham Takode


2 Answers

What you have to do basically is to update the expo client to 2.6.11, and then update the node.js to a version greater than 10.0 (10 or newer version) and install git. After that, run the command

expo init <app-name>

According to Expo docs,

You'll need to have Node.js (version 10 or newer) installed on your computer. Download the latest version of Node.js. Additionally, you'll need Git to create new projects with Expo CLI

See Getting Started-React Native for a comprehensive guide.

like image 94
SVG Avatar answered Oct 13 '22 12:10

SVG


Downgrading to 2.11.6 doesn't work for me :

~/Projects/ReactNativeApp (master)
$ expo --version
2.11.6

~/Projects/ReactNativeApp (master)
$ expo init ReactNativeApp
[12:07:17] (0 , (_wordwrap || _load_wordwrap(...)).default)(...)(...).trimStart is not a function
[12:07:17] Set EXPO_DEBUG=true in your env to view the stack trace.

I have to downgrade to 2.11.3 in order to skip this error.

I have the same issue with 2.11.5 and 2.11.4.

Upgrading to node.js 10+ fixed this issue.

like image 35
Crieloue Gilles Avatar answered Oct 13 '22 11:10

Crieloue Gilles