If you run `yarn run po2json` from /kohadevbox/koha and no local node_modules directory exists, you will get: error Command "po2json" not found. See the different outputs: root@kohadevbox:koha$ pwd /kohadevbox/koha root@kohadevbox:koha$ yarn run --env yarn run v1.22.22 error There are no binary scripts available. root@kohadevbox:kohadevbox$ pwd /kohadevbox root@kohadevbox:kohadevbox$ yarn run --env yarn run v1.22.22 info Commands available from binary scripts: JSONStream, acorn, ansi-html, atob, autoprefixer, boast, browser-pack, browserify, browserslist, browserslist-lint, color-support, cssesc, cypress, deps-sort, detective, envinfo, eslint-config-prettier, esparse, esvalidate, extract-zip, findup, gulp, handlebars, he, highlight, html-minifier-terser, import-local-fixture, insert-module-globals, is-ci, is-docker, is-inside-container, js-yaml, jsesc, json5, loose-envify, marked, miller-rabin, mime, mkdirp, module-deps, multicast-dns, nanoid, node-which, oas-validate, openapi, opener, parser, po2json, prettier, redocly, regjsparser, resolve, rimraf, rspack, rtlcss, sass, semver, sha.js, sshpk-conv, sshpk-sign, sshpk-verify, stylelint, svgo, swagger-cli, swagger2openapi, terser, tsc, tsserver, uglifyjs, umd, undeclared-identifiers, uuid, vue-cli-service, vue-demi-fix, vue-demi-switch, watchify, webpack, webpack-bundle-analyzer, webpack-cli, webpack-dev-server I didn't find a cause of a possible regression.
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".