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

v22.3.0 Cannot start if the Folder or Script File Name is Unicode. #54991

Closed
LightSpeedC opened this issue Sep 18, 2024 · 7 comments · Fixed by #55015
Closed

v22.3.0 Cannot start if the Folder or Script File Name is Unicode. #54991

LightSpeedC opened this issue Sep 18, 2024 · 7 comments · Fixed by #55015
Labels
windows Issues and PRs related to the Windows platform.

Comments

@LightSpeedC
Copy link

LightSpeedC commented Sep 18, 2024

Version

v22.3.0 or later (v22.11.0, v23.1.0)

Platform

Windows 10

Microsoft Windows NT 10.0.19045.0 x64
Microsoft Windows [Version 10.0.19045.4780] <- ver
Microsoft Windows [Version 10.0.19045.5011] <- ver

Windows 11

Microsoft Windows NT 10.0.22631.0 x64
Microsoft Windows [Version 10.0.22631.3880] <- ver

Subsystem

No response

What steps will reproduce the bug?

We can start normal.

// abcde.js
console.log('It works!');
> node C:\wk\abcde\abcde.js
It works!
> echo errorlevel=%errorlevel%
errorlevel=0
>

Cannot start if the folder is Unicode.

> node C:\wk\あいうえお\abcde.js
> echo errorlevel=%errorlevel%
errorlevel=-1073741819
> 

-1073741819 means File System error.

How often does it reproduce? Is there a required condition?

Every time. 100%

What is the expected behavior? Why is that the expected behavior?

before version v22.2.0, it's OK.

What do you see instead?

> subst A: C:\wk\あいうえお
> node A:\abcde.js
It works!
> subst A: /d

Additional information

Node.js blog - 2024-06-11, Version 22.3.0 (Current)

@LightSpeedC LightSpeedC changed the title Cannot start if the folder is Unicode. v22.3.0 Cannot start if the folder is Unicode. Sep 18, 2024
@targos targos added the windows Issues and PRs related to the Windows platform. label Sep 18, 2024
@lpinca
Copy link
Member

lpinca commented Sep 18, 2024

I can't reproduce with Node.js 22.9.0

PS C:\Users\lpinca> "$([Environment]::OSVersion.VersionString) $(('x86', 'x64')[[Environment]::Is64BitOperatingSystem])"

Microsoft Windows NT 10.0.22631.0 x64
PS C:\Users\lpinca> node -v
v22.9.0
PS C:\Users\lpinca> mkdir あいうえお


    Directory: C:\Users\lpinca


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        18/09/2024     08:46                あいうえお



PS C:\Users\lpinca> cd あいうえお
PS C:\Users\lpinca\あいうえお> node -e "require('fs').writeFileSync('index.js', 'console.log(\'It Works!\');')"
PS C:\Users\lpinca\あいうえお> node C:\Users\lpinca\あいうえお\index.js
It Works!
PS C:\Users\lpinca\あいうえお>

@LightSpeedC
Copy link
Author

LightSpeedC commented Sep 18, 2024

node v22.9.0 on Windows 10/11 can not start if folder is Unicode.
Microsoft Windows NT 10.0.22631.0 x64

Our PC, Japanese Code Page 932 is selected.

> chcp
現在のコード ページ: 932
> chcp 65001
Active code page: 65001
> chcp 932
現在のコード ページ: 932
>

@avivkeller
Copy link
Member

@nodejs/platform-windows

@avivkeller
Copy link
Member

FWIW I can't reproduce on MacOS (I know this was reported against windows):

$ echo "console.log('Tada')" > 現在のコード\ ページ/file.js
$ node 現在のコード\ ページ/file.js
Tada

@joyeecheung
Copy link
Member

This looks like another regression of #54991 (or similar changes)

@LightSpeedC
Copy link
Author

LightSpeedC commented Nov 2, 2024

Sorry for being late.

I tested it with the following version, but it didn't work.

node v22.10.0-x64
node v22.11.0-x64
node v23.1.0-x64

node v22.3~22.11, ~v23.1 did not work.

only work on node v22.2 or before

Please re-open this issue.

@LightSpeedC
Copy link
Author

We reproduce with node v22.3~v22.11 and v23.1.

Windows batch file:

chcp 932
echo console.log^('It works!', process.version^);> 日本語.js
node 日本語.js
echo exit code: %errorlevel% ... NG
nodes\node-v22.02 日本語.js
echo exit code: %errorlevel% ... OK
nodes\node-v22.03 日本語.js
echo exit code: %errorlevel% ... NG
nodes\node-v22.11 日本語.js
echo exit code: %errorlevel% ... NG
nodes\node-v23.01 日本語.js
echo exit code: %errorlevel% ... NG
del 日本語.js

@LightSpeedC LightSpeedC changed the title v22.3.0 Cannot start if the folder is Unicode. v22.3.0 Cannot start if the folder or Script File Name is Unicode. Nov 3, 2024
@LightSpeedC LightSpeedC changed the title v22.3.0 Cannot start if the folder or Script File Name is Unicode. v22.3.0 Cannot start if the Folder or Script File Name is Unicode. Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants