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! <npm-@googlegroups.com>
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
Please try this
Then try that command.It will work
This problem somehow arose for me on Mac when I was trying to run
npm install -g bower
. It was giving me a number of errors for not being able to find things like graceful-fs. I'm not sure how I installed npm originally, but it looks like perhaps it came down with node using homebrew. I first ranThis removed both
node
andnpm
from my path. From there I just reinstalled itWhen it completed I had
node
andnpm
on my path and I was able to runThis then installed bower successfully.
Updating the brew formulas and upgrading the installs didn't seem to work for me, I'm not sure why. The removal of the
.npm
folder was something that had worked for other people, and I had tried it without success. I did it this time just in case. Note also that neither of the following solved the problem for me, although it did for others:In Windows I had a similar error. Search paste App Data and search for the string
npm
.I replaced the string
'npm'
(including quotes) with'npm.cmd'
in bothatlasboard\lib\package-dependency-manager.js
andatlasboard\lib\cli\commands.js
. That fixed the problem.I was getting a similar error on
npm install
on a local installation:I am not sure what was causing the error, but I had recently installed a couple of new node modules locally, upgraded node with homebrew, and ran 'npm update -g'.
The only way I was able to resolve the issue was to delete the local node_modules directory entirely and run
npm install
again:While installing ionic I got below error
There was no folder called
ansi
at that path. I created it there and it installed correctly.I had the same problem, and just found a handling not mentioned here. Though I'd contribute to the community:
npm install -g myapp
was not copying thebin
directory. I found this to be because I did not include it in thefiles
in mypackage.json