You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think init-data is written in either Flow or TypeScript, and babel-node is not configured to compile.
Error log
$ babel-node scripts/initData.js
/Users/darris/.nvm/versions/node/v10.13.0/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/index.js:558
throw err;
^
SyntaxError: /Users/darris/Work/react-native-example/scripts/initData.js: Unexpected token (3:12)
1 | // @flow
2 |
> 3 | import type { CloudClient, UserSession } from '../types';
| ^
4 |
5 | import dotenv from 'dotenv';
6 | import faker from 'faker';
at Parser.pp$5.raise (/Users/darris/.nvm/versions/node/v10.13.0/lib/node_modules/babel-cli/node_modules/babylon/lib/index.js:4454:13)
at Parser.pp.unexpected (/Users/darris/.nvm/versions/node/v10.13.0/lib/node_modules/babel-cli/node_modules/babylon/lib/index.js:1761:8)
at Parser.pp.expectContextual (/Users/darris/.nvm/versions/node/v10.13.0/lib/node_modules/babel-cli/node_modules/babylon/lib/index.js:1723:39)
at Parser.pp$1.parseImport (/Users/darris/.nvm/versions/node/v10.13.0/lib/node_modules/babel-cli/node_modules/babylon/lib/index.js:2869:10)
at Parser.pp$1.parseStatement (/Users/darris/.nvm/versions/node/v10.13.0/lib/node_modules/babel-cli/node_modules/babylon/lib/index.js:1884:49)
at Parser.pp$1.parseBlockBody (/Users/darris/.nvm/versions/node/v10.13.0/lib/node_modules/babel-cli/node_modules/babylon/lib/index.js:2268:21)
at Parser.pp$1.parseTopLevel (/Users/darris/.nvm/versions/node/v10.13.0/lib/node_modules/babel-cli/node_modules/babylon/lib/index.js:1778:8)
at Parser.parse (/Users/darris/.nvm/versions/node/v10.13.0/lib/node_modules/babel-cli/node_modules/babylon/lib/index.js:1673:17)
at parse (/Users/darris/.nvm/versions/node/v10.13.0/lib/node_modules/babel-cli/node_modules/babylon/lib/index.js:7305:37)
at File.parse (/Users/darris/.nvm/versions/node/v10.13.0/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/index.js:485:15)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The text was updated successfully, but these errors were encountered:
Update init-data script in package.json to "init-data": "npx babel-node scripts/initData.js",
Run npm run init-data
Alternatively you can also run it on the fly instead if you don't want to install the dependency: "init-data": "npx -p @babel/core -p @babel/node babel-node scripts/initData.js",
I think init-data is written in either Flow or TypeScript, and babel-node is not configured to compile.
Error log
The text was updated successfully, but these errors were encountered: