npm install moment date code example Example 1: npm install moment npm i moment --save Example 2: npm moment npm install moment