404 Not Found

ubuntu npm install failed to fetch

At this point, npm is installed, since npm -v works properly. But when I attempted to use npm to install a package I got an error:

sudo npm install -g grunt-cli 
npm ERR! Error: failed to fetch from registry: grunt-cli npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12 npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9) npm ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18) npm ERR! at Request.callback (/usr/lib/nodejs/request/main.js:119:22) npm ERR! at Request. (/usr/lib/nodejs/request/main.js:212:58) npm ERR! at Request.emit (events.js:88:20) npm ERR! at ClientRequest. (/usr/lib/nodejs/request/main.js:412:12) npm ERR! at ClientRequest.emit (events.js:67:17) npm ERR! at HTTPParser.onIncoming (http.js:1261:11) npm ERR! at HTTPParser.onHeadersComplete (http.js:102:31) npm ERR! You may report this log at: npm ERR! npm ERR! or use npm ERR! reportbug --attach /home/jado/sourceFromGit/JADO-FROM-GIT/npm-debug.log npm npm ERR! npm ERR! System Linux 3.2.0-35-generic npm ERR! command "node" "/usr/bin/npm" "install" "-g" "grunt-cli" npm ERR! cwd /home/jado/sourceFromGit/JADO-FROM-GIT npm ERR! node -v v0.6.12 npm ERR! npm -v 1.1.4 npm ERR! message failed to fetch from registry: grunt-cli npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/jado/sourceFromGit/JADO-FROM-GIT/npm-debug.log npm not ok 

Источник

Can’t install npm — Unable to correct problems, you have held broken packages?

I am trying to upgrade my nodejs to 7.6 but failed. Now I have a new problem after re-installing node 6.10:

$ sudo apt-get purge nodejs npm Reading package lists. Done Building dependency tree Reading state information. Done Package 'npm' is not installed, so not removed The following packages were automatically installed and are no longer required: linux-headers-4.8.0-40 linux-headers-4.8.0-40-generic linux-image-4.8.0-40-generic linux-image-extra-4.8.0-40-generic Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED nodejs* 0 to upgrade, 0 to newly install, 1 to remove and 53 not to upgrade. After this operation, 51.7 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database . 278133 files and directories currently installed.) Removing nodejs (6.9.5-1nodesource1~yakkety1) . Processing triggers for man-db (2.7.5-1) . (Reading database . 274476 files and directories currently installed.) Removing nodejs (6.9.5-1nodesource1~yakkety1) . Purging configuration files for nodejs (6.9.5-1nodesource1~yakkety1) . dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules' not empty so not removed 

Why does it say Package ‘npm’ is not installed, so not removed ? i have been using npm to install many node packages for my projects!! I ignore the error and went on installing node 7.6:

$ curl -sL https://deb.nodesource.com/setup_7.6 | sudo -E bash - bash: line 1: html: No such file or directory bash: line 2: syntax error near unexpected token ` 
$ sudo apt-get install npm Reading package lists. Done Building dependency tree Reading state information. Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies. npm : Depends: nodejs but it is not going to be installed Depends: node-abbrev (>= 1.0.4) but it is not going to be installed Depends: node-ansi (>= 0.3.0-2) but it is not going to be installed Depends: node-ansi-color-table but it is not going to be installed Depends: node-archy but it is not going to be installed Depends: node-block-stream but it is not going to be installed Depends: node-fstream (>= 0.1.22) but it is not going to be installed Depends: node-fstream-ignore but it is not going to be installed Depends: node-github-url-from-git but it is not going to be installed Depends: node-glob (>= 3.1.21) but it is not going to be installed Depends: node-graceful-fs (>= 2.0.0) but it is not going to be installed Depends: node-inherits but it is not going to be installed Depends: node-ini (>= 1.1.0) but it is not going to be installed Depends: node-lockfile but it is not going to be installed Depends: node-lru-cache (>= 2.3.0) but it is not going to be installed Depends: node-minimatch (>= 0.2.11) but it is not going to be installed Depends: node-mkdirp (>= 0.3.3) but it is not going to be installed Depends: node-gyp (>= 0.10.9) but it is not going to be installed Depends: node-nopt (>= 3.0.1) but it is not going to be installed Depends: node-npmlog but it is not going to be installed Depends: node-once but it is not going to be installed Depends: node-osenv but it is not going to be installed Depends: node-read but it is not going to be installed Depends: node-read-package-json (>= 1.1.0) but it is not going to be installed Depends: node-request (>= 2.25.0) but it is not going to be installed Depends: node-retry but it is not going to be installed Depends: node-rimraf (>= 2.2.2) but it is not going to be installed Depends: node-semver (>= 2.1.0) but it is not going to be installed Depends: node-sha but it is not going to be installed Depends: node-slide but it is not going to be installed Depends: node-tar (>= 0.1.18) but it is not going to be installed Depends: node-underscore but it is not going to be installed Depends: node-which but it is not going to be installed E: Unable to correct problems, you have held broken packages. 

Источник

Читайте также:  Рейтинг дистрибутивов linux 2022

Common errors

The error Error: ENOENT, stat ‘C:\Users\\AppData\Roaming\npm’ on Windows 7 is a consequence of joyent/node#8141, and is an issue with the Node installer for Windows. The workaround is to ensure that C:\Users\\AppData\Roaming\npm exists and is writable with your normal user account.

npm ERR! Error: ENOSPC, write

You are trying to install on a drive that either has no space, or has no permission to write.

  • Free some disk space or
  • Set the tmp folder somewhere with more space: npm config set tmp /path/to/big/drive/tmp or
  • Build Node yourself and install it somewhere writable with lots of space.
npm ERR! not found: git
ENOGIT

You need to install git. Or, you may need to add your git information to your npm profile. You can do this from the command line or the website. For more information, see «Managing your profile settings».

Running a Vagrant box on Windows fails due to path length issues

@drmyersii went through what sounds like a lot of painful trial and error to come up with a working solution involving Windows long paths and some custom Vagrant configuration:

  
config.vm.provider "virtualbox" do |v|
v.customize ["sharedfolder", "add", :id, "--name", "www", "--hostpath", (("//?/" + File.dirname(__FILE__) + "/www").gsub("/","\\"))]
end
config.vm.provision :shell, inline: "mkdir /home/vagrant/www"
config.vm.provision :shell, inline: "mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` > www /home/vagrant/www", run: "always"

In the code above, I am appending \\?\ to the current directory absolute path. This will actually force the Windows API to allow an increase in the MAX_PATH variable (normally capped at 260). Read more about max path. This is happening during the sharedfolder creation which is intentionally handled by VBoxManage and not Vagrant’s «synced_folder» method. The last bit is pretty self-explanatory; we create the new shared folder and then make sure it’s mounted each time the machine is accessed or touched since Vagrant likes to reload its mounts/shared folders on each load.

Читайте также:  Linux где лежат шрифты

npm only uses git: and ssh+git: URLs for GitHub repos, breaking proxies

I fixed this issue for several of my colleagues by running the following two commands:

 
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://

One thing we noticed is that the .gitconfig used is not always the one expected so if you are on a machine that modified the home path to a shared drive, you need to ensure that your .gitconfig is the same on both your shared drive and in c:\users\[your user]\

npm ERR! Error: 7684:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:787:

You are trying to talk SSL to an unencrypted endpoint. More often than not, this is due to a proxy configuration error (see also this helpful, if dated, guide). In this case, you do not want to disable strict-ssl – you may need to set up a CA / CA file for use with your proxy, but it’s much better to take the time to figure that out than disabling SSL protection.

npm ERR! Error: SSL Error: CERT_UNTRUSTED
npm ERR! Error: SSL Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE

This problem will happen if you’re running Node 0.6. Please upgrade to node 0.8 or above. See this post for details.

You could also try these workarounds: npm config set ca «» or npm config set strict-ssl false

npm ERR! Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN
  • upgrade your version of npm npm install npm -g —ca=»»
  • tell your current version of npm to use known registrars npm config set ca=»»

If this does not fix the problem, then you may have an SSL-intercepting proxy. (For example, https://github.com/npm/npm/issues/7439#issuecomment-76024878)

 
npm http 404 https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.7.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.7.0.tgz
npm ERR! Error: 404 Not Found
 
npm http 500 https://registry.npmjs.org/phonegap
  • It’s most likely a temporary npm registry glitch. Check npm server status and try again later.
  • If the error persists, perhaps the published package is corrupt. Contact the package owner and have them publish a new version of the package.
npm ERR! SyntaxError: Unexpected token
npm ERR! registry error parsing json
  • Possible temporary npm registry glitch, or corrupted local server cache. Run npm cache clean and/or try again later.
  • This can be caused by corporate proxies that give HTML responses to package.json requests. Check npm’s proxy configuration.
  • Check that it’s not a problem with a package you’re trying to install (e.g. invalid package.json ).

Many ENOENT / ENOTEMPTY errors in output

npm is written to use resources efficiently on install, and part of this is that it tries to do as many things concurrently as is practical. Sometimes this results in race conditions and other synchronization issues. As of npm 2.0.0, a very large number of these issues were addressed. If you see ENOENT lstat , ENOENT chmod , ENOTEMPTY unlink , or something similar in your log output, try updating npm to the latest version. If the problem persists, look at npm/npm#6043 and see if somebody has already discussed your issue.

cb() never called! when using shrinkwrapped dependencies

Take a look at issue #5920. We’re working on fixing this one, but it’s a fairly subtle race condition and it’s taking us a little time. You might try moving your npm-shrinkwrap.json file out of the way until we have this fixed. This has been fixed in versions of npm newer than npm@2.1.5 , so update to npm@latest .

Sometimes npm login fails for no obvious reason. The first thing to do is to log in at https://www.npmjs.com/login and check that your e-mail address on npmjs.com matches the email address you are giving to npm login .

If that’s not the problem, or if you are seeing the message «may not mix password_sha and pbkdf2» , then

  1. Log in at https://npmjs.com/
  2. Change password at https://npmjs.com/password – you can even «change» it to the same password
  3. Clear login-related fields from ~/.npmrc – e.g., by running sed -ie ‘/registry.npmjs.org/d’ ~/.npmrc
  4. npm login

and it generally seems to work.

npm hangs on Windows at addRemoteTarball

Check if you have two temp directories set in your .npmrc :

  
> npm config ls -l

Look for lines defining the tmp config variable. If you find more than one, remove all but one of them.

See https://github.com/npm/npm/issues/7590 for more about this unusual problem.

npm not running the latest version on a Windows machine

See the section about Windows here.

Источник

Оцените статью
Adblock
detector