I am very new to Node.js and trying to install Flatiron using npm but it gives me an error.
sudo npm install flatiron -g
And I get -
npm http GET https://registry.npmjs.org/flatiron
npm http 304 https://registry.npmjs.org/flatiron
npm ERR! Error: ENOTDIR, mkdir '/home/siddharthsaha/tmp/npm-28554/1353323290836-0.20847953506745398'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Linux 3.2.0-24-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "flatiron" "-g"
npm ERR! cwd /home/siddharthsaha/denarit
npm ERR! node -v v0.8.14
npm ERR! npm -v 1.1.65
npm ERR! path /home/siddharthsaha/tmp/npm-28554/1353323290836-0.20847953506745398
npm ERR! code ENOTDIR
npm ERR! errno 27
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/siddharthsaha/denarit/npm-debug.log
npm ERR! not ok code 0
What is wrong here? I have no clue.
I direct delete the file of npm-debug.log. then it's ok for me.
Below are the steps to install a given release from source without root NOTE - this installs nodejs which gives you both node as well as npm, they come together per release.
to start fresh remove prior node.js and npm installs as well as these :
to install nodejs and npm as yourself NOT root do these commands (OSX/linux) :
download source from : http://nodejs.org/download/
which puts it into dir defined by above --prefix
define environment variable NODE_PATH so node can find dir for modules otherwise npm install xxx will put newly installed module into current dir :
when you use syntax : npm install -g some_cool_module the -g for global installs it into dir $NODE_PATH and not your $PWD
nodejs install gives you npm as well :
Subsequent modules you install using global flag -g will automagically put their ~binaries~ into above bin dir ... like browserify
Now put above three export xxx=yyy commands into your ~/.bashrc or some such so your environment is setup
Just solved the issue. Its because there's a file called
tmp
in the home directory.Also... if you are trying to install npm then the same error and solution applies - delete
~/tmp
Try
before starting the install script, since
npm http 304 https://registry.npmjs.org/flatiron
line states that this module is coming from cache. And alsoENOTDIR
states that there is no directory. Therefore, emptying the cache would solve your problem.