I am trying to globally install an npm module I just published. Every time I try to install, either from npm or the folder, I get this error.
npm ERR! Error: ENOENT, chmod '/usr/local/lib/node_modules/takeapeek/lib/cmd.js'
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! <[email protected]>
npm ERR! System Linux 3.8.0-19-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "takeapeek"
npm ERR! cwd /home/giodamlio
npm ERR! node -v v0.10.6
npm ERR! npm -v 1.3.6
npm ERR! path /usr/local/lib/node_modules/takeapeek/lib/cmd.js
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/giodamlio/npm-debug.log
npm ERR! not ok code 0
I am using sudo and I have triple checked everything in the package everything should work. I did some searching around, and saw a couple of similer cases none of which have been resolved. Here is what I tried.
- Upgrade npm (
sudo npm install -g npm
) - Clear the global npm cache (
sudo npm cache clear
) - Clear the user npm cache (
npm cache clear
)
I noticed that the error had to do with the file I am linking to the path, specifically when npm tried to do a chmod. That shouldn't be a problem, my lib/cli.js
has normal permissions, and npm has superuser permissions during this install.
After digging through the npm docs I found an option that would stop npm from making the bin links(--no-bin-links
), when I tried the install with it, it worked fine.
So what's the deal? Is this some weird fringe case bug that has no solution yet?
Edit: For reference, here is the module I uploaded
--no-bin-links
just stops npm from symlinking files in the package.json'sbin
hash to the path on global install. – Iatrynpm cache clean
instead? – Kiernpm ERR! code ENOENT
. the solution wascd .. && ls
because I don't know how but I deleted the directory but bash terminal still was on that directory so this is why. so by usingcd..
I go outside the deleted repo, then withls
I checked if I was in the correct directory or not. if you are in the correct one then you can copy and paste yournpm create
and what you want fine. this is just what happened to me... your scenario is different of course, this was only my experience. so TLDR: check if you are in the correct 📂 – Pomelo