3

When i am trying to create a new project using create-react-native-app, i am getting a weird syntax error. Any leads would be appreciated. Thank you

**create-react-native-app my-react-app**


/usr/local/lib/node_modules/create-react-native-app/build/index.js:2
module.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(2325)}t(__webpack_require__);return startup()}({4:function(e){"use strict";e.exports=eventListenerCount;function eventListenerCount(e,t){return e.listeners(t).length}},6:function(e,t,r){"use strict";const n=r(2471);const i=r(7720);class JSONStreamError extends Error{constructor(e,t){super(e.message);Error.captureStackTrace(this,t||this.constructor)}get name(){return"JSONStreamError"}set name(e){}}const s=(e,t)=>typeof e==="string"?String(t)===e:e&&typeof e.test==="function"?e.test(t):typeof e==="boolean"||typeof e==="object"?e:typeof e==="function"?e(t):false;const o=Symbol("_parser");const a=Symbol("_onValue");const c=Symbol("_onToken

SyntaxError: Unexpected token {
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3

1 Answer 1

0

It likely means you have an older version of node or npm. Upgrade to the latest npm with:

sudo npm install -g npm@latest

and upgrade node to the latest version with (credit: https://www.geeksforgeeks.org/installation-of-node-js-on-linux/):

sudo apt install python3-software-properties software-properties-common -y
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt install nodejs -y
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.