This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix usage of plugin with npm 2
Whenever you try using the plugin with
npm 2
, it's postinstall script will fail, as it requiresfs-extra
module. However it's not been added as dependency of the plugin, so it does not exist in node_modules andrequire
fails.When npm 3 or later is used, the
fs-extra
plugin exists in the root level ofnode_modules
as it is a dependency offs-promise
. npm 3 and later tries to flatten the dependencies tree, sofs-extra
is moved in the root level and therequire
in the post-install script works.In order to fix this, add the
fs-extra
as dependency of the plugin.Fix postinstall in CI environment
In case you are in CI environment (non-interactive terminal), the postinstall script will fail as it prompts for action (in case there's no firebase.nativescript.json). As this is one of the basic scenarios when adding a plugin (add it and try building the project), some CI or cloud builds are hanging.
So add a check if the console is interactive and use the default settings in case it is.