1

I have previously used and installed create react app globally,but when i tried to create a new app its not working.

So i followed this :https://github.com/facebook/create-react-app/issues/8097 didn't worked.

Then I tried this:Issues with uninstalling create-react-app I got the same error as in that question.

I have also tried : https://github.com/facebook/create-react-app/issues/8088

and https://icetutor.com/question/template-not-provided-using-create-react-app/ I really don't know what is the issue. When I am using the command

     where create-react-app

i got this:

    C:\Users\PC 2\AppData\Local\Yarn\bin\create-react-app
    C:\Users\PC 2\AppData\Local\Yarn\bin\create-react-app.cmd

and when i use this :

    npm rm -rf C:\Users\Weboffice PC 2\AppData\Local\Yarn\bin\create-react-app

gives this

    npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\package.json'
    npm WARN saveError EPERM: operation not permitted, open 'C:\Users\package-lock.json.1678493388'
    npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\package.json'
    npm WARN Users No description
    npm WARN Users No repository field.
    npm WARN Users No README data
    npm WARN Users No license field.

    up to date in 0.058s

when I am using yarn to install I get

   C:\Users\Weboffice PC 2\React>yarn create react-app test
   yarn create v1.16.0
   [1/4] Resolving packages...
   [2/4] Fetching packages...
   [3/4] Linking dependencies...
   [4/4] Building fresh packages...
   success Installed "[email protected]" with binaries:
   - create-react-app

[##########################################################################################################################################################################################] 225/225'

    C:\Users\Weboffice' is not recognized as an internal or external command,
    operable program or batch file.
    error Command failed.
    Exit code: 1
    Command: C:\Users\Weboffice PC 2\AppData\Local\Yarn\bin\create-react-app
    Arguments: test
    Directory: C:\Users\Weboffice PC 2\React
    Output:

    info Visit https://yarnpkg.com/en/docs/cli/create for documentation about 
    this command.

when i used yarn to uninstall I get

    C:\Users\Weboffice PC 2\React>yarn uninstall create-react-app
    yarn run v1.16.0
    error Couldn't find a package.json file in "C:\\Users\\Weboffice PC 
    2\\React"
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about 
    this command

question updated.

8
  • Have you tried uninstalling your global version of CRA and using “yarn create react-app myapp” (suggested yarn because it seems like you’re using it). More detail here: create-react-app.dev/docs/getting-started Also please share more detail of what happens when you run the commands and what the result is (show folder structure of the resulting app etc). Commented Jan 21, 2020 at 5:38
  • I have edited the question with outputs using yarn, no folders where created when using it. Commented Jan 21, 2020 at 6:10
  • To uninstall the global package (you showed trying to uninstall local), run “yarn global remove create-react-app” Commented Jan 21, 2020 at 7:03
  • I’m also curious about your user name “Weboffice PC 2” given that it has spaces in it (typically discouraged). I’m a Mac user but some googling led me here: support.microsoft.com/en-us/help/2454362/… - the error seems related to your username. Did you change it recently? Error: “...Weboffice is not recognized...” Commented Jan 21, 2020 at 7:08
  • @JBallin no I didn't changed the name.But your suggestion worked. [1/2] Removing module create-react-app... [2/2] Regenerating lockfile and installing missing dependencies... success Uninstalled packages. Done in 3.40s. C:\Users\Weboffice PC 2\React>where create-react-app INFO: Could not find files for the given pattern(s). Commented Jan 21, 2020 at 8:22

1 Answer 1

1

The error is showing that there’s an issue with the space in your username (this is a known issue with npx, for which a fix is slowly being worked on).

In the meantime, here’s a workaround:

I was able to fix this in Windows by creating a directory junction to my users folder that didn't have a space in it. You can run a command like this in an administrative powershell:

cmd /c mklink /J C:\Users\myname" "C:\Users\My Name"

You can then use this junction as if it were your real user directory:

npm config set cache C:\Users\myname\AppData\Roaming\npm-cache

npm config set prefix C:\Users\myname\AppData\Roaming\npm

(the above should update your user .npmrc file)

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.