What is the current behavior?
I've upgraded Node to 9.0.0 and when creating a new yarn project using yarn init it provides the following information:
C:\test>yarn init
yarn init v1.2.1
warning You are using Node "9.0.0" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || ^8.0.0"
question name (test):
If the current behavior is a bug, please provide the steps to reproduce.
Just init a new project with Node 9.0.0 installed.
What is the expected behavior?
Don't give a warning and support Node.js 9 and up.
Please mention your node.js, yarn and operating system version.
Node.js version: 9.0.0
Yarn version: 1.2.1
Windows 7
This leads to broken builds in my case. Yarn 1.2.1, Windows 7 Enterprise, Cygwin.
a226893@VCN /c/c/U/A/W/p/component-tests> yarn install
yarn install v1.2.1
warning You are using Node "9.0.0" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || ^8.0.0"
[1/4] Resolving packages...
[2/4] Fetching packages...
[###########################################################################################################################################################################################################-------] 676/698e
vents.js:246
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'listener', 'function');
^
TypeError [ERR_INVALID_ARG_TYPE]: The "listener" argument must be of type function
at _addListener (events.js:246:11)
at WriteStream.addListener (events.js:306:10)
at WriteStream.close (fs.js:2282:10)
at C:\Users\A226893\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:67060:37
at call (C:\Users\A226893\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:67070:3)
at Array.forEach (<anonymous>)
at C:\Users\A226893\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:67090:25
at f (C:\Users\A226893\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:43176:25)
at WriteStream.<anonymous> (C:\Users\A226893\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:67049:21)
at WriteStream.f (C:\Users\A226893\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:43176:25)
Just fixed this today: https://github.com/yarnpkg/yarn/commit/b1f0e49a41ca78f8f0cf19d94a885067eea76e39 and 1.3.0 is out with the fix.
Most helpful comment
Just fixed this today: https://github.com/yarnpkg/yarn/commit/b1f0e49a41ca78f8f0cf19d94a885067eea76e39 and 1.3.0 is out with the fix.