'Firebase deploy node modules issue

I'm having some trouble with using firebase functions. So I have this library that requires terms and conditions to be accepted when npm install is ran, you have to type y. This works fine when i run it locally but when its deployed to firebase functions it doesn't work... I can only assume it is rejecting or skipping the terms.

Documentation on the website states you can set a node environment variable to automatically accept the terms and conditions and skip the install prompt.

I have tried this but i cannot get it to work....

Does firebase functions reinstall node modules every time a function is deployed? or has it been cached and therefore is not even trying to accept the terms and conditions with the new environment variable (if it is is there a way to clear node modules).

Sorry if this was confusing, if anything needs clarifying please ask me and i will update my question.

Thank you for your help.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source