suryaa1996
suryaa1996

Reputation: 135

the src and public folder are not creating while using create react app

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.

Upvotes: 1

Views: 2101

Answers (1)

JBallin
JBallin

Reputation: 9807

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)

Upvotes: 1

Related Questions