Score:1

Error while using create-react-app

cn flag

During an attempt to install create-react-app on my os (unbuntu 22.04), I got this output from the terminal.

t*****@poudlardo:~$ sudo npm -g install create-react-app
ERROR: npm v9.6.4 is known not to run on Node.js v12.22.9.  This version of npm supports the following node versions: `^14.17.0 || ^16.13.0 || >=18.0.0`. You can find the latest version at https://nodejs.org/.

ERROR:
/usr/local/lib/node_modules/npm/lib/utils/exit-handler.js:19
  const hasLoadedNpm = npm?.config.loaded
                           ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at module.exports (/usr/local/lib/node_modules/npm/lib/cli.js:42:23)
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:2:25)
    at Module._compile (internal/modules/cjs/loader.js:999:30)

Please know that I already tried several times to install / update npm, nodejs or react. That's why I don't even understand the first error about node supported version.

    t*****@poudlardo:~$ node -v
    v18.16.0

    t*****@poudlardo:~$ npm -v
    9.6.6

How can I install create-react-app ?

David avatar
cn flag
There is no Ubuntu version of 22.03 please correct.
poudlardo avatar
cn flag
my bad, corrected now.
Score:0
cn flag

To create a new React project, we can use the tool npx, provided you have an npm version of at least 5.2.

npx create-react-app my-react-app

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.