Open tv42 opened 2 years ago
Oh the "integrity" field issue might be due to changes in npm? See https://github.com/svanderburg/node2nix/issues/238#issuecomment-942838431
another example in the wild: portiaui/package-lock.json
{
"name": "portia-ui",
"version": "2.0.0-alpha",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"npm": {
"dependencies": {
"async-some": {
"version": "1.0.2",
"integrity": "sha1-TYqBYg1ZWHkbW5j4AtMgd3bpVQk=",
"dev": true,
"requires": {
"dezalgo": "^1.0.2"
}
},
error: [npmlock2nix] A valid dependency consists of at least the resolved and integrity field. Missing one or both of them for `async-some`. The object I got looks like this: {"dev":true,"integrity":"sha1-TYqBYg1ZWHkbW5j4AtMgd3bpVQk=","requires":{"dezalgo":"^1.0.2"},"version":"1.0.2"}
workaround: use the default registry
wget https://registry.npmjs.org/async-some/-/async-some-1.0.2.tgz
sha1sum async-some-1.0.2.tgz | cut -d' ' -f1 | xxd -r -ps | base64
# TYqBYg1ZWHkbW5j4AtMgd3bpVQk=
NPM now has a "workspace" concept, where multiple packages reside in the same repository, and share the same package-lock.json. Wrangler2 (the rewrite that is known by NPM as @cloudflare/wrangler@beta, hosted in a different repository from the stable version) fails to build, and.. maybe it's because it's using a workspace?
Here's a couple of attempts to build wrangler2 using npmlock2nix:
flake.nix: