'installing npm package crashes react native application

I've set up a React Native application that works fine with an emulator till I try to install the moment library to work with dates. This library won't even finish to install and then commands are not recognized anymore. At the begining, everything runs correctly :

enter image description here

Then, installing the moment library : enter image description here

Since the installation runs for ages, I did a Ctrl+C on it. Then the Metro and Android command won't be recognized : enter image description here

However, these commands are still in the package.json :

enter image description here

From that point, the app is completely messed up. I have to erase everything and start all over again.

So? is it that npm packages cannot be used like in a regular React app? I don't understand what is going on here.

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