flatpak / flatpak-builder-tools

Various helper tools for flatpak-builder
196 stars 108 forks source link

[node] NotImplementedError: Don't know how to handle package in package-lock.json #391

Open saccarosium opened 9 months ago

saccarosium commented 9 months ago

flatpak-builder version

1.4.0

Linux distribution and version

Debian Testing (13)

Affected flatpak-builder tool

node/flatpak-node-generator.py

flatpak-builder tool cli args

No response

Source repository URL

No response

Flatpak-builder manifest URL

No response

Description

When trying to generate a generated-sources.json from a package.json gives the following error: NotImplementedError: Don't know how to handle package in package-lock.json.

Reading packages from lockfiles...
Traceback (most recent call last):
  File "/home/sacca/.local/bin/flatpak-node-generator", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/sacca/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.11/site-packages/flatpak_node_generator/main.py", line 277, in main
    asyncio.run(_async_main())
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/sacca/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.11/site-packages/flatpak_node_generator/main.py", line 198, in _async_main
    packages.update(lockfile_provider.process_lockfile(lockfile))
  File "/home/sacca/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.11/site-packages/flatpak_node_generator/providers/npm.py", line 166, in process_lockfile
    yield from self._process_packages_v2(lockfile, data)
  File "/home/sacca/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.11/site-packages/flatpak_node_generator/providers/npm.py", line 138, in _process_packages_v2
    raise NotImplementedError(
NotImplementedError: Don't know how to handle package  in package-lock.json

hfiguiere commented 9 months ago

Affected flatpak-builder tool

cargo/flatpak-cargo-generator.py

Is this correct? Since the problem is with package-lock.json

saccarosium commented 9 months ago

Affected flatpak-builder tool

cargo/flatpak-cargo-generator.py

Is this correct? Since the problem is with package-lock.json

Nope I had problems with the picker. I've correct it.

p3x-robot commented 7 months ago

https://github.com/flathub/flathub/pull/5061#issuecomment-2005001714

p3x-robot commented 7 months ago

it looks like with npm is not working, with yarn is working.

p3x-robot commented 7 months ago

now this different:

Cache miss, checking out last cache hit
========================================================================
Building module p3x-onenote in /home/patrikx3/Projects/patrikx3/p3x/onenote/.flatpak-builder/build/p3x-onenote-22
========================================================================
Running: yarn install --offline
yarn install v1.22.19
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
error Couldn't find any versions for "@electron/remote" that matches "^2.1.2" in our cache (possible versions are ""). This is usually caused by a missing entry in the lockfile, running Yarn without the --offline flag may help fix this issue.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: module p3x-onenote: Child process exited with code 1