I cannot install using NPM and I get an error - node.js

I have been trying to make a vite project as well as install some packages into some already existing projects in vscode yet when I do this I get the error of:
npm ERR! code EHOSTUNREACH
npm ERR! syscall connect
npm ERR! errno EHOSTUNREACH
npm ERR! request to https://registry.npmjs.org/create-vite failed, reason: connect EHOSTUNREACH 2606:4700::6810:1123:443
npm ERR! A complete log of this run can be found in:
npm ERR! /home/chimera/.npm/_logs/2022-11-12T23_58_02_327Z-debug-0.log
I have no idea how to fix this and it is quite annoying as I am not able to make or change any projects ): I also have tried searching this on StackOverflow and I get a similar error but none of the fixes I have tried seems to do anything. If you know how to solve this could you please explain why this happened ): I am also finding and I don't know if this is related to it or not that my terminals take forever to load when before when I opened one they took less than a second to do so? Also, I am using Ubuntu (The latest version) and previously just used the latest version of node and there is where I got the error, the moment I downgraded to node v16 it went away. The command I tried running was the command for creating a new react project and also to adding daisyui to a project I had.

Related

Error when atempting to create an Angular project

I have both NodeJS 18.13.0 , npm 8.19.3 and AngularCLI 15.1.1 installed. But whenever I go to start a project with "ng new project" I get an error:
Installing packages (npm)...npm ERR! code FETCH_ERROR npm ERR! errno
FETCH_ERROR npm ERR! invalid json response body at
https://registry.npmjs.org/parse5-html-rewriting-stream reason:
Invalid response body while trying to fetch
https://registry.npmjs.org/parse5-html-rewriting-stream: Socket
timeout
npm ERR! A complete log of this run can be found in: npm ERR!
/home/shize/.npm/_logs/2023-01-18T01_10_18_697Z-debug-0.log ✖ Package
install failed, see above. The Schematic workflow failed. See above.
I've tried uninstalling angular and reinstalling it. I've also tried clearing cache or "npm verify cache". And finally, also tried "npm config set registry https://registry.npmjs.org".
Also, if this info is of any help, along my struggle two different folders were created when attempting to run "ng new project-name". These folders had a lock sign on them and I deleted them both with "rm -r". I really don't know what to do, the error has changed when trying different things. Like one being about a bad network or proxy error. Another error I came along when probing around for a solution was this:
npm WARN deprecated #npmcli/move-file#2.0.1: This functionality has
been moved to #npmcli/fs
But for now the error is the first one, so I'll take it from there. I've been stuck for hours, any help would be much appreciated.

NPM error when installing globally to create-react-app. Trying to make a boilerplate app but gets errors

I am new to react-native and whenever I try to write a command relating to npm, it returns an error (usually one that says EISDIR). I have tried looking at the answers to similar questions of mine, but am confused by the jargon about PATHS and issues with directories.
I have tried uninstalling and reinstalling node, and still when inputting npx create-react-app my-app it returns something along the lines of this:
npm ERR! code EISDIR
npm ERR! syscall read
npm ERR! errno -21
npm ERR! EISDIR: illegal operation on a directory, read
npm ERR! A complete log of this run can be found in:
npm ERR!
/Users/username/.npm/_logs/2021-08-03T20_29_31_976Z-debug.log
username#MacBook-Pro ~ %
Can someone explain a solution in a simple way for this? Please ask questions for more information if I left something out.
Thank you!

npm ERR! No versions available for telegraf-keyboard

I'm trying to install the telegram-keyboard with "npm i telegraf-keyboard" command. I used it a few months ago but now it's not working. It shows this error:
npm ERR! code ENOVERSIONS
npm ERR! No versions available for telegraf-keyboard
Can anyone try and say when you run this command do you get the same error or is it from my side only?
Same thing, feels like the repo was deleted somehow
You mean telegram-keyboard don't you? npm i telegram-keyboard works fine, and can be used in Telegraf.

attempting to deploy meteor application. Fails when running NPM INSTALL

Sorry for the following wall of text.
So I've been using someone else's meteor app. (they open sourced it) It's currently un-built and I've been running it on dev-mode. It's a lot slower than expected and users are having issues connecting to my local machine. So I'm attempting to deploy the app by following: https://guide.meteor.com/deployment.html#deploying.
So I've been getting errors when trying to run npm i. My dad recommended me to run npm cache verify and try again, then npm cache clean as a last resort. Neither worked and I've still am getting errors. Although as soon as I tried again after running npm cache verify the error amount skyrocketed. I unfortunately don't have the errors I got before I cleared my cache but I have the current logs here: https://pastebin.com/dAcRnE9v But here is a snapshot:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fibers#2.0.2 install: `node build.js || nodejs build.js`
npm ERR! Exit status 1
npm ERR! Failed at the fibers#2.0.2 install script.
I honestly don't have any idea what todo. I've never worked with meteor before, nor the fibers module that's failing. I don't even know if this is the right place I should be asking for help.
I once had fibers npm package in my package.json which caused a similar error. Once I removed it everything built just fine.
You can't change Meteor's version of node - for compatibility reasons it bundles node/npm with Meteor to protect you. Just prefix all your npm/node commands with meteor like this:
meteor npm install
It won't use the node version (13.x) that you have installed

NPM install failing with 502 error

This is a rather obscure issue. I have an Angular app that will be running through Codeship for CI. However, when it comes time to run npm install on the Codeship box, npm gives back
-npm ERR! fetch failed https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 502
\npm ERR! fetch failed https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 502
\npm ERR! fetch failed https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz
npm ERR! Linux 4.2.0-38-generic
npm ERR! argv "/home/rof/.nvm/versions/node/v4.1.1/bin/node" "/home/rof/.nvm/versions/node/v4.1.1/bin/npm" "install"
npm ERR! node v4.1.1
npm ERR! npm v2.14.4
npm ERR! fetch failed with status code 502
This was quite strange, since the npm install worked just fine on my box. My first instinct was that it had to be an issue with the NPM repository, so I grabbed the url for the package(https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz) and threw it into a new Chrome tab. Sure enough, the archive downloaded almost instantly. I was confused by this, so I tried the Codeship build again, but got the same results. I decided to SSH into the Codeship box to see if I could access it. I ran
curl https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz
and as I expected I got the 502 error. However, when I ran the same command from the terminal on my machine, I got the same result, even though the npm install ran perfectly for me. I wasn't able to find anyone else having this type of an issue, and a 502 seems like a very rare code for the NPM registry to be returning. Any ideas?
This is a problem with the registry.npmjs.org in some regions.
Here is issue:
https://github.com/npm/npm/issues/13284
Try to keep one registry inside .npmrc file, only one of them works.
The order of registry also does matter. Also try to set:
npm config delete proxy
npm config delete https-proxy
to clean proxy inside terminal.
I'm seeing the same issue via npm install on Ubuntu 14 running on AWS
curl https://registry.npmjs.org/combine-lists/-/combine-lists-1.0.0.tgz
returns 502 Bad Gateway from the ubuntu server, but works fine from local client
There's an open issue at NPM for this:
https://github.com/npm/npm/issues/13284
NPM just acknowledged the issue and they are working on it. Your can track the status at below link.
http://status.npmjs.org
I got this error while publishing my package on npm. After banging my head against the wall for a few hours, I realized I was on mobile hotsopt. I switched to wifi and bang there was my package on npm!

Resources