Error during postinstall script execution using yarn v3
benjaminchardin2 opened this issue · comments
Benjamin CHARDIN commented
Are you submitting a bug report or a feature request?
Bug Report
What is the current behavior?
When executing the postinstall script using yarn berry (v2) or v3, the following error occurs:
# This file contains the result of Yarn building a package (final-form@npm:4.18.2)
# Script name: postinstall
[eval]:1
console.log('Using final-form at work? You can now donate to our open collective:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Invalid or unexpected token
at new Script (vm.js:100:7)
at createScript (vm.js:261:10)
at Object.runInThisContext (vm.js:309:10)
at internal/process/execution.js:77:19
at [eval]-wrapper:6:22
at evalScript (internal/process/execution.js:76:60)
at internal/main/eval_string.js:23:3
What is the expected behavior?
postinstall script should execute without raising an error when using yarn berry or yarn v3
What's your environment?
Final form version : 4.18.2
Yarn version : yarn-3.1.0-rc.5
Other information
This issue seems to have occured in another package
related issue: nolimits4web/swiper#3057
related merge request solving the issue: https://github.com/nolimits4web/swiper/pull/3355/files
Stian M commented
Same here.
$ cat /tmp/xfs-147af4df/build.log
# This file contains the result of Yarn building a package (final-form@npm:4.18.6)
# Script name: postinstall
[eval]:1
console.log('Using final-form at work? You can now donate to our open collective:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Invalid or unexpected token
at new Script (node:vm:100:7)
at createScript (node:vm:257:10)
at Object.runInThisContext (node:vm:305:10)
at node:internal/process/execution:75:19
at [eval]-wrapper:6:22
at evalScript (node:internal/process/execution:74:60)
at node:internal/main/eval_string:27:3
$ uname -a
Linux <host> 5.10.0-11-amd64 #1 SMP Debian 5.10.92-1 (2022-01-18) x86_64 GNU/Linux
$ yarn --version
3.1.1
$ node -v
v16.13.2
Gert Dreyer commented
@Otard95 @benjaminchardin2 If you were to submit a PR to fix this issue I will review it.