Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The filename, directory name, or volume label syntax is incorrect #12425

Closed
cpupg opened this issue May 22, 2022 · 3 comments
Closed

The filename, directory name, or volume label syntax is incorrect #12425

cpupg opened this issue May 22, 2022 · 3 comments

Comments

@cpupg
Copy link

cpupg commented May 22, 2022

Describe the bug

After change yarn and npm config, i can't create react app by yarn create react-app app. the config file are follow:
.npmrc:

prefix=D:\Project\NodeCache\NpmCache
cache=D:\Project\NodeCache\NpmCache

.yarnrc:

cache-folder "D:\\Project\\NodeCache\\YarnCache"
global-folder "D:\\Project\\NodeCache\\YarnGlobal"
lastUpdateCheck 1653189191412
link-folder "D:/Project/NodeCache/YarnLink"

note: only yarn create react-app my-app dosent work, npx create-react-app my-app works.

Did you try recovering your dependencies?

No, because the project is not created successfully yet, i can't run yarn install.

Which did you search for in User Guide?

yes, i searched in https://create-react-app.dev/docs/troubleshooting, but found nothing. i also search in issues. what i searched are follow:

  1. The filename, directory name, or volume label syntax is incorrect
  2. volume label

Environment

D:\Project\React\covid-19>npx create-react-app --info
npx: installed 67 in 9.337s

Environment Info:

  current version of create-react-app: 5.0.1
  running from D:\Project\NodeCache\NpmCache\_npx\9576\node_modules\create-react-app

  System:
    OS: Windows 10 10.0.19044
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 14.17.6 - D:\Program Files\Nodejs\node14\node.EXE
    Yarn: 1.22.17 - D:\Program Files\Nodejs\node14\yarn.CMD
    npm: 6.14.15 - D:\Program Files\Nodejs\node14\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.19041.1266.0), Chromium (89.0.774.68)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    react: Not Found
    react-dom: Not Found
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

(Write your steps here:)

1.start cmd in target directory.
4.run yarn create react-app bug-demo
5.error occurs.

Expected behavior

create app in target dirctory successfully.

Actual behavior

cra report a error: The filename, directory name, or volume label syntax is incorrect

图片

Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

@nickserv
Copy link
Contributor

nickserv commented Jun 27, 2022

This seems to be an issue on all Windows systems, as it's failing in the integration tests.

@jl-g
Copy link

jl-g commented Jan 27, 2023

For anyone who is running into this, I had the same issue, and the problem turned out to be that I was on the older (v1.x) version of yarn. You can tell by the formatting of the first lines of output [1/4] ....

Once I switched to yarn 3 using the instructions here: https://yarnpkg.com/getting-started/install this error went away.

It doesn't help that if you use something like chocolatey to manage the version of yarn, it not obvious that updating it through that doesn't actually get you the latest version.

@nickserv
Copy link
Contributor

nickserv commented Jan 27, 2023

The reason for that is that Yarn modern (2/3/etc.) has breaking changes, and they want the upgrade to be opt-in rather than opt-out. The recommended way to install Yarn modern is to install Yarn classic (1) the way you're used to globally, and then run yarn set version latest to upgrade a specific project.

@cpupg cpupg closed this as completed May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants