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

Possible to remove preinstall script? #434

Open
IGx89 opened this issue Jul 29, 2022 · 3 comments
Open

Possible to remove preinstall script? #434

IGx89 opened this issue Jul 29, 2022 · 3 comments

Comments

@IGx89
Copy link

IGx89 commented Jul 29, 2022

Hello! We're using your package in frontend projects worked on by developers without Java/Maven installed on their systems. That should normally be just fine, since we're only running this package in our CI system (local development doesn't require packaging for AEM). However, due to your preinstall script that runs mvn -v, developers get an error about mvn not being found when they attempt to do a simple npm install on the frontend project. Would it be possible to remove that preinstall script so that developers aren't required to install Java/Maven?

Our workaround in the meantime is to run npm install --ignore-scripts instead.

Thanks!

@amclin
Copy link
Owner

amclin commented Aug 4, 2022

Hmmm..... that's a pretty critical dependency for executing this package, so I'm hesitant to remove the check or move it to be runtime instead of install time.

@IGx89 Have you considered running npx aem-packager instead of npm run aem-packager so that this package doesn't need to be included as a dependency, and thus doesn't need Maven to be installed on your developers' workstations?

@IGx89
Copy link
Author

IGx89 commented Jan 18, 2023

npx aem-packager isn't ideal since it still prompts to install. We ended up working around it by making aem-packager an optional dependency so it silently fails to install and doesn't block the installing of other packages. On our CI server it will succeed since it has mvn installed, though we also use --ignore-scripts there so it won't actually run the postinstall script either :p

@amclin
Copy link
Owner

amclin commented Oct 8, 2023

@IGx89 I've been looking into this more, and installing as an optional dependency seems to be the most "correct" approach in the NPM ecosystem since there is no explicit way to have install for CI vs. install for local development.

I'll get a note added to readme about this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants