Azure pipeline "npm install" but package doesn't exist anymore

Viewed 31

When building my project in Azure pipeline, there is a step that does npm install.

However one of the package it requires doesn't seem to exist anymore on NPM. What are my options now?

8412 error code E404

8413 error 404 Not Found - GET https://registry.npmjs.org/angular-appinsights/-/angular-appinsights-0.0.4.tgz

8414 error 404

8415 error 404 'angular-appinsights@0.0.4' is not in the npm registry.

8416 error 404 You should bug the author to publish it (or use the name yourself!)
  • Edit I have added this package privately to Azure Artifact feed, and all other NPM packages (not privately) as well, would this mean that if in the future someone removes there package from NPM I would still have the (artifact feed) as backup?
1 Answers

Caution: this might not be the best practice

I had a similar issue with some legacy app that was built upon the beta of Material UI. When putting the application on a CI/CD pipeline what we had to do was before launching npm install have a script move the node_modules folder to where the application was being built and then launch npm run build because in this case it was a React App (I'm guessing it is similar for Angular).

What I would suggest is that you have a copy of that package from the node_modules folder copied into a node_modules folder while deploying before running npm install because npm won't install packages it finds are already there.

Of course best practice would be to update that package but I'm guessing that is not up to you. If you could, I would suggest you ask the developers to review the dependencies or to tell you how they deploy that application locally because, from the little research I've done it seems to me that there other up-to-date packages available. They might have installed the newest package but forgotten to remove the old one and since they have never had to redeploy simply didn't stumble upon that error, other possibility is they're passing the node_modules folder around.

Related