DEV Community

kamilrashidev
kamilrashidev

Posted on

How I Fixed NPM Package Installation errors

Fix your DNS

When you have trouble installing packages, check logs and if it has issues with GET requests, then change your DNS. I changed mine from Cloudflare's 1.1.1.1, 1.0.0.1 to Google's 8.8.8.8, 8.8.4.4 and it worked. Cloudflare DNS is good but I don't know why it gave headache for me. Google worked better in my case. So, it is up to you to choose a DNS server that suits you best.

Use VPN

Sometimes because of issues with ISP, we may have to face errors. to avoid it use a good VPN. if you have servers/VPS, you may use services like Tailscale to set up your own free private VPN.

PNPM Installer

PNPM is an alternative to NPM. PNPM is faster than NPM. It gives better logs than NPM so you may identify the reason for installation errors with ease and fix it accordingly.

Installing NodeJS exe from nodeJS website

[!TIP] This step is important for Windows. Linux and Mac come with these software programs pre-installed.

While installing NodeJS, download from the official site's exe file and make sure everything is checked as in the images below. This will help prevent errors while installing plugins.

nodejs-installation-tutorial-1

nodejs-installation-tutorial-2

That's it fellow devs. If you have tips, please comment below. :)

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay