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?]: Syntax error when running shell command #6233

Closed
1 task
rChaoz opened this issue Apr 16, 2024 · 1 comment
Closed
1 task

[Bug?]: Syntax error when running shell command #6233

rChaoz opened this issue Apr 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@rChaoz
Copy link

rChaoz commented Apr 16, 2024

Self-service

  • I'd be willing to implement a fix

Describe the bug

Create a new package.json file with the following script in it:

"thing": "cmd /c copy /Y \".\\node_modules\\.prisma\\client\\*.js\" \".\\node_modules\\@prisma\\client\\\""

Then try to run it with yarn run thing. Output:

Syntax Error: Expected "$", "$(", "$((", "${", "\"", "\\", "\\\n", or [^$"] but end of input found (line 1, column 85).
    at pg (C:\Users\Matei\AppData\Local\node\corepack\yarn\4.1.1\yarn.js:12:3213)
    at u8e (C:\Users\Matei\AppData\Local\node\corepack\yarn\4.1.1\yarn.js:12:22154)
    at ND (C:\Users\Matei\AppData\Local\node\corepack\yarn\4.1.1\yarn.js:12:22327)
    at TE (C:\Users\Matei\AppData\Local\node\corepack\yarn\4.1.1\yarn.js:168:1973)
    at x (C:\Users\Matei\AppData\Local\node\corepack\yarn\4.1.1\yarn.js:189:2758)
    at C:\Users\Matei\AppData\Local\node\corepack\yarn\4.1.1\yarn.js:189:2942
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Tn.mktempPromise (C:\Users\Matei\AppData\Local\node\corepack\yarn\4.1.1\yarn.js:9:44849)
    at async Object.Wb (C:\Users\Matei\AppData\Local\node\corepack\yarn\4.1.1\yarn.js:189:2571)
    at async t0.execute (C:\Users\Matei\AppData\Local\node\corepack\yarn\4.1.1\yarn.js:499:2341)

Environment

System:
  OS: Windows 10 10.0.19045
  CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700KF
Binaries:
  Node: 20.8.0 - ~\AppData\Local\Temp\xfs-2e9c83c0\node.CMD
  Yarn: 4.1.1 - ~\AppData\Local\Temp\xfs-2e9c83c0\yarn.CMD
  npm: 10.2.1 - C:\Program Files\nodejs\npm.CMD

(installed with nvm)

Additional context

No response

@arcanis
Copy link
Member

arcanis commented Apr 16, 2024

The Yarn scripts are run through a portable Posix-like shell, so the command syntax (especially escaping) must be similar to bash.

@arcanis arcanis closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants