npm install throwing error related to ssl - reactjs

I am kind of new at this. Please help me. Thanks in advance.
PS C:\Project Code\ssp-ui-app> npm install
npm ERR! code EPROTO npm ERR! syscall write npm ERR! errno EPROTO npm
ERR! request to
https://codeload.github.com/eligrey/FileSaver.js/tar.gz/e865e37af9f9947ddcced76b549e27dc45c1cb2e
failed, reason: write EPROTO 045D0000:error:0A000152:SSL
routines:final_renegotiate:unsafe legacy renegotiation
disabled:c:\ws\deps\openssl\openssl\ssl\statem\extensions.c:908: npm
ERR!

Update your node.js installation.The following commands should do it (from here):
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
or reinstall node, then update npm.
First I removed node
apt-get purge node
Then install node according to the distibution. Docs here .
Then
npm install npm#latest -g

Related

npm install -g creat-react-app NOT WORKING (ERROR 405)

This happens when i type npm install -g creat-react-app
npm ERR! code E405
npm ERR! 405 Method Not Allowed - GET https://registry.npmjs.org/creat-react-app/creat-react-app
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Local\npm-cache_logs\2022-03-01T22_47_51_374Z-debug-0.log
You have a typo
I also suggest using npx instead of npm as well as removing G

Trying to install Expo-cli, But experiencing Error Codes like NPM Install Errors Like EACCES, AND ENOEMPTY

I am new to react native and I am having an issue installing expo-cli, and I get two different errors depending on how I try to install expo-cli. If I do npm install --global expo-cli, it gives the EACCES error.
This is what the problem looks like:
npm install --global expo-cli
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /Users/mac1/.npm-global/lib/node\_modules/expo-cli
npm ERR! dest /Users/mac1/.npm-global/lib/node\_modules/.expo-cli-sUcgOQ3i
npm ERR! errno -13
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 501:20 "/Users/mac1/.npm"npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mac1/.npm/\_logs/2021-12-28T04\_20\_03\_084Z-debug.log
When I input sudo npm install expo-cli -g --unsafe-perm, it gives an ENOEMPTYerror like this
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /Users/mac1/.npm-global/lib/node_modules/expo-cli
npm ERR! dest /Users/mac1/.npm-global/lib/node_modules/.expo-cli-sUcgOQ3i
npm ERR! errno -66
npm ERR! ENOTEMPTY: directory not empty, rename '/Users/mac1/.npm-global/lib/node_modules/expo-cli' -> '/Users/mac1/.npm-global/lib/node_modules/.expo-cli-sUcgOQ3i'
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mac1/.npm/_logs/2021-12-29T00_39_39_814Z-debug.log
It is important to add that I have tried to other methods that might solve this problem like, yarn add global expo-cli , sudo chown, npm cache clean --force, . But nothing has worked, I'm not sure if the methods don't work, or if I'm doing the procedure wrong.
Thank You for Your Time!
Option 1: I would recommend you install node js by using the nvm(node version manager). That way you can have different versions of node js installed on your system and you can easily switch versions. Then try using an earlier node version like 14 to install expo-cli
Option 2: Debug - Go through the log file, you are going to see where the error is coming from1

I can't install React! How can I fix this?

I'm trying to install React, but I obtain the error below, how can I fix them?
I'm trying to install with:
npm install -g create-react-app
npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /home/pedro/.npm/_cacache/tmp/09106e29
npm ERR! errno -13
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 1000:1000 "/home/pedro/.npm"
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pedro/.npm/_logs/2019-10-25T14_14_48_169Z-debug.log
According to the information provided by the error logs you just need to give the user under which npm package manager is running the proper permission to the folder /home/pedro/.npm.
The command provided as information should to it: sudo chown -R 1000:1000 "/home/pedro/.npm"
You can read a bit more about this folder in what is ~/.npm dir for?

can't run `npm install -g angular/cli`

I've recently generated a new ssh key on my mac and I can't seem to install angular/cli anymore. When I try to run npm install -g angular/cli I get this error:
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git#github.com/angular/cli.git
npm ERR!
npm ERR! ERROR: Repository not found.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
At the same time typescript installed perfectly fine. My npm version is 5.3.0 and node version is 8.2.1.
Thanks in advance!
I was using the incorrect repo name. It should have been:
npm install -g #angular/cli
Notice the #.

npm ERR! code 128 while run npm install on application

C:\SARANRAJ-K.R\Medrec\meds_6.2.0_update7>npm install
npm WARN deprecated express3-handlebars#0.5.2: THIS PACKAGE HAS BEEN RENAMED TO:
npm WARN deprecated grunt-ngmin#0.0.3: use grunt-ng-annotate instead
npm WARN deprecated phantomjs#2.1.7: Package renamed to phantomjs-prebuilt. Plea
npm WARN deprecated tough-cookie#0.12.1: ReDoS vulnerability parsing Set-Cookie
npm WARN deprecated ngmin#0.4.1: use ng-annotate instead
npm WARN deprecated tough-cookie#0.9.15: ReDoS vulnerability parsing Set-Cookie
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
npm WARN deprecated tough-cookie#2.2.2: ReDoS vulnerability parsing Set-Cookie h
npm WARN deprecated deflate-crc32-stream#0.1.2: module has been merged into crc3
npm ERR! code 128
npm ERR! Command failed: C:\Program Files\Git\cmd\git.EXE checkout 74fd92dc48f95
npm ERR! fatal: reference is not a tree: 74fd92dc48f9575abc701fbd84decad160c5cc6
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\gd14980\AppData\Roaming\npm-cache\_logs\2017-06-20T05_55_0
I got above error while run npm install command
Try using this command.
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo ln -sf /usr/local/n/versions/node/8.0/bin/node /usr/bin/node
I did also faced similar issue while running "npm run bootstrap" and below is the error
npm ERR! code 128
npm ERR! Command failed: git clone --mirror -q git://github.com/rehooks/window-scroll-position.git /root/.npm/_cacache/tmp/git-clone-ab3c3294/.git
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-ab3c3294/.git'
npm ERR!
But below is the solution as it was the issue due to node version.
I previously using below versions due to which it was failing,
npm --version
6.10.2
[Pipeline] sh
node --version
v12.9.1
which I changed to,
npm --version
6.10.2
[Pipeline] sh
+ node --version
v12.9.1
and it started working...;)

Resources