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

[Bug?]: UTF-8 characters in path makes it impossible to use yarn on windows #4448

Open
1 task
sebastienlabine opened this issue May 12, 2022 · 7 comments
Open
1 task
Labels
bug Something isn't working upholded Real issues without formal reproduction

Comments

@sebastienlabine
Copy link

sebastienlabine commented May 12, 2022

Self-service

  • I'd be willing to implement a fix

Describe the bug

Executing a script inside a path that has a UTF-8 character fails with error MODULE_NOT_FOUND.

PS C:\Users\Sébastien Labine\Documents\Github\smartbills\apps\mobile> yarn start
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'C:\Users\S├®bastien Labine\Documents\Github\smartbills\apps\mobile\node_modules\expo\bin\cli.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

As soon as I move my project to the C:/, everything works fine.

PS C:\smartbills> yarn start

To reproduce

  • Create a yarn project on a windows computer with UTF-8 characters in the username.
  • Add any command as script that requires a node_modules to work for instance expo.
expo init my-app
  • try to execute yarn start, it will fail.
  • move folder to c:/
  • try to execute yarn start, it will work.

Environment

System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
  Binaries:
    Node: 16.13.2 - C:\Users\SBASTI~1\AppData\Local\Temp\xfs-2c9bae2e\node.CMD
    npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD

Additional context

Multiple other bug report like #3725 reported the same issue

@sebastienlabine sebastienlabine added the bug Something isn't working label May 12, 2022
@sebastienlabine sebastienlabine changed the title [Bug?]: UTF-8 characters in patht makes it impossible to use yarn [Bug?]: UTF-8 characters in path makes it impossible to use yarn on windows May 12, 2022
@merceyz merceyz added the upholded Real issues without formal reproduction label May 27, 2022
@H4M5TER
Copy link

H4M5TER commented Nov 1, 2022

Hi, can you provide your "start" script in package.json?
It seems like yarn was calling another script, but the path it passed to node is corrupted.

@sebastienlabine
Copy link
Author

@H4M5TER the script called was "expo start". I think the path was corrupted because of the UTF-8 characters "S├®b"

@sebastienlabine
Copy link
Author

@merceyz I see you mentioned this issue multiple times, do you know if a fix is considered?

@b13nxx
Copy link

b13nxx commented Apr 17, 2023

Having exactly same issue here. I have UTF-8 characters in my "Desktop" path and I'm not able to fire up "yarn run". It says "MODULE_NOT_FOUND". But I can use other package managers:

image

So... It didn't happen before. Is it something changed?

@H4M5TER
Copy link

H4M5TER commented Apr 26, 2023

Check #5319
Patch your own yarn.cjs for a workaround

@lustef
Copy link

lustef commented Feb 8, 2024

Hi everyone! I have a similar issue.

I'm using Windows and I have special characters in my username, and I'm trying to run 'yarn create playwright'.
Instead of 'C:\Users\ŁukaszStefański...' I'm getting 'C:\Users\┼üukaszStefa┼äski\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js'
and I'm unable to use the mentioned command.

@MolinRE
Copy link

MolinRE commented Mar 25, 2024

In the 1809 build of Windows 10 (released about 5 years ago) there is a beta option: Use Unicode UTF-8 for worldwide language support. As of today, it's still in beta, but helped me to solve this issue permanently.
Check this answer: https://superuser.com/a/1435645/250990

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upholded Real issues without formal reproduction
Projects
None yet
Development

No branches or pull requests

6 participants