cancel
Showing results for 
Search instead for 
Did you mean: 

Getting npm ERR! code CERT_HAS_EXPIRED Error

hvzv
Discoverer
17,407

Hello Team,

I am facing issue in SAP Web ide , build is getting failed, it shows below error in console.

npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://npm.sap.com/@sap/di.code-validation.js/-/di.code-validation.js-1.1.6.tgz failed, reason: certificate has expired

npm ERR! A complete log of this run can be found in:
npm ERR! /mnt/npm_cache/_logs/2021-04-19T04_13_12_853Z-debug.log

9:43:15 AM (DIBuild)
UI5 Build failed.
.
[INFO] Build finished in 39 seconds Kindly provide your assistance.Best RegardsDeepa Kalyani

Accepted Solutions (0)

Answers (7)

Answers (7)

CSYew
Discoverer

This is because npm expired registry has expired/moved, and it's now replace it with NPM Registry.

  • You can go to your command-prompt enter this to change the registry path:npm config set @sap:registry=https://registry.npmjs.org/
  • Alternative way(manual change), you can locate the npm config file in your terminal using command:-

npm config list -> locate the .npmrc file -> open the file using notepad -> change the path

from @sap:registry = "https://npm.sap.com" to @sap:registry=https://registry.npmjs.org/


igor_muntoreanu
Explorer
0 Kudos

Thank you! It has solved my problem! 🙂

hvzv
Discoverer

Hello All,

Below solution worked for me :

Deleted package-lock.json, npmrc & gruntfile.js files from project.

And added UI5.yaml file as per below blog and it resolved our issue.

Updating Your Project's Grunt Build to the UI5 Build | SAP Help Portal

kvc123
Discoverer
0 Kudos

Hi all, please provide your inputs to solve this :

INFO] npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!

[INFO] npm ERR! Cannot read property 'resolve' of undefined

[INFO]

[INFO] npm ERR! A complete log of this run can be found in:

[INFO] npm ERR! C:\Users\kchheda\AppData\Roaming\npm-cache\_logs\2022-07-19T17_17_37_180Z-debug.log

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.9.1:npm (npm install) on project supplierportal: Failed to run task: 'npm install' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

0 Kudos

Right click on your project on web ide and go to New -> File

Enter the file name: user.npmrc

Add this line to the file:

@sap:registry=https://registry.npmjs.org/

philippe_cooman
Newcomer
0 Kudos
BharathM
Participant
0 Kudos

Is this resolved? we are facing similar issue..

npm ERR! code CERT_HAS_EXPIRED

npm ERR! errno CERT_HAS_EXPIRED

npm ERR! request to https://npm.sap.com/@sap%2fgrunt-sapui5-bestpractice-build failed, reason: certificate has expired

##[error]PowerShell exited with code '1'.

shilpaurandoor
Explorer
0 Kudos

is this resolved?