为node.js安装NPM后出错

时间:2022-09-19 07:59:01

After installing npm I get the following error report

安装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 ]

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.

我已经使用“git all way way方法”中使用此要点中概述的方法安装了node和npm。但是我更改了npm和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

1 个解决方案

#1


0  

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)

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

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)

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

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

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

#1


0  

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)

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

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)

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

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

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