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

Postinstall script fails #13

Open
askoufis opened this issue Jul 9, 2023 · 3 comments
Open

Postinstall script fails #13

askoufis opened this issue Jul 9, 2023 · 3 comments
Labels
Change: patch [Issue / PR] describes a small non-breaking change, such as bugfix or an optimization Domain: main [Issue / PR] describes change in the functionality, its optimization good first issue [Issue] can be addressed by a first-time contributor Priority: high [Issue / PR] must be addressed as soon as possible Type: bug [Issue / PR] addresses malfunction

Comments

@askoufis
Copy link

askoufis commented Jul 9, 2023

The postinstall script fails. This bug is present in v20230101.1.9 and potentially v20230101.1.8 (haven't tested this version).

Reproduction

  1. mkdir foo
  2. npm init (just to get a package.json)
  3. yarn add @iso4217/json
  4. Error:
error /code/foo/node_modules/@iso4217/json: Command failed.
Exit code: 1
Command: node --unhandled-rejections=strict postinstall.js
Arguments:
Directory: /code/foo/node_modules/@iso4217/json
Output:
node:internal/modules/cjs/loader:1031
  throw err;
  ^

Error: Cannot find module 'xml2json'
Require stack:
- /code/foo/node_modules/@iso4217/json/convert-xml-to-intermediate-json.impl.js
- /code/foo/node_modules/@iso4217/json/convert-xml-to-js-xml.impl.js
- /code/foo/node_modules/@iso4217/json/build-data-file.impl.js
- /code/foo/node_modules/@iso4217/json/build-data-file-if-needed.impl.js
- /code/foo/node_modules/@iso4217/json/get-data.impl.js
- /code/foo/node_modules/@iso4217/json/build-grouped-by-data-files.js
- /code/foo/node_modules/@iso4217/json/postinstall.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
    at Function.Module._load (node:internal/modules/cjs/loader:873:27)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at Object.<anonymous> (/code/foo/node_modules/@iso4217/json/convert-xml-to-intermediate-json.impl.js:6:36)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/code/foo/node_modules/@iso4217/json/convert-xml-to-intermediate-json.impl.js',
    '/code/foo/node_modules/@iso4217/json/convert-xml-to-js-xml.impl.js',
    '/code/foo/node_modules/@iso4217/json/build-data-file.impl.js',
    '/code/foo/node_modules/@iso4217/json/build-data-file-if-needed.impl.js',
    '/code/foo/node_modules/@iso4217/json/get-data.impl.js',
    '/code/foo/node_modules/@iso4217/json/build-grouped-by-data-files.js',
    '/code/foo/node_modules/@iso4217/json/postinstall.js'
  ]
}

@parzhitsky
Copy link
Member

Hey! Thanks for the issue! I'll get back to it in about 10 hours, if that's ok.

@parzhitsky parzhitsky added Change: patch [Issue / PR] describes a small non-breaking change, such as bugfix or an optimization Domain: main [Issue / PR] describes change in the functionality, its optimization Priority: top [Issue / PR] must be addressed right now Type: bug [Issue / PR] addresses malfunction good first issue [Issue] can be addressed by a first-time contributor labels Jul 10, 2023
@askoufis
Copy link
Author

Thanks for the quick response. Not an urgent issue for me, take your time 🙂

@parzhitsky parzhitsky added Priority: high [Issue / PR] must be addressed as soon as possible and removed Priority: top [Issue / PR] must be addressed right now labels Jul 11, 2023
@parzhitsky
Copy link
Member

@askoufis FYI, it looks like this isn't going to be easy to debug. And also the package architecture is cumbersome (what was I thinking 1,5 years ago?!), which doesn't help. I don't have nearly enough motivation to do hard work after working hours :)

So, at the moment, the temporary solution is to use version 20230101.1.6 (the latest that's not affected by the bug). This version is now set to be latest, and versions 1.8 and 1.9 are now deprecated.

Apologies for any inconveniences!

If you have spare time and motivation to dig into it, I'd be very grateful. The bug may or may not be related to:

  • data.json file not being present upon postinstall script;
  • require(…) not working for some reason during postinstall script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Change: patch [Issue / PR] describes a small non-breaking change, such as bugfix or an optimization Domain: main [Issue / PR] describes change in the functionality, its optimization good first issue [Issue] can be addressed by a first-time contributor Priority: high [Issue / PR] must be addressed as soon as possible Type: bug [Issue / PR] addresses malfunction
Projects
None yet
Development

No branches or pull requests

2 participants