windows cmd doesn't run .nvmrc
My file directory is as follows config
Mode LastWriteTime Length Name
d----- 2024/8/27 11:51 aliases d----- 2024/8/27 11:50 node-versions -a---- 2024/8/27 17:57 272 cd.cmd -a---- 2024/6/13 11:33 7229440 fnm.exe -a---- 2024/8/27 17:45 249 fnm_init.cmd
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor
@echo off :: for /F will launch a new instance of cmd so we create a guard to prevent an infnite loop if not defined FNM_AUTORUN_GUARD ( set "FNM_AUTORUN_GUARD=AutorunGuard" FOR /f "tokens=*" %%z IN ('fnm env --use-on-cd') DO CALL %%z )
But effective in powershell
OS Name: Microsoft Windows 11 Professional for Workstations OS Version: 10.0.22631 Not Available Build 22631 OS Manufacturer: Microsoft Corporation
I have discovered a new bug where when I specified the version (14.18.2) using nvmrc, the terminal already shows that it is running (14.18.2), but when it finally runs, it still chooses the default version to run
C:\Users\XXX>fnm ls
- v14.18.2
- v20.17.0 default, lts-latest
- system
.nvmrc v14.18.2
powershell :
Using Node v14.18.2
PS F:\XXX\XXX> npm run start
npm WARN lifecycle The node binary used for scripts is C:\Users\XXX\AppData\Local\fnm_multishells\812_1725507120873\node.exe but npm is using C:\Users\XXX\AppData\Local\fnm_multishells\20964_1725507115331\node.exe itself. Use the --scripts-prepend-node-path option to include the path for the node binary npm was executed with.
(node:27464) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use node --trace-deprecation ... to show where the warning was created)
(node:27464) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
....
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:79:19)
at Object.createHash (node:crypto:139:10)
...
opensslErrorStack: [
'error:03000086:digital envelope routines::initialization error',
'error:0308010C:digital envelope routines::unsupported'
],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v20.17.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! XXXX start: ng serve --proxy-config prxoy.conf.json --port 4207
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xxxx\AppData\Roaming\npm-cache_logs\2024-09-05T03_32_17_537Z-debug.log