NPM getting 404 on installing packages - node.js

I'm trying to install packages for an angular project based on a template of the customer.
He has provided me this let's say ready to use template, but when I run npm install I get errors.
npm ERR! code E404
npm ERR! 404 Not Found - GET https://artifactory.springlab.enel.com/artifactory/api/npm/npm-public/#angular-devkit%2fbuild-angular
npm ERR! 404
npm ERR! 404 '#angular-devkit/build-angular#~0.1102.19' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git URL.
As you can see the issue is on a GET from a server of theirs. I have highlighted this issue but they said that is not their fault as they can run npm install without any issue.
Please note that:
When I run the npm install I'm logged in inside their VPN to access the servers.
I've tried several versions of node and npm, using the same version that is working on their machines.
I've tried both --force and --legacy-peer-deps and I always get the same error.
I have no issues on npm in any of the other 10s projects I work on (for other customers)
I have also disabled the antivirus.
IT support from the company is not providing me with help, so I'm alone and I don't know what to check.
How can I get more details on why I got a 404 on that?

Related

Trying to install axios on a React project via npm i axios

When I run npm i axios I get the following errors:
C:\Users\Mary\star-wars>npm i axios
npm ERR! code E404
npm ERR! 404 Not Found - GET https://skimdb.npmjs.com/registry/axios/-/axios-0.27.2.tgz - not_found
npm ERR! 404
npm ERR! 404 'axios#https://skimdb.npmjs.com/registry/axios/-/axios-0.27.2.tgz' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Mary\AppData\Local\npm-cache_logs\2022-07-07T14_23_38_747Z-debug-0.log
I can´t find anything that works for me, I´ve tried to reinstall dependencies, I´ve tried to unistall axios and re-install it without success.
I´ve checked the log & it contains the same error that shows when I run the command.
Has anyone found a solution for this?
I was finally able to do what I intended by running it as Admin, creating a different folder, running npm cache clean -f and setting npm. registry
After that, everything went smooth.

npm install outputs 404 error on private package, but works inside vagrant

Read several threads here in SO but haven't found the exact some type of issue. I'm having trouble trying to install a private package from my company (hosted on GitLab). The strangest thing is that I've already made it for the same repo, but inside vagrant. On vagrant, after having receiving the following error on a npm install:
ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/#company-name%2foauth20-provider - Not found
npm ERR! 404
npm ERR! 404 '#company-name/oauth20-provider#0.8.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'project-srv'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\João~1\AppData\Roaming\npm-cache\_logs\2022-02-06T14_38_17_991Z-debug.log
I solved it by following these steps:
1 - Generate a new personal access token on GitLab (scope API): https://gitlab.com/-/profile/personal_access_tokens
2 - Run commands:
npm config set #company-name:registry https://gitlab.com/api/v4/projects/project-id/packages/npm/
npm config set -- '//gitlab.com/api/v4/projects/project-id/packages/npm/:_authToken' "<my-personal-access-token>"
When I try to run npm install outside of vagrant (in the same folder or another clone of the repo), it still gives the 404 error above. The thing is, I'm certain the steps I've tried are valid, since they work inside vagrant. What can possibly change by trying to do npm install outside of vagrant? I believe that it can possibly have to do with the OS, since I'm using the Laravel Homestead vagrant box (i.e. Ubuntu 20.04), and I'm running it on a Windows 10 machine.

Installing npm private package gives back 404/405 - "is not in the npm registry"

npm ERR! code E404
npm ERR! 404 Not Found - GET http://registry.npmjs.org/#office%2fintegration-sdk - Not found
npm ERR! 404
npm ERR! 404 '#office/integration-sdk#*' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
We have private bitbucket repo, with package code, that we want to make npm private package out of it.
I've managed to publish it thru CLI with npm publish, and with the bitbucket pipeline.
And it can be installed fine, as long as i am logged in with npm login.
But we want to be able to install it without logging to npm(when deployed etc..), and i thought NPM_TOKEN is there for those reasons.
I've tried buncha stuff in .npmrc file, mostly like:
#office:registry=https://registry.npmjs.org/:_authToken=<'read/publish token from npm'>
Steps:
npm publish
check npm - package looks good, updated, etc..
run install command - npm i #office/integration-sdk
Fails with either 404(most of the time), and with 405 Method not Allowed when i have #office:registry=https://registry.npmjs.org/#office.
One thing that might be causing this.. We only have user account on npm i guess, it is Pro account with private packages thing. But we didn't create organization. Could that be a problem, i mean it can be published, and installed when logged in, and also public packages can be installed just fine when not logged in.

Sonos Simulator not able to compile node package

Trying to install and utilize the https://developer.sonos.com/tools/developer-tools/sonos-simulator/
When following the install instructions and trying to install the node package via the npm install command within the directory it fails with a 404 error trying to find node-ssdp as seen from the snippet below:
P:\sonosDevel\sonos-simulator-0.4.34>npm install
npm notice
npm notice New minor version of npm available! 7.5.1 -> 7.6.3
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.6.3
npm notice Run npm install -g npm#7.6.3 to update!
npm notice
npm ERR! code E404
npm ERR! 404 Not Found - GET https://github.com/sonos/node-ssdp/archive/master.tar.gz
npm ERR! 404
npm ERR! 404 'node-ssdp#https://github.com/sonos/node-ssdp/archive/master.tar.gz' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\duart\AppData\Local\npm-cache\_logs\2021-03-18T21_59_44_515Z-debug.log
I am doubtful there is much to do other than hope the sonos developers reupload the package and potentially update the Sonos Simulator but I may as well throw it on here to see if anyone has a solution to have get the Simulator running or perhaps some other solution to simulate a Sonos Device on the network without actually owning a Sonos device.
I was having a play around with this today, and managed to get it working.
I installed an old (4.x) version of node as this is what the documentation said it worked with (I honestly didn't try anything newer as I couldn't get the simulator to do what I wanted so uninstalled it after).
The main issue was with node-ssdp, as the included package file with the simulator was trying to get it from a repo that no longer exists. After some trial and error, I found that if you edit the package file to specify node-ssdp 2.7.0 (which is the version that was released when the simulator was), the npm install should go through ok. (If you install a newer version the simulator crashes a few seconds after you run it).
Hopefully this helps!

Protractor Error - #types/jasmine' is not in the npm registry

I am trying to install protractor but receiving following error.
command:
npm install -g protractor
npm ERR! node v4.4.3
npm ERR! npm v2.15.1
npm ERR! code E404
npm ERR! 404 no such package available : #types/jasmine
npm ERR! 404
npm ERR! 404 '#types/jasmine' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'protractor'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR! F:\temp\chrome downloads\npm-debug.log
I came across this issue today and my problem was that I had set a custom registry within the npm config file. Have you ever used "npm set registry"?
If so, you can manually tell npm where to look for the '#types' registry with the following command:
npm config set #types:registry https://registry.npmjs.org/
The problem is coming from the fact that you're using a private registry that has not yet added support for #organization packages.
In my case, I was using Sonatype Nexus and my version didn't have support for those types of packages. #Willie Valdez's suggestion is probably the best solution for you, right now.
Also, check if you have a .npmrc file in your home directory or in your project directory. The registry might be there. If that's the case, just rename the file to npmrc_bak or something else until you install the package and then revert back to its original name.
You can also include a .npmrc file in your current project with the below details:
#angular:registry=https://registry.npmjs.org
#types:registry=https://registry.npmjs.org
#ngtools:registry=https://registry.npmjs.org
#angular-cli:registry=https://registry.npmjs.org
its handy and resuable across new projects.

Resources