[Pkg-javascript-devel] help understanding autopkgtest failures for node-eslint-visitor-keys

Nilesh Patra nilesh at riseup.net
Mon Feb 28 18:21:07 GMT 2022


On 2/28/22 3:01 PM, Jonas Smedegaard wrote:
> Currently, autopkgtest fails for node-eslint-visitor-keys and I cannot
> figure out why.
> 
> I would be happy if others could have a look and maybe help spot why it
> fails.
> [...]

> Error: Cannot find module '/tmp/autopkgtest-lxc.w0404gv_/downtmp/build.H9q/src/dist/eslint-visitor-keys.cjs'
>      at createEsmNotFoundErr (internal/modules/cjs/loader.js:842:15)
>      at finalizeEsmResolution (internal/modules/cjs/loader.js:835:15)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

As you might have noticed above, it tries to find dist/<something> in the local autopkgtest directory
instead of global one (/usr/share/)

This happens because you are running the test in the same directory where your source code is and
the "local" package.json is interfering with your "require" command.

Simple solution is to create a temporary dir; or use $AUTOPKGTEST_TMP (latter is best)

I have attached a patch that fixes this, please apply and upload.

Hope that helps.

> The package does _not_ use pkg-js-tools.

Had you used this, it'd have passed since it does the change to
temp dir thing by default

> Works fine interactively in a local pristine chroot with only nodejs and
> node-eslint-visitor-keys installed.

I hope you run the autopkgtest in a schroot/container and were able to reproduce it?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-eslint-visitor-keys-test.patch
Type: text/x-patch
Size: 342 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-devel/attachments/20220228/52d92e79/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-devel/attachments/20220228/52d92e79/attachment.sig>


More information about the Pkg-javascript-devel mailing list