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

Update postinstall script to reference component's package.json with an absolute path #72

Closed
chrisfalaska opened this issue Oct 18, 2024 · 0 comments · Fixed by #73
Closed
Assignees

Comments

@chrisfalaska
Copy link
Contributor

chrisfalaska commented Oct 18, 2024

Please describe the bug

When using postInstall.mjs as part of auro-library, the script attempts to reference a relative package.json:

const pjson = require('../package.json');

If a component such as auro-input is referencing postInatll.mjs from auro-library, the install fails since it cannot find a relative package.json inside auro-library node_modules:

Error: Cannot find module '../package.json'

Reproducing the error

  • From your respective component's package.json (for example: auro-input), reference the postInstall.mjs script from auro-library:
"postinstall": "node ./node_modules/@aurodesignsystem/auro-library/scripts/build/postinstall.mjs",
  • Run npm i

  • Observe build error.

Expected behavior

The postInstall script should run from node_modules and reference the consuming component's package.json

What browsers are you seeing the problem on?

No response

Additional context

Part of the monorepo work in auro-form: AlaskaAirlines/auro-formkit#1

Exit criteria

No response

@chrisfalaska chrisfalaska self-assigned this Oct 18, 2024
@chrisfalaska chrisfalaska changed the title Update postIntsall script to reference package.json Update postIntsall script to reference package.json absolute path Oct 18, 2024
@chrisfalaska chrisfalaska changed the title Update postIntsall script to reference package.json absolute path Update postinstall script to reference component's package.json with an absolute path Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant