[Pkg-javascript-devel] Bug#980775: yarnpkg is not compatible with node-uuid 7.0.0+

anomie at users.sourceforge.net anomie at users.sourceforge.net
Thu Jan 21 22:41:58 GMT 2021


Package: yarnpkg
Version: 1.22.10+~cs22.25.14-1

>From https://www.npmjs.com/package/uuid/v/7.0.1#default-export-removed:

> Default Export Removed
>
> uuid at 3 was exporting the Version 4 UUID method as a default export:
> 
> const uuid = require('uuid'); // <== REMOVED!
> 
> This usage pattern was already discouraged in uuid at 3 and has been removed in uuid at 7.

But yarnpkg uses that pattern in src/resolvers/exotics/file-resolver.js,
src/cli/commands/install.js, and src/cli/commands/import.js.

This results in failures at runtime, for example

  $ mkdir -p /tmp/test/foo
  $ cd /tmp/test
  $ yes '' | yarn init
  yarn init v1.22.10
  question name (test): 
  question version (1.0.0): 
  question description: 
  question entry point (index.js): 
  question repository url: 
  question author: 
  question license (MIT): 
  question private: 
  success Saved package.json
  Done in 0.14s.
  $ yarn add file:foo
  yarn add v1.22.10
  info No lockfile found.
  [1/4] Resolving packages...
  error An unexpected error occurred: "Cannot read property 'v4' of undefined".
  info If you think this is a bug, please open a bug report with the information provided in "/tmp/test/yarn-error.log".
  info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.



More information about the Pkg-javascript-devel mailing list