You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an encoding error when the username is non-ascii
When C:\Users\user\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js does not exist, it does not fall back to C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js. Fixed in latest
node:internal/modules/cjs/loader:1205
throw err;
^
Error: Cannot find module 'C:\Users\娴佹槦鏆撮洦\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1202:15)
at Module._load (node:internal/modules/cjs/loader:1027:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:187:14)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v22.0.0
When I added $OutputEncoding = [Console]::OutputEncoding = [Text.UTF8Encoding]::UTF8 to fix the encoding issue
PS F:\git\node-js-max_path-windows-bug> npm.ps1
node:internal/modules/cjs/loader:1205
throw err;
^
Error: Cannot find module 'C:\Users\流星暴雨\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1202:15)
at Module._load (node:internal/modules/cjs/loader:1027:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:187:14)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v22.0.0
Expected Behavior
suceess
Steps To Reproduce
Run npm.ps1 on a Windows machine with a non-ascii username.
See error...
Environment
npm: 10.5.1
Node.js: v22.0.0
OS Name: Windows 11
System Model Name:
npm config:
; "builtin" config from C:\Program Files\nodejs\node_modules\npm\npmrcprefix = "C:\\Users\\流星暴雨\\AppData\\Roaming\\npm"; "global" config from C:\Users\流星暴雨\AppData\Roaming\npm\etc\npmrcpython = "C:\\Python27\\python.exe"; "user" config from C:\Users\流星暴雨\.npmrc
//registry.npmjs.org/:_authToken = (protected)
strict-ssl = false
; node bin location = C:\Program Files\nodejs\node.exe; node version = v22.0.0; npm local prefix = F:\git\node-js-max_path-windows-bug; npm version = 10.5.1; cwd = F:\git\node-js-max_path-windows-bug; HOME = C:\Users\流星暴雨; Run `npm config ls -l` to show all defaults.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
npm.ps1
introduced two regressions.WhenFixed in latestC:\Users\user\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
does not exist, it does not fall back toC:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
.When I added
$OutputEncoding = [Console]::OutputEncoding = [Text.UTF8Encoding]::UTF8
to fix the encoding issueExpected Behavior
suceess
Steps To Reproduce
Environment
The text was updated successfully, but these errors were encountered: