[Pkg-javascript-devel] Bug#973741: Bug#973741: gitlab: Yarn hasn't been able to find a cache folder it can use
Paolo Greppi
paolo.greppi at libpf.com
Sat Nov 28 21:07:32 GMT 2020
See below
Il 28/11/20 20:28, Pirate Praveen ha scritto:
> On Thu, 19 Nov 2020 23:50:24 +0530 Pirate Praveen <praveen at onenetbeyond.org> wrote:
> ...
> So some options I can think,
>
> 1. Port yarn 1.x to build with babel 7 (but this has not been successfull)
> 2. Try to run ES6 code directly somehow, may be with newer nodejs and patches. I think Paolo tried this option, not sure what happened.
I did some tests, but no success.
The plan was to target node 14 (that supports ECMAScript modules) as follows:
- move entire src tree to lib
- strip flow type annotations with @babel/plugin-transform-flow-strip-types
- rename all files from .js to .mjs
- have /usr/bin/yarnpkg just launch node /usr/share/nodejs/yarn/lib/cli/index.mjs
I got lost at some point trying to make node find modules here and there, with a quote from W. Allen Sleeper's film echoing in my ears:
https://youtu.be/XA_Zrvxjyek#t=1m00s
The resulting binary fails with this error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'commander' imported from /usr/share/nodejs/yarn/lib/cli/index.mjs
I pushed my failed experiment to this separate repo:
https://salsa.debian.org/paolog/node-yarnpkg/-/tree/wip/paolog/nobabel
> 3. Build it using 'deb https://snapshot.debian.org/archive/debian/20200502T085134Z sid main' (the last version that builds in sid) and embed the built files in the package (as two steps, like we bootstrap babel, rollup etc). This will mean, we will have to move it to contrib. I prefer shipping yarn in contrib to missing it in bullseye.
+1
> Also can someone help me with a patch for node-mkdirp 1.0? I tried but could not figure it out, I looked at some of the packages ported by yadd, but this one is using a different syntax.
Not sure if it's relevant, but did you check this comment ?
https://github.com/yarnpkg/yarn/issues/8417#issuecomment-723519990
> We can't build it in current sid, but create a chroot from the above snapshot and run dpkg-buildpackage.
>
> sudo debootstrap sid /srv/chroot/debian-sid-20200502T085134Z https://snapshot.debian.org/archive/debian/20200502T085134Z/
>
> I manually installed node-mkdirp and reverse dependencies to test the built package.
>
> We will have to do a binary included upload (it can't migrate to testing because of babel 6 requirement anyway).
>
>
Paolo
More information about the Pkg-javascript-devel
mailing list