I’m having a problem in the “Running Commands” section of ‘Building Images’ at “RUN npm install”. I’m getting the following error:
=> ERROR [4/4] RUN npm install 10.3s
[4/4] RUN npm install: #8 10.26 npm ERR! code CERT_NOT_YET_VALID #8 10.26 npm ERR! errno CERT_NOT_YET_VALID #8 10.26 npm ERR! request to https://registry.npmjs.org/semver/-/semver-6.3.0.tgz failed, reason: certificate is not yet valid #8 10.30 #8 10.30 npm ERR! A complete log of this run can be found in: #8 10.30 npm ERR! /root/.npm/_logs/2021-04-04T14_28_29_647Z-debug.log
I did a google search on the error, which said the error is because the date/time is wrong. I ran the ‘date’ command, and the date/time is showing Sun Apr 4 14:52:46 UTC 2021, making the alpine date a week behind the system date/time.
I’ve tried to update the container date/time, but it isn’t working, saying the /etc/timezone directory doesn’t exist. Does anyone have a way to sync the container date/time to the system date/time?