Profpatsch / yarn2nix

Build and deploy node packages with nix from yarn.lock files.
MIT License
85 stars 21 forks source link

SyntaxError: Unknown token in lockfile - yarn.lock version 8 #79

Closed milahu closed 6 months ago

milahu commented 6 months ago

trying to parse yarn.lock of lossless-cut

$ head -n6 yarn.lock
# This file is generated by running "yarn install" inside your project.
# Manual changes might be lost - proceed with caution!

__metadata:
  version: 8
  cacheKey: 10
$ yarn2nix > yarn.nix
/nix/store/lfw962hdh37x531p2hxn3yjxzhqb3bli-yarn2nix-1.0.0/libexec/yarn2nix/node_modules/@yarnpkg/lockfile/index.js:5064
    throw new SyntaxError(`${msg} ${this.token.line}:${this.token.col} in ${this.fileLoc}`);
    ^

SyntaxError: Unknown token: { line: 3, col: 2, type: 'INVALID', value: undefined } 3:2 in lockfile

probably fixed by updating @yarnpkg/lockfile

milahu commented 6 months ago

aah, wrong issue tracker

im using a different yarn2nix

$ nix-shell -p yarn2nix

readme says

ATTENTION: You are not looking at the yarn2nix as packaged in nixpkgs. This is an alternative implementation, with different tradeoffs. For an overview of the history of these tools and current options, see https://github.com/NixOS/nixpkgs/issues/20637.

similar issue https://github.com/NixOS/nixpkgs/issues/230686#issuecomment-1538426645