-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENOTCACHED error from a git dependency when using lock file #134
Comments
I had ENOTCACHED all I did to fix it was
for my point of view, it seems node2nix needs a new release? |
I'm also facing this issue. Is there any bug preventing a new release? |
I tried current master and it seems the error is still present in my case :( |
And the repro posted by @ento also fails for me. |
@hlolli I'm using the same verison/sha and it still reproduces for me. It's possible your case is covered by this fix for another issue about the ENOTCACHED error, which isn't released to the npm registry yet. |
A workaround (in my case) is |
This diff regenerates the package sets for `codimd` and `codemirror` using NodeJS 8 to get rid of the deprecated[1] `nodejs-6_x`. Additionally the following issues had to be fixed during the update: * The package `js-sequence-diagram` has been removed from the NPM registry and was replaced by a security holding package[2]. The package was published by a third-party (upstream only supports bower builds), so it's unclear whether the package will re-appear[3]. As the tarballs still exist (and the hash didn't change), the package will be loaded manually into the build env. * For the babel-related packages, `dontNpmInstall` will be set for `node2nix` installs as some of those packages bundle a `package-lock.json` that triggers `ENOTCACHED` errors for optional dependencies[4]. For now it should be sufficient to use NodeJS 8 (`codimd` v1.2.x doesn't support NodeJS 10), in the long term we probably want to use `yarn2nix` here with NodeJS 10. This is much rather a fix to get rid of another NodeJS 6 dependency. [1] `nodejs-6_x` is about to be deprecated, see NixOS#58976 [2] https://www.npmjs.com/package/js-sequence-diagrams, https://github.com/npm/security-holder [3] bramp/js-sequence-diagrams#212 [4] svanderburg/node2nix#134
This diff regenerates the package sets for `codimd` and `codemirror` using NodeJS 8 to get rid of the deprecated[1] `nodejs-6_x`. Additionally the following issues had to be fixed during the update: * The package `js-sequence-diagram` has been removed from the NPM registry and was replaced by a security holding package[2]. The package was published by a third-party (upstream only supports bower builds), so it's unclear whether the package will re-appear[3]. As the tarballs still exist (and the hash didn't change), the package will be loaded manually into the build env. * For the babel-related packages, `dontNpmInstall` will be set for `node2nix` installs as some of those packages bundle a `package-lock.json` that triggers `ENOTCACHED` errors for optional dependencies[4]. For now it should be sufficient to use NodeJS 8 (`codimd` v1.2.x doesn't support NodeJS 10), in the long term we probably want to use `yarn2nix` here with NodeJS 10. This is much rather a fix to get rid of another NodeJS 6 dependency. [1] `nodejs-6_x` is about to be deprecated, see #58976 [2] https://www.npmjs.com/package/js-sequence-diagrams, https://github.com/npm/security-holder [3] bramp/js-sequence-diagrams#212 [4] svanderburg/node2nix#134 (cherry picked from commit 5feec42, PR #59118)
@jacereda workaround also works in my case (compiling zigbee2mqtt deps). |
I think I manage to solve the problem. After digging through the internals of NPM for quite some time, I think this revision should fix it: 5bea6e5 It seems that newer versions of NPM have become much more strict. To give it a try, try to install the latest development version of node2nix. |
node2nix 1.7.0 contains preliminary git sub module support now. |
Trying to compile zigbee2mqtt master with 1.7.0 but same problem. Without @jacereda workaround Im getting:
with workaround ends succesfully. |
If anyone ever stumbles upon the same issue or wants to reproduce this: @jacereda workaround is also needed for The error only occurs for versions including |
Thank you @jacereda for this workaround. Out of nowhere, I've just run into this issue and your fix resolved the issue. This had happened for me on |
node2nix version: c876bb8 (latest master as of this writing)
node version: 10.x
example code: https://gist.github.com/ento/2962993d4dfdf2e0778d5b2f4c57948f
I'm using node2nix to install dependencies required to build a frontend app. My shell.nix (simplified) looks like:
One of the dependencies in package.json looks like:
(This is not the actual dependency I'm using. This is a random package that I found that doesn't have a package-lock.json at the root of the repo. The GitHub dependency I'm using has a package-lock.json in its repo, which I thought might've had something to do with the error after reading #106. Turns out the error reproduces even with a repo without the lock file.)
node2nix is invoked like so:
When trying to use nix-shell with the shell.nix above, I get this error:
Workarounds I've found so far:
shell
derivation withreconstructLock = true
resolveDependencyVersion
in node-env.nix so that it returns the GitHub URL shorthand and addgit
tobuildInputs
ofshell.nix
The effect of patching
resolveDependencyVersion
seems to be that npm (or the underlying library) switches to use the 'git' fetcher instead of some other fetcher that tries to read the local cache. I'm not sure if that's in the right direction towards a fix, or if what I'm doing is entirely incorrect in the first place.The text was updated successfully, but these errors were encountered: