NPM packages are not installing and giving ENETUNREACH error - pls help! MAC - npm

When I try to install packages with npm I get the following error :
npm ERR! code ENETUNREACH
npm ERR! syscall connect
npm ERR! errno ENETUNREACH
npm ERR! request to https://registry.npmjs.org/node-sass failed, reason: connect ENETUNREACH 2606:4700::6810:1723:443
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/**/.npm/_logs/2023-02-07T23_40_59_164Z-debug-0.log
I googles ENETUNREACH and seems like it's a network connection but my connection is fine. I'm very new to all this and don't much know about computers (only learning to code) but I can't figure out why this error is coming, it's driving me crazy
I have installed packages with npm in the past and it worked, don't know what's changed
I wanna uninstall it and start again but can't seem to uninstall
Can anyone help??
I tried deleting node but I can't even find where it's stored on my computer
node version is v18.14.0
npm version is 9.3.1

Related

error when i try to install vue.js in my computer (windows 10)

Below the error message:
1 package is looking for funding
npm ERR! code ENOLOCK
npm ERR! audit This command requires an existing lockfile.
npm ERR! audit Try creating one first with: npm i --package-lock-only
npm ERR! audit Original error: loadVirtual requires existing shrinkwrap file
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\vinic\AppData\Local\npm-cache_logs\2022-11-11T20_01_58_589Z-debug-0.log
Does anyone know what can it be?
I tried to run the command prompt and powershell on windows in addition to finishing in Vs Code and I was not successful

I cannot install npm with node, any ideas? [duplicate]

I keep getting the same error message when trying to create a new angular project.
I tried to create a new angular project using Windows Powershell with the following commands:
ng new hello-world
-> Would you like to add angular routing? - Yes
-> Stylesheet format? - CSS
I obtained the error message below. I already tried to reinstall angular cli and I'm running Powershell using Administrator.
Installed versions:
Angular CLI: 8.0.6
Node: 10.16.0
OS: win32 x64
Error message:
npm WARN tarball data for tslint#~5.15.0 (sha512-6bIEujKR21/3nyeoX2uBnE8s+tMXCQXhqMmaIPJpHmXJoBJPTLcI7/VHRtUwMhnLVdwLqqY3zmd8Dxqa5CVdJA==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for jasmine-spec-reporter#~4.2.1 (sha512-FZBoZu7VE5nR7Nilzy+Np8KuVIOxF4oXDPDknehCYBDE080EnlPu0afdZNmpGDBRCUBv3mj5qgqCRmk6W/K8vg==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for acorn#^6.0.5 (sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for #angular/language-service#~8.0.3 (sha512-04XojOo9FJgEQE/rZafnaJQxPEU+//TSzTgpGoIVzCSMx+joCY/ZSSwJZPWxiHlOE57W/zX02ZY+TwcM81oTdw==) seems to be corrupted. Trying one more time.
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\konta\Desktop\Programming_files\Angular\hello-world\node_modules\.staging\#angular\platform-browser-447d0944\esm2015\animations\src\animation_builder.js'
npm ERR! path C:\Users\konta\Desktop\Programming_files\Angular\hello-world\node_modules\.staging\jasmine-spec-reporter-cbb15ffc\screenshot.gif
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\konta\Desktop\Programming_files\Angular\hello-world\node_modules\.staging\jasmine-spec-reporter-cbb15ffc\screenshot.gif'
npm ERR! { [Error: EPERM: operation not permitted, unlink 'C:\Users\konta\Desktop\Programming_files\Angular\hello-world\node_modules\.staging\jasmine-spec-reporter-cbb15ffc\screenshot.gif']
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\Users\konta\Desktop\Programming_files\Angular\hello-world\node_modules\.staging\jasmine-spec-reporter-cbb15ffc\screenshot.gif'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path:
npm ERR! 'C:\\Users\\konta\\Desktop\\Programming_files\\Angular\\hello-world\\node_modules\\.staging\\jasmine-spec-reporter-cbb15ffc\\screenshot.gif' },
npm ERR! stack:
npm ERR! 'Error: EPERM: operation not permitted, unlink \'C:\\Users\\konta\\Desktop\\Programming_files\\Angular\\hello-world\\node_modules\\.staging\\jasmine-spec-reporter-cbb15ffc\\screenshot.gif\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path:
npm ERR! 'C:\\Users\\konta\\Desktop\\Programming_files\\Angular\\hello-world\\node_modules\\.staging\\jasmine-spec-reporter-cbb15ffc\\screenshot.gif',
npm ERR! parent: 'hello-world' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm WARN tar EPERM: operation not permitted, lstat 'C:\Users\konta\Desktop\Programming_files\Angular\hello-world\node_modules\.staging\#angular\router-8388bfd5\esm2015\src\directives'
npm WARN tarball tarball data for typescript#3.4.4 (sha512-xt5RsIRCEaf6+j9AyOBgvVuAec0i92rgCaS3S+UVf5Z/vF2Hvtsw08wtUTJqp4djwznoAgjSxeCcU4r+CcDBJA==) seems to be corrupted. Trying one more time.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\konta\AppData\Roaming\npm-cache\_logs\2019-07-01T01_21_13_653Z-debug.log
Package install failed, see above.
I found the problem: My antivirus was somehow blocking the files without me knowing. It worked once I paused my antivirus during the installation.
In windows10 I disabled the windows defender / windows security ==> realtime protection and try again npm install command and it worked
1.
2.
3.
NOTE : Turn on the real time protection again after installation complete.
Restarting the machine worked for me.
I had this problem on MAC. I just added 'sudo' before the command and it worked.
sudo npm install -g parcel-bundler
I tried opening CMD with Run as Admisnistrator then run npm i and it worked for me
I'd just like to add a small little answer based on Qadir Hussain's answer.
If you disable "Realtime Protection" in Windows Security, you're going to leave your laptop or PC vulnerable to any viruses that may infect it when "Realtime Protection" is off. This may seem a bit impossible if you're only installing an NPM package, but some apps may have a hidden background process waiting for "Realtime Protection" to be disabled, and when it is, it could inject a virus.
That been said, there's still an option.
First things first, open Windows Security by typing "Windows Security" in the Start Menu and tap "Open".
After that, go to "Virus & Threat Protection".
Next, scroll down until you find "Manage Settings" under "Virus & Threat Protection Settings".
Then, scroll down until you see "Exclusions". Under "Exclusions" there's a link that says "Add or remove exclusions".
Once that's done, tap the button that says "Add an exclusion". Then tap "Folder" on the drop-down menu.
Choose the node_modules directory that is giving issues.
Last but not least, Allow administrative permissions.
Finally, exit Windows Security.
I wouldn't recommend excluding your entire Projects folder, as that will disable all scans for the directory.
Small disclaimer here, I'm only making this answer as a means of helping others without disabling "Realtime Protection". While I'm not encouraging this, this might help fix a common problem.
Have a good day. :)
For me, there are several possibilities:
Intercepted by anti-virus software, resulting in inoperability.
It is locked by IDE, resulting in inoperable.
The task is locked by npm running, resulting in inoperable.
Cancelling the npm start process and closing the terminal window (I use Hyper Terminal) worked for me (using Win 10).
I was then able to uninstall an npm package and install another.
I had visual studio code running. I turned it off and boom! worked for me!
To me, using Windows 10 the only thing that solved this problem was: exclude the node_modules folder, open Visual Studio Code in Admin mode in the project folder, and execute the following command:
npm install -g --unsafe-perm
For me the issue was with npm version I was using. I changed to a npm version which did not have the bug by using the below command:
npm install --global npm#8.3.1
I found this solution in a github issue:
Link to github issue
Hope it helps you like it did me!
was facing this problem and this is how it got solved :
-stoping the execution of the development server for both front-end and backend:
two things:
try admin.
make sure other processes does not occupying the folder/file
with me, it was not related to antivirus.
it appears that a process occupied this folder. in my case a node process occupied my node_modules folder.
i found it out by using process-explorer - i searched the path end found that a node process using this folder(even though I closed it! very common in windows), so i ended this process and then i did not got this error anymore.
I had the same issue What I have done wrong is I had set the npm registry to a local registry, without knowing that I faced this issue once I reset to globally using npm config set registry https://registry.npmjs.org/ error went away.
I tried everything above.
Deleting node_modules and re-installing did the trick for me.
This happened when I tried installing a new npm dependency, jest, with:
npm i --save-dev jest
I got it working by simply rerunning the command.

NPM issue using React

I currently have an issue where I can no longer work, with a machine that I bought using NPM. The issue does not run using npm start.
david#Davids-MacBook-Pro happy % npm start
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! happy#0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the happy#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/david/.npm/_logs/2020-08-09T06_56_49_544Z-debug.log
This is the main issue. Also have "2020-08-09T06_56_49_544Z-debug.log"
Can anyone help me...
Thanks you,
David
The NPM One
2020-08-09T06_56_49_544Z-debug.log
You are trying to run this from your /Users/david/ directory. You need to navigate to the root of your project (where package.json is), then do npm start:
$ cd path/to/my/project
$ npm start
Update:
Add that babel-eslint package to your package.json.
Show your directory tree inside users/David/happy
Thanks very much. I have finally been able to make NPM work using because there are two different type of sites ~/david and ~/david/happy.
I completely removed the NPM of ~/david, and now only have NPM for ~/david/happy working now.
the issue is
https://github.com/facebook/create-react-app/issues/8781

npm install package.js - can I revert to earlier package?

I am following this tutorial on vue.js on YouTube. One of the packages I installed was eslint 5.5 (which is the current version). I saw this error message:
npm ERR! Failed at the server#1.0.0 lint script 'eslint **/*.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the server package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! eslint **/*.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs server
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls server
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/jason/Documents/vue-movie/server/npm-debug.log
I tried updating Node and NPM, but that did not change this failure. The tutorial is using "^4.6" and I was wondering if there is a way to revert the package I have to an earlier version? And how would I do that?

npm install host key verification failed

I ran npm install in angular2+ project directory and got below error which I cannot understand at all.
npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\bin\git.EXE ls-remote -h -t ssh://git#bitbucket.org/path/projectname.git
npm ERR!
npm ERR! Host key verification failed.
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
I have created ssh key on bitbucket and account and saved it on drive. |
I have clone project from bitbucket.
What does this error has to do with that?
As I am new on project so don't have much knowledge.
Do I need to provide ssh key while npm install as well?
Please let me know if I can provide more info related to question.
Thanks!
Please check the npm version that you are using. Npm comes bundled with node and you shouldn't have multiple instances on your classpath.
Hey yup, I thought as much, but seeing as I had updated npm to the
latest version ( I even uninstalled node and reinstalled ) with the
same result. npm -v still showed the same version - 1.4.9.
FYI for others that may have the same issue. I also have Chocolatey
installed, and it seems that npm was also installed via Chocolately
which seems to overide the npm path. Uninstalling npm from Chocolately
resolved the npm version issue.
After that angular/cli installs correctly from npm.
https://github.com/angular/angular-cli/issues/6313#issuecomment-301360623