繁体   English   中英

为node.js安装NPM后出现错误

[英]Error after installing NPM for node.js

安装npm后,我得到以下错误报告

info it worked if it ends with ok
verbose cli [ 'node', '/home/ash/local/bin/npm' ]
info using npm@1.0.30
info using node@v0.4.12
verbose config file /home/ash/.npmrc
verbose config file /home/ash/local/etc/npmrc
ERR! Error: ENOENT, No such file or directory
ERR! Report this *entire* log at:
ERR!     <http://github.com/isaacs/npm/issues>
ERR! or email it to:
ERR!     <npm-@googlegroups.com>
ERR! 
ERR! System Linux 2.6.38-11-generic
ERR! command "node" "/home/ash/local/bin/npm"
ERR! cwd /home/ash
ERR! node -v v0.4.12
ERR! npm -v 1.0.30
verbose exit [ 1, true ]

我已经使用本要点概述的方法“ git all-way method”安装了node和npm。 但是,我更改了npm和节点存储库的目录位置。

像这样设置

~/
    Apps/
    Dev/
        node/   << node repo
        npm/    << npm repo
    local/  << default setup location as outlined in the gist

有谁知道这是怎么回事。

编辑

重击历史

$ mkdir ~/local
$ echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
$ . ~/.bashrc

$ cd Apps/Dev/node
$ ./configure --prefix=~/local
$ make install

$ cd ../npm
$ sudo PATH=~/local/bin:$PATH make install
$ export PATH=~/local/bin:$PATH >> ~/.bashrc

这是一个类似的问题:

https://github.com/isaacs/npm/issues/1004

事实证明,在〜/ .gitignore文件中列出“ bin”不是一个好主意(它将npm / bin从安装包中排除)

也许在过去的两年中,我没有碰过〜/ .gitignore-事实证明它充满了愚蠢的东西。 春季大扫除〜/ .gitignore解决了这个问题。 完成任务后,现在已成功安装npm v1.0.9-1(phew)

还:您是否有目录“ / home / ash / local / etc / npmrc”?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM