首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当使用应用程序时,src和公用文件夹不会创建。

当使用应用程序时,src和公用文件夹不会创建。
EN

Stack Overflow用户
提问于 2020-01-21 05:34:01
回答 1查看 1.8K关注 0票数 1

我以前在全球范围内使用和安装了,但是当我尝试创建一个新的应用程序时,它不起作用。

所以我跟踪了这个:https://github.com/facebook/create-react-app/issues/8097没有工作。

然后我尝试这样做:卸载create-react app的问题,我得到了与这个问题相同的错误。

我也尝试过:https://github.com/facebook/create-react-app/issues/8088

https://icetutor.com/question/template-not-provided-using-create-react-app/,我真的不知道是什么问题。当我使用命令时

代码语言:javascript
复制
     where create-react-app

我拿到了这个:

代码语言:javascript
复制
    C:\Users\PC 2\AppData\Local\Yarn\bin\create-react-app
    C:\Users\PC 2\AppData\Local\Yarn\bin\create-react-app.cmd

当我用这个:

代码语言:javascript
复制
    npm rm -rf C:\Users\Weboffice PC 2\AppData\Local\Yarn\bin\create-react-app

给出这个

代码语言:javascript
复制
    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

当我用纱线安装时

代码语言:javascript
复制
   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 "create-react-app@3.3.0" with binaries:
   - create-react-app

########################################################################################################################################################################################## 225/225‘

代码语言:javascript
复制
    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.

当我用纱线卸载时

代码语言:javascript
复制
    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

问题更新。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-01-22 07:09:05

错误显示用户名中的空格存在问题(这是npx的一个已知问题,修复程序正在缓慢地使用工作过)。

同时,这里有一个解决办法

我能够在Windows中修复这个问题,方法是为我的用户文件夹创建一个没有空间的目录连接。您可以在管理的powershell中运行这样的命令: cmd /c mklink /J C:\Users\myname" "C:\Users\My Name" 然后,您可以像使用真正的用户目录一样使用这个连接: npm config set cache C:\Users\myname\AppData\Roaming\npm-cache npm config set prefix C:\Users\myname\AppData\Roaming\npm (上面应该更新您的用户.npmrc文件)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59834706

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档