Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Tuesday, July 25, 2017

Cannot read property 'localeCompare' of undefined

While running npm install, I ran into following error -

npm WARN engine webpack@2.7.0: wanted: {"node":">=4.3.0 =5.10"} (current: {"node":"5.0.0","npm":"3.3.6"})
npm ERR! Darwin 16.6.0
npm ERR! argv "/Users/J/.nvm/versions/node/v5.0.0/bin/node" "/Users/J/.nvm/versions/node/v5.0.0/bin/npm" "install"
npm ERR! node v5.0.0
npm ERR! npm v3.3.6

npm ERR! Cannot read property 'localeCompare' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Jaimin/Apps/redesign/data-exploration/npm-debug.log

mostly you will run into this issue if you are running npm 3.3.5 or 3.3.6.

You can try resolve it by below two ways,

1. Remove all node_modules folder, and try to run 'npm install' again.

If above doesn't resolve it, try below -

2. upgrade npm to 3.3.7 (or any subsequent one)
npm install npm@3.3.7 -g

It should resolve the issue. If you want to read up various other suggestions/reasoning checkout here

Wednesday, February 19, 2014

Raphael js - Uncaught TypeError: Cannot call method 'enable' of undefined

When enabling dragging in Raphael js, if you are using raphael-draggable, then you might run into following error when you try to enable the dragging on any element -

Uncaught TypeError: Cannot call method 'enable' of undefined

That line is -
 paper.draggable.enable() 

The issue is in Raphale 2.0 context is broken, and in order to fix that you have can add following function -

// to fix broken context issue with Raphael 2.0

Raphael.fn.fixNS = function(){

    var r = this;

    for (var ns_name in Raphael.fn) {

        var ns = Raphael.fn[ns_name];

        if (typeof ns == 'object') for (var fn in ns) {

            var f = ns[fn];

            ns[fn] = function(){ return f.apply(r, arguments); }

        }

    }

}
 
Once you add it, call that function below your Raphael block initialization -

var paper = new Raphael(obj.attr('id'), chart_width, chart_height);
    paper.fixNS();

This should be able to fix the issue and you will be able to enable dragging for individual element or your Raphael object.

paper.draggable.enable();

Sunday, January 12, 2014

Error on upgrading setuptools using pip

Today I upgraded pip using below command as for some reason some of the package it was not able to find and throwing strange error that its not able to find the requested package -

pip install --upgrade pip

Existing installation was 1.0.2 and it installed the 1.5

After the upgrade, it started throwing following error on requesting any install

Wheel installs require setuptools >= 0.8 for dist-info support.
pip's wheel support requires setuptools >= 0.8 for dist-info support.
Storing debug log for failure in /Users/Jaimin/.pip/pip.log

What it means is my pip install 1.0.2 had old setup tools and after upgrading to 1.5 it needs newer version of setup tools.

Js-MacBook-Pro:dj16 J$ pip install --upgrade setuptools
Wheel installs require setuptools >= 0.8 for dist-info support.
pip's wheel support requires setuptools >= 0.8 for dist-info support.
Storing debug log for failure in /Users/Jaimin/.pip/pip.log

So it still throws the error on upgrade of setuptools, you need to use following command to upgrade -

pip install setuptools --no-use-wheel --upgrade

It will be able to upgrade the setuptools and pip should work fine after this.

Sunday, July 15, 2012

Django Application Image issues while running on mac

If you are using django and getting jpg adapter error on image upload or while running the app on rendering the jpeg image, in that case follow below instructions. The error is most likely because of installation of jpeg in environment.


You have to install support for JPEG, for example in mac use homebrew for installation and follow below instructions - 

1. Uninstall PIL
    sudo pip uninstall PIL

2. Install JPEG
    brew install jpeg

3. Install PIL again
    sudo pip install PIL

for ubuntu users use below command -
sudo apt-get install libjpeg62-dev