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

Post-install hook might fail on some versions of NPM #471

Open
peitschie opened this issue Jul 7, 2022 · 0 comments
Open

Post-install hook might fail on some versions of NPM #471

peitschie opened this issue Jul 7, 2022 · 0 comments
Labels
build issue An issue related to build process caveat A caveat of using this plugin

Comments

@peitschie
Copy link

Not a bug here really... but...

Due to an upstream NPM bug (since fixed) npm/cli#1905, there's a raft of NPM versions that don't correctly execute the post-install hook required by this plugin to strip the extraneous permissions and features out.

As a workaround, I've added a hook to my project in hooks/before_plugin_install.js with the following content:

const process = require('process');
const path = require('path');

const cwd = process.cwd();
try {
  process.chdir("node_modules/cordova.plugins.diagnostic")
  require(path.resolve("./scripts/apply-modules.js"));
} finally {
  process.chdir(cwd);
}

Just reporting this here in case it's something worth documenting.

@dpa99c dpa99c added caveat A caveat of using this plugin build issue An issue related to build process labels Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build issue An issue related to build process caveat A caveat of using this plugin
Projects
None yet
Development

No branches or pull requests

2 participants