1

Good day to all:

I had these error while installing JShint and CSS Linter thru my Vagrant environment. I'm using Vagrant in Windows and Ubuntu is on my vagrant box.

I already installed npm and nodejs, tried lot of updates way but no luck.

Maybe others can shed a light.

Here is the error.

vagrant@precise32:~$ npm install jshint

vagrant@precise32:~$ npm install jshint
npm http GET https://registry.npmjs.org/jshint

npm ERR! Error: failed to fetch from registry: jshint
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-cient/request.js:31:9)
npm ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:
npm ERR! at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR! at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR! at Request.emit (events.js:88:20)
npm ERR! at ClientRequest.<anonymous (/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! <http://bugs.debian.org/npm>
npm ERR! or use npm ERR!reportbug --attach /home/vagrant/npm-debug.log npm
npm ERR! npm ERR! System Linux 3.2.0-23-generic-pae
npm ERR! command "node" "/usr/bin/npm" "install" "jshint"
npm ERR! cwd /home/vagrant
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: jshint
npm ERR! Additional logging details can be found in:
npm ERR! /home/vagrant/npm-debug.log

npm not ok

1 Answers1

2

Please respond with your npm --version and node --version. I suspect either out of data npm/nodejs libraries.

In either case, try this:

npm config set registry https://registry.npmjs.org/

Closed bug here: https://github.com/npm/npm/issues/2119

EDIT: Perhaps this is an issue with Windows host to a Ubuntu VM:

https://github.com/npm/npm/issues/7308

  1. npm install jshint --no-bin-link If it installs, then your filesystem doesn't support links and each time you run npm install, you will need to append this flag. If you use this flag, you can't install globally with the npm install -g flag.
  2. npm may not be detecting your host filesystem since npm is run on Ubuntu VM. You need to allow symlinks on Windows host in the Vagrantfile:

    config.vm.provider "virtualbox" do |v|
        v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"]
    end
    
  3. If you want to just bypass setting up Vagrantfile and ok with not installing global binaries (the -g flag), which I highly suggest not to, then alias your npm install --no-bin-links:

    echo "alias npm='npm --no-bin-links'" >> /home/vagrant/.bashrc
    
jojo
  • 1,135
  • 1
  • 15
  • 35