[Pkg-javascript-devel] Bug#972952: node-mkdirp 1.0 is incompatible with 0.5, breaks yarnpkg

anomie at users.sourceforge.net anomie at users.sourceforge.net
Mon Oct 26 14:28:32 GMT 2020


Package: node-mkdirp
Version: 1.0.4-2
Severity: critical

I don't know whether to report this against node-mkdirp for breaking
compatibility, or yarnpkg for depending on "node-mkdirp (>= 0.5.1)"
rather than "node-mkdirp (>= 0.5.1), node-mkdirp (<<1.0.0)". Either way,
things are currently broken in unstable and shouldn't migrate to
testing.

I upgraded various packages this morning, and found that yarn would no
longer work.

  $ yarn
  yarn install v1.22.4
  warning Skipping preferred cache folder "/home/redacted/.cache/yarn" because it is not writable.
  warning Skipping preferred cache folder "/tmp/.yarn-cache-1000" because it is not writable.
  warning Skipping preferred cache folder "/tmp/.yarn-cache" because it is not writable.
  error Yarn hasn't been able to find a cache folder it can use. Please use the explicit --cache-folder option to tell it what location to use, or make one of the preferred locations writable.
  info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

This turns out to be due to this error being thrown:

  TypeError: invalid options argument
    at optsArg (/usr/share/nodejs/mkdirp/lib/opts-arg.js:13:11)
    at mkdirp (/usr/share/nodejs/mkdirp/index.js:11:10)
    at /usr/share/nodejs/yarn/lib/util/promise.js:37:10
    at new Promise (<anonymous>)
    at /usr/share/nodejs/yarn/lib/util/promise.js:17:12
    at Object.<anonymous> (/usr/share/nodejs/yarn/lib/util/fs.js:1024:15)
    at Generator.throw (<anonymous>)
    at step (/usr/share/nodejs/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /usr/share/nodejs/babel-runtime/helpers/asyncToGenerator.js:30:13

It turns out yarn is expecting node-mkdirp to accept a callback, which
was apparently dropped in node-mkdirp 1.0 in favor of it returning a
promise.

Downgrading node-mkdirp to 0.5.1-2 fixed it:

  $ yarn
  yarn install v1.22.4
  info No lockfile found.
  [1/4] Resolving packages...
  [2/4] Fetching packages...
  [3/4] Linking dependencies...
  [4/4] Building fresh packages...
  success Saved lockfile.
  Done in 0.07s.



More information about the Pkg-javascript-devel mailing list