57

I am getting this warning from github on my npm project build process... I tried searching on the internet and also read the blog link posted by github - but I could not find the solution to it anywhere. Am I missing something ?

Warning seen

npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/

3
  • Did you try this part of the post?
    – Iguananaut
    Sep 3, 2021 at 11:19
  • What version of node are you using? What version of npm? What operating system are you using?
    – bk2204
    Sep 3, 2021 at 15:04
  • node version is v10.15.3 and npm version 6.4.1 and ubuntu 18 Sep 3, 2021 at 19:27

8 Answers 8

156

After updating your NodeJS and NPM Version run this command in CLI

npm set registry=https://registry.npmjs.org/

Save your Life, Thanks me Later :D

2
12

I can solve the issue by the way:

First Step: npm set registry=https://registry.npmjs.org/

Second Step: npm install -g https://tls-test.npmjs.com/tls-test-1.0.0.tgz

9

Besides updating your version of node to an active or current LTS you want to ensure your NPM registry is set to an HTTPS endpoint:

registry=https://registry.npmjs.org/
1
3

You are facing that issue because your registry is set to HTTP version which is a bit insecure so the first thing that you should do is to put it to HTTPS version by running the following command below

npm set registry=https://registry.npmjs.org/

Then, after that you have to make sure your version of npm supports TLS 1.2, you can install a test package from an HTTPS endpoint that already has TLS 1.0 and TLS 1.1 disabled: by running this command below

npm install -g https://tls-test.npmjs.com/tls-test-1.0.0.tgz

You should see the following message: Hello! The tls-test package was successfully downloaded and installed. Congratulations! Your package manager appears to support TLS 1.2.

If you don't see the message, don't worry you can try to install the package again, hope it will work out for you

1
  1. Please make sure that you have latest(or somewhat recent) version of node installed on your system

  2. To make sure that your version of npm supports TLS 1.2, you can install a test package from an HTTPS endpoint that already has TLS 1.0 and TLS 1.1 disabled:

npm install -g https://tls-test.npmjs.com/tls-test-1.0.0.tgz

You should see the following message:

Hello! The tls-test package was successfully downloaded and installed. Congratulations! Your package manager appears to support TLS 1.2.

If you didn't see the above message, try to install some npm package.

If you didn't see the npm notice, you're good to go. If you happened to see again, please run the below command too.

npm set registry=https://registry.npmjs.org/

Source: The npm registry is deprecating TLS 1.0 and TLS 1.1

1

You are facing this issue because of your registry is still set to http version and that causing you this error. All You need to do is just Run following command in your terminal.

 npm config set registry https://registry.npmjs.org/

and that is it! now you can run any npm command

0

Well, I had several problems with node and npm. The one described in this question was only the last one.

I was not able to execute npm install, the node_modules were partially downloaded and at the end of the execution they were all deleted (the folder was visible, but it was deleted after running the command).

First problem: --location=global

First, I was getting this error message:

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead

Which I solved by following these instructions: https://stackoverflow.com/a/72592742/7389293

Apparently that allowed me to update to:

  • node -v: c16.16.0
  • npm -v: 8.17.0

Today's date: August 13, 2022.

Second problem: use TLS 1.2 or higher

Then, I still was having the error described in this question, which didn't allowed me to install the node_modules folder in my project:

npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher

The selected answer to the question made in the present screen your reading, finally fixed the problem: https://stackoverflow.com/a/70555822/7389293

After all of this I was able to run npm again, install all the packages from the package.json file, and run the website normally in the browser.

0

maxtimeout didn't work for me so I tried converting to yarn by npm I -g yarn and then yarn install in the root directory of the project(where I have to install the node_modules)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.