Created attachment 213157 [details] Patch Hi, I noticed a regression with yarn 1.22.4. I have some local global packages installed with `yarn global add`. The error is: > yarn global upgrade SyntaxError: Unknown token: { line: 1, col: 0, type: 'INVALID', value: undefined } 1:0 in yarnrc at Parser.unexpected (/usr/local/lib/node_modules/yarn/lib/cli.js:64332:11) at Parser.parse (/usr/local/lib/node_modules/yarn/lib/cli.js:64463:14) at parse (/usr/local/lib/node_modules/yarn/lib/cli.js:64537:21) at module.exports.exports.default (/usr/local/lib/node_modules/yarn/lib/cli.js:64099:96) at loadRcFile (/usr/local/lib/node_modules/yarn/lib/cli.js:56942:58) at /usr/local/lib/node_modules/yarn/lib/cli.js:56916:14 at /usr/local/lib/node_modules/yarn/lib/cli.js:101331:14 at Array.map (<anonymous>) at parseRcPaths (/usr/local/lib/node_modules/yarn/lib/cli.js:101329:78) at Object.findRc (/usr/local/lib/node_modules/yarn/lib/cli.js:101343:10) and happens with any subcommand. I studied the thing a little and found an upstream commit which is to blame. I reverted it locally with a patch to the port (attached), and the problem goes away. I also followed up in an upstream issue report where someone else pointed out the same error on NetBSD: https://github.com/yarnpkg/yarn/issues/4884 For reference the problematic upstream commit can be reached here: https://github.com/yarnpkg/yarn/commit/2cb2fc4805060986c6d5cdf6b7636d91b441c38f
A commit references this bug: Author: pizzamig Date: Tue Apr 14 15:34:40 UTC 2020 New revision: 531699 URL: https://svnweb.freebsd.org/changeset/ports/531699 Log: www/yarn: fix regression with global packages Add a patch to fix global packages upgrade PR: 245425 Submitted by: madpilot@ Obtained from: https://github.com/yarnpkg/yarn/issues/4884 Changes: head/www/yarn/Makefile head/www/yarn/files/ head/www/yarn/files/patch-lib_cli.js
Committed! Thanks!