Create-react-app: npx create-react-app does not includes required files and directories

Created on 24 Dec 2019  路  6Comments  路  Source: facebook/create-react-app

when I use npx create-react-app myapp, all required files and directories are not being created, only package.json, package-lock.json, and node_modules are created automatically.
Please help, am I missing something?
It also says that:

A template was not provided. This is likely because you're using an outdated version of create-react-app.
Please note that global installs of create-react-app are no longer supported

-->

bug report needs triage

Most helpful comment

As stated earlier, this issue seems to be because of older version of create-react-app. You can either find the older version installed in _usr/local/bin_ or _/usr/local/lib/node_modules_ folders.
If this doesnt work for you then you can use the below command

_npx --ignore-existing create-react-app_

All 6 comments

You need to delete a global installation of create-react-app, via npm rm -g create-react-app

The same issue just happened to me. I have ensured that there is not a global installation of create-react-app, yet It is still happening.
Here is the command which I ran:
npx create-react-app react-example

Ok, I found the solution to this problem.

This issue has a detailed discussion on this topic.
The gist is that there is a create-react-app installed in node_modules directory somewhere up in the directory tree.

@miraage npm rm -g create-react-app was not solving the issue and it was not deleting the global issue.
So I went in the /usr/local/bin and manually deleted the create-react-app. This solved the issue. I still don't understand why the above command did not work.

BTW I am using a MacBook.

mark

As stated earlier, this issue seems to be because of older version of create-react-app. You can either find the older version installed in _usr/local/bin_ or _/usr/local/lib/node_modules_ folders.
If this doesnt work for you then you can use the below command

_npx --ignore-existing create-react-app_

Hey so for now i used , gitbash cli and it seems to work and gave me the entire template .It wasn't working on visual studio code so Iam not sure whats going on LOL.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Evan-GK picture Evan-GK  路  3Comments

JimmyLv picture JimmyLv  路  3Comments

fson picture fson  路  3Comments

dualcnhq picture dualcnhq  路  3Comments

xgqfrms-GitHub picture xgqfrms-GitHub  路  3Comments