How to Solve the Angular NPM Error - Error Package Install Failed

Introduction

The error in NPM, 'error package install failed, see above', can occur when the user creates a new project in Angular using Node.js using VS code. This means that NPM is corrupted in your system and must reinstall NPM.

To solve this problem, you need to connect your PC to the internet to download or install all packages from the server. Follow each step one by one to download or install Angular/CLI.

Install Angular

Step 1. Connect your PC to the internet.

Step 2. Open cmd and run the following command to verify your NPM cached memory.

npm cache verify

Step 3. After running this command, run the following command.

npm cache clear -- force

It will take a few seconds to complete because it will be cleaning your NPM cache memory. After completion of this process, it will show.

NPM cache memory

Step 4. After completing this command, run the following command.

npm install -g @angular/cli@latest

This command takes a few minutes to complete, as with this command, your system will download the latest Angular/CLI package.

After running this command, it will show the following.

Command

When it completely installs, it will show.

Completely installs

Now, your system has completely installed Angular/CLI packages. After completely installing Angular/CLI packages, you have to check the version of Angular/CLI

Step 5. To check the version of Angular/CLI, run the following command on your CMD.

ng --version

After running this command, it should show the following.

Angular CLI

After completing this process, you have successfully installed Angular/CLI. Now you must open your VS Code and open your folder with VS Code where you want to create your project. Then, open the terminal.

Step 6. Now run the following command on your terminal

ng new demo

With this command, your project will be created.