npm issue CERT_NOT_YET_VALID on raspberry pi

The error code is nodejs error, not raspberry per se. It refers to invalid ssl certificate. This solution worked for me.

$ npm config set strict-ssl false
$ npm config set unsafe-perm true
$ npm config set registry http://registry.npmjs.org/

I had this error in Ubuntu WSL2 on Windows10.
A restart of my PC solved the issue.


As the commenters have suggested, the first thing to check is that you have the correct system time -- or at least an incorrect time that falls within the range your certificate professes ;-)