0

I installed yarn, updated node, npm and yarn as well, cleared cache and still facing the same errors.

Command used:

create-react-app confusion [email protected]

Errors are as follows:

Creating a new React app in /home/nandini/Documents/courseraFSWD/React/confusion.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

➤ YN0000: ┌ Resolution step
➤ YN0061: │ extract-text-webpack-plugin@npm:3.0.2 is deprecated: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
➤ YN0061: │ fsevents@npm:1.2.13 is deprecated: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
➤ YN0061: │ fsevents@npm:1.2.13 is deprecated: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
➤ YN0061: │ browserslist@npm:2.11.3 is deprecated: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
➤ YN0061: │ core-js@npm:2.6.11 is deprecated: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
➤ YN0061: │ sw-precache@npm:5.2.1 is deprecated: Please migrate to Workbox: https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
➤ YN0061: │ chokidar@npm:1.7.0 is deprecated: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
➤ YN0032: │ nan@npm:2.14.1: Implicit dependencies on node-gyp are discouraged
➤ YN0061: │ sw-toolbox@npm:3.6.0 is deprecated: Please migrate to Workbox: https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
➤ YN0061: │ chokidar@npm:2.1.8 is deprecated: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
➤ YN0061: │ request@npm:2.88.2 is deprecated: request has been deprecated, see https://github.com/request/request/issues/3142
➤ YN0061: │ browserslist@npm:1.7.7 is deprecated: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
➤ YN0061: │ browserslist@npm:1.7.7 is deprecated: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
➤ YN0061: │ circular-json@npm:0.3.3 is deprecated: CircularJSON is in maintenance only, flatted is its successor.
➤ YN0032: │ fsevents@npm:2.1.3: Implicit dependencies on node-gyp are discouraged
➤ YN0032: │ fsevents@npm:2.1.3: Implicit dependencies on node-gyp are discouraged
➤ YN0032: │ evp_bytestokey@npm:1.0.3: Implicit dependencies on node-gyp are discouraged
➤ YN0061: │ har-validator@npm:5.1.5 is deprecated: this library is no longer supported
➤ YN0061: │ resolve-url@npm:0.2.1 is deprecated: https://github.com/lydell/resolve-url#deprecated
➤ YN0061: │ urix@npm:0.1.0 is deprecated: Please see https://github.com/lydell/urix#deprecated
➤ YN0000: └ Completed in 46.94s
➤ YN0000: ┌ Fetch step
➤ YN0013: │ yargs-parser@npm:7.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs@npm:3.10.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs@npm:6.6.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs@npm:7.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs@npm:8.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 11.03s
➤ YN0000: ┌ Link step
➤ YN0062: │ fsevents@patch:fsevents@npm%3A1.2.13#builtin<compat/fsevents>::version=1.2.13&hash=87eb42 The platform linux is incompatible with this module, building skipped.
➤ YN0062: │ fsevents@patch:fsevents@npm%3A2.1.3#builtin<compat/fsevents>::version=2.1.3&hash=87eb42 The platform linux is incompatible with this module, building skipped.
➤ YN0007: │ core-js@npm:2.6.11 must be built because it never did before or the last one failed
➤ YN0007: │ uglifyjs-webpack-plugin@npm:0.4.6 [85052] must be built because it never did before or the last one failed
➤ YN0000: └ Completed in 7.76s
➤ YN0000: Done with warnings in 1.1m

Aborting installation.
Unexpected error. Please report it as a bug:
Error: Cannot find module '/home/nandini/Documents/courseraFSWD/React/confusion/node_modules/react-scripts/package.json'
Require stack:
- /home/nandini/.nvm/versions/node/v14.9.0/lib/node_modules/create-react-app/createReactApp.js
- /home/nandini/.nvm/versions/node/v14.9.0/lib/node_modules/create-react-app/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:892:15)
    at Function.Module._load (internal/modules/cjs/loader.js:742:27)
    at Module.require (internal/modules/cjs/loader.js:964:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at checkNodeVersion (/home/nandini/.nvm/versions/node/v14.9.0/lib/node_modules/create-react-app/createReactApp.js:514:23)
    at /home/nandini/.nvm/versions/node/v14.9.0/lib/node_modules/create-react-app/createReactApp.js:312:7
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/nandini/.nvm/versions/node/v14.9.0/lib/node_modules/create-react-app/createReactApp.js',
    '/home/nandini/.nvm/versions/node/v14.9.0/lib/node_modules/create-react-app/index.js'
  ]
}

Deleting generated file... package.json
Done.


versions of packages: node -v : v14.9.0 , npm -v : 6.14.8 , yarn --version : 2.2.2 , nvm --version : 0.35.1

And i am using a ubuntu version 20.04

1
  • Have you tried with --use-npm flag. Commented Sep 5, 2020 at 5:49

5 Answers 5

1

You don't need to install CRA globally on your machine, these commands work perfectly fine:-

 yarn create react-app client

or

npx create-react-app client

Happy hacking!

Sign up to request clarification or add additional context in comments.

Comments

1

The following are steps to overcome this problem.

Step 1: Make sure that You've installed "create-react-app" after the update.

Command: npm install -g create-react-app //g for global installation

Step 2: Now Run this command to create your react app.

Command: npx/yarn create-react-app confusion

//Please check the version of create-react-app before executing below command

npx create-react-app confusion [email protected]

1 Comment

Thnks a lot for your help. :)
1

You can find a list of all yarn errors here: https://yarnpkg.com/advanced/error-codes

it seems that you have to run yarn rebuild, if it doesn't work also consider doing a clean build (cleaning cache and installing fresh)

Comments

0

There are two ways to create a react app.

  1. Globally (Permanently)
  2. Locally (Not Permanently)

To create a react app globally, use the following command.

npm install -g create-react-app

Navigate to the directory where you want to place your application within. Then type the following command:

create-react-app <name-of-app>

If you already installed in your machine and a new version of create-react-app is released then you always need to uninstall the previous version and then reinstall it.

The command for uninstalling: npm uninstall -g create-react-app

If you don't want to install permanently then use npm i create-react-app. Navigate to the placable directory and type the command for the new react app.

npx create-react-app confusion or yarn create-react-app confusion

When new versions of Create React App are released, you can upgrade it by the following command:

npm install react-scripts@latest

For Ubuntu you can read the blog in https://fosslovers.com/how-to-install-reactjs-on-ubuntu-20-04/ They have explained how to install react in Ubuntu 20.04.

Comments

0

Try this in your command line

npm cache clean --force

and then:

create-react-app basics

This one will help.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.