Skip to content
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

[node] can't build anymore: cache mode is 'only-if-cached' but no cached response available. #244

Closed
aunetx opened this issue Nov 15, 2021 · 3 comments

Comments

@aunetx
Copy link

aunetx commented Nov 15, 2021

Hello and thank you very much for this repo,

I own the repository https://github.com/aunetx/deezer-linux, and try to (re)-build my package.
Nearly nothing has changed since last build, but I now get an error from flatpak builder when using make export_flatpak:

========================================================================
Building module deezer in /home/aunetx/Projets/deezer-linux/flatpak/flatpak-builder/build/deezer-2
========================================================================
Running: npm install --offline
npm info it worked if it ends with ok
npm info using npm@6.14.15
npm info using node@v14.18.1
npm info lifecycle deezer-desktop@5.30.100~preinstall: deezer-desktop@5.30.100
npm timing stage:loadCurrentTree Completed in 632ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 10ms
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 1304ms
npm timing stage:rollbackFailedOptional Completed in 0ms
npm timing stage:runTopLevelLifecycles Completed in 2486ms
npm ERR! code ENOTCACHED
npm ERR! request to https://registry.npmjs.org/@types%2fsemver failed: cache mode is 'only-if-cached' but no cached response available.
npm timing npm Completed in 4294ms

npm ERR! A complete log of this run can be found in:
npm ERR!     /run/build/deezer/flatpak-node/npm-cache/_logs/2021-11-15T12_49_52_782Z-debug.log
Error: module deezer: Le processus fils s’est terminé avec le code 1
make: *** [Makefile:52 : export_flatpak] Erreur 1

It looks like some packages are not cached correctly anymore (@types/semver here, but I don't know if it is the only one since I can't get past it).

I don't know what causes it, it is really pretty hard to get a lot of informations to fix this (especially since the app is extracted from an asar source, the package.json file is changed to include electron and electron-builder, and then it is rebuilt using flatpak... so all I know is that the package is not cached, I don't even know if it changed since last time it worked).

The content of /run/build/deezer/flatpak-node/npm-cache/_logs/2021-11-15T12_49_52_782Z-debug.log is in this pastebin.

If there is a way to fix this, this would be perfect; it looks like #182 but I'm not sure if it is related to git dependencies too.

Thanks a lot,
Aurélien Hamy

@gasinvein
Copy link
Member

This is not an answer to the exact issue, but since you're generating the lockfile yourself anyway, consider using Yarn instead. It is by far less problematic for offline builds.

@aunetx
Copy link
Author

aunetx commented Nov 15, 2021

Ok thanks a lot! I will try to use it and update here

@aunetx
Copy link
Author

aunetx commented Nov 15, 2021

Thanks a lot, using yarn fixed everything (and even some little more)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants