nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.44k stars 276 forks source link

Node.js initialized via pnpm build doesn't recognize git #4374

Closed Chaython closed 2 months ago

Chaython commented 2 months ago

Details

Initializing via powershell via pnpm errors out, it doesn't recognize git. Git however is finally working with powershell otherwise. [several bugged installs / poor environmental settings made git run but not recognize https command, and I had to manually add each function via environmental variables individually with the ; syntax....]

Node.js version

20.12.2.0

Example code

PS C:\Users\Chay> cd .\vencord\ PS C:\Users\Chay\vencord> pnpm build

vencord@1.7.6 build C:\Users\Chay\vencord node --require=./scripts/suppressExperimentalWarnings.js scripts/build/build.mjs

'git' is not recognized as an internal or external command, operable program or batch file. node:internal/errors:984 const err = new Error(message); ^

Error: Command failed: git rev-parse --short HEAD 'git' is not recognized as an internal or external command, operable program or batch file.

at genericNodeError (node:internal/errors:984:15)
at wrappedFn (node:internal/errors:538:14)
at checkExecSyncError (node:child_process:890:11)
at execSync (node:child_process:962:15)
at file:///C:/Users/Chay/Vencord/scripts/build/common.mjs:39:52
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
at async loadESM (node:internal/process/esm_loader:28:7)
at async handleMainPromise (node:internal/modules/run_main:113:12) {

status: 1, signal: null, output: [ null, '', "'git' is not recognized as an internal or external command,\r\n" + 'operable program or batch file.\r\n' ], pid: 37136, stdout: '', stderr: "'git' is not recognized as an internal or external command,\r\n" + 'operable program or batch file.\r\n' }

Node.js v20.12.2  ELIFECYCLE  Command failed with exit code 1.

Operating system

Windows 11 22631.3447

Scope

?

Module and version

Not applicable.

RedYetiDev commented 2 months ago

Hi! This is an issue with your git installation, and not Node.js.

Thank you for your issue, and we look forward to more in the future.