Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm running npm 1.2.18 and node v0.10.15. npm completion is broken. If I try to tab complete with npm or if I run npm completion, it displays:

npm ERR! System Linux 3.11.0-14-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "completion" "--color" "false" "--loglevel" "error" "--" "npm" "comple"
npm ERR! cwd /home/ajcrites
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! path /usr/share/npm/lib/utils/completion.sh
npm ERR! code ENOENT
npm ERR! errno 34

Indeed, /usr/share/npm/lib/utils/completion.sh does not exist, and the current directory gets an npm-debug.log file with similar information.

A Google Search reveals a lot of complaints about this issue for varying versions of node/Debian/zsh. If I use bash, tab completion works, but npm completion yields the same error about the missing file. As far as I can tell, none of the threads that you can easiliy find from the search actually have a solution. They just seem to be bug reports.

Is there anything I can do to fix this error? Is there an example completion.sh I can use or something?

share|improve this question

1 Answer 1

I found a solution by using: http://manpages.ubuntu.com/manpages/oneiric/man1/npm-completion.1.html

Specifically I took the following file: http://manpages.ubuntu.com/manpages.gz/oneiric/man1/npm-completion.1.gz

And extracted it to:

/usr/share/npm/lib/utils/completion.sh

After restarting the console, npm in would complete to npm install!

share|improve this answer
    
bash: /usr/share/npm/lib/utils/completion.sh: Permission denied –  Tosho Sep 18 at 0:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.