安装 NPM for Node.js 后出错

发布于 2024-12-06 06:23:25 字数 1685 浏览 0 评论 0原文

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

info it worked if it ends with ok
verbose cli [ 'node', '/home/ash/local/bin/npm' ]
info using [email protected]
info using [email protected]
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!     <[email protected]>
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 ]

我已使用 this gist 中概述的方法安装了 Node 和 npm “git 一路方法”。不过,我更改了 npm 和节点存储库的目录位置。

它的设置就像这样

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

有谁知道这里出了什么问题。

编辑

Bash 历史记录

$ 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

After installing npm I get the following error report

info it worked if it ends with ok
verbose cli [ 'node', '/home/ash/local/bin/npm' ]
info using [email protected]
info using [email protected]
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!     <[email protected]>
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 ]

I have installed node and npm using the method outlined in this gist using the "git all the way method". However I changed the directory locations for the npm and node repos.

It is set up like so

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

Does anyone know what's going wrong here.

EDIT

Bash history

$ 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别忘他 2024-12-13 06:23:25

这是一个类似的问题:

https://github.com/isaacs/npm/issues/1004< /p>

事实证明,将“bin”列在
~/.gitignore 文件(它将从安装中排除 npm/bin
包)

也许在过去的两年里我没有碰过我的 ~/.gitignore - 事实证明
它充满了相当愚蠢的东西。春季大扫除 ~/.gitignore 已完成
照顾问题。任务完成,npm v1.0.9-1 现已发布
安装成功(唷)

另外:您有目录“/home/ash/local/etc/npmrc”吗?

Here is a similar problem:

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

As it turns out it's not a very good idea to have "bin" listed in the
~/.gitignore file (it will exclude the npm/bin from the install
package)

I hadn't touched my ~/.gitignore in the last 2 years maybe - turns out
it was full of rather dumb stuffs. Spring cleaning ~/.gitignore took
care of the problem. Mission accomplished, npm v1.0.9-1 is now
successfully installed (phew)

ALSO: Do you have a directory "/home/ash/local/etc/npmrc"?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文