Summary: | po2json not found | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Architecture, internals, and plumbing | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P5 - low | CC: | julian.maurice, nick, paul.derscheid, tomascohen, victor |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38048 | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Bug Depends on: | 37303 | ||
Bug Blocks: | |||
Attachments: |
Bug 38031: Make po2json available to yarn
Bug 38031: Make po2json available to yarn |
Description
Jonathan Druart
2024-09-30 10:05:42 UTC
Created attachment 172217 [details] [review] Bug 38031: Make po2json available to yarn If you run `yarn run po2json` from /kohadevbox/koha and no local node_modules directory exists, you will get: error Command "po2json" not found. I didn't find a cause of a possible regression. Having it listed in package.json fixes the problem. Created attachment 172220 [details] [review] Bug 38031: Make po2json available to yarn If you run `yarn run po2json` from /kohadevbox/koha and no local node_modules directory exists, you will get: error Command "po2json" not found. I didn't find a cause of a possible regression. Having it listed in package.json fixes the problem. Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> root@kohadevbox:koha$ sudo koha-translate --update fr-FR --dev kohadev /bin/sh: 1: po2json: not found error Command failed with exit code 127. read_file '/tmp/fr-FR-messages.po' - open: No such file or directory at /kohadevbox/koha/misc/translator/LangInstaller.pm line 461. root@kohadevbox:koha$ koha-translate --update fr-FR --dev kohadev (node:25950) [DEP0128] DeprecationWarning: Invalid 'main' field in '/kohadevbox/node_modules/po2json/package.json' of './lib/po2json'. Please either fix that or report it to the module author (Use `node --trace-deprecation ...` to show where the warning was created) (Ignore the warning for now) It does not work with sudo. If I apply the patch, remove node_modules and run `yarn run po2json` I get: yarn run v1.22.20 $ po2json /bin/sh: 1: po2json: not found error Command failed with exit code 127. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Do you have po2json installed globally ? In ktd we have node_modules in /kohadevbox, embedded in the image. The right way to install with yarn inside KTD is by running: ```shell sudo yarn install --modules-folder /kohadevbox/node_modules sudo chown -R kohadev-koha:kohadev-koha /kohadevbox/node_modules ``` After doing it, if I run the proposed command I get: ```shell kohadev-koha@kohadevbox:koha(qa_38031)$ yarn run po2json yarn run v1.22.22 $ po2json input argument is required Usage: po2json <input> <output> [options] ``` is that enough for QA? I don't have full context for this feature. (In reply to Tomás Cohen Arazi (tcohen) from comment #6) > The right way to install with yarn inside KTD is by running: > > ```shell > sudo yarn install --modules-folder /kohadevbox/node_modules > sudo chown -R kohadev-koha:kohadev-koha /kohadevbox/node_modules > ``` > > After doing it, if I run the proposed command I get: > > ```shell > kohadev-koha@kohadevbox:koha(qa_38031)$ yarn run po2json > yarn run v1.22.22 > $ po2json > > input argument is required > > Usage: po2json <input> <output> [options] > ``` > > is that enough for QA? I don't have full context for this feature. You don't need to install actually, but yes, it's is what it fixed. Without this patch `yarn run po2json` results in "command not found". Bug 38164 as it is, will short circuit this ticket. |