我不得不在我的笔记本电脑上重新安装 Mac OS X Mavericks。现在 npm 不起作用了。但是,node 仍在笔记本电脑上,npm 位于 $PATH 中。
christohersmbp3:angular-phonecat christopherspears$ npm install
-bash: npm: command not found
christohersmbp3:angular-phonecat christopherspears$ node --version
v0.10.26
christohersmbp3:angular-phonecat christopherspears$ npm start
-bash: npm: command not found
christohersmbp3:angular-phonecat christopherspears$ echo $PATH
/usr/local/share/python:/Users/christopherspears/.rbenv/bin:/Users/christopherspears/bin:/usr/local/heroku/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin
我实际上能够相当轻松地让节点运行:
christohersmbp3:~ christopherspears$ node
> console.log('hello node');
hello node
undefined
>
(^C again to quit)
>
关于如何解决这个问题有什么想法或者我应该重新安装 Node.js 吗?
UPDATE:
我一直在尝试卸载并重新安装 Node.js 但遇到了问题:
christohersmbp3:angular-phonecat christopherspears$ brew uninstall node
Uninstalling /usr/local/Cellar/node/0.10.26...
christohersmbp3:angular-phonecat christopherspears$ brew install node
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/node-0.10.26.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring node-0.10.26.mavericks.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using:
brew link node
Possible conflicting files are:
/usr/local/bin/node
/usr/local/include/node/zlib.h
/usr/local/include/node/zconf.h
/usr/local/include/node/v8stdint.h
/usr/local/include/node/v8.h
/usr/local/include/node/v8-testing.h
/usr/local/include/node/v8-profiler.h
/usr/local/include/node/v8-preparser.h
/usr/local/include/node/v8-debug.h
/usr/local/include/node/uv.h
/usr/local/include/node/uv-private/uv-win.h
/usr/local/include/node/uv-private/uv-unix.h
/usr/local/include/node/uv-private/uv-sunos.h
/usr/local/include/node/uv-private/uv-linux.h
/usr/local/include/node/uv-private/uv-darwin.h
/usr/local/include/node/uv-private/uv-bsd.h
/usr/local/include/node/uv-private/tree.h
/usr/local/include/node/uv-private/stdint-msvc2008.h
/usr/local/include/node/uv-private/ngx-queue.h
/usr/local/include/node/openssl/opensslconf.h
/usr/local/include/node/node_version.h
/usr/local/include/node/node_object_wrap.h
/usr/local/include/node/node_internals.h
/usr/local/include/node/node_buffer.h
/usr/local/include/node/node.h
/usr/local/include/node/nameser.h
/usr/local/include/node/config.gypi
/usr/local/include/node/common.gypi
/usr/local/include/node/ares_version.h
/usr/local/include/node/ares.h
/usr/local/share/man/man1/node.1
/usr/local/lib/dtrace/node.d
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall node`
==> Summary
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)