繁体   English   中英

npm安装错误centos 6

[英]npm install errors centos 6

我想知道a)我的npm make install错误的原因,以及b)故障的潜在后果。 (我忘了在原始帖子中提到npm install命令现在可以使用了,因此具体来说,我只是想知道以下所述的故障是否有无法预料的后果。)

这是全新的CentOs 6安装:

    # curl --silent --location https://rpm.nodesource.com/setup_4.x | bash -
    ...
    ## Your distribution, identified as "centos-release-6-7.el6.centos.12.3.x86_64", is not currently supported...

    # yum groupinstall 'Development Tools'
    ... Complete!

    # yum install nodejs npm --enablerepo=epel
    ... Complete!

    # npm root -g
    /usr/lib/node_modules

    # npm install mongo
    bash: npm: command not found

糟糕,找不到npm ...我发现了以下内容: 如何将npm(node.js程序包管理器)添加到PATH? ,所以跑了:

    # git clone https://github.com/npm/npm.git
    ... done.
    # cd npm
    # make install (as root)
    ...  
    ... (here comes the error)
    scripts/doc-build.sh: line 111: html/doc/misc/npm-index.html: Permission denied
    cat: write error: Broken pipe
    make[1]: *** [html/doc/misc/npm-index.html] Error 1
    make[1]: Leaving directory `/usr/lib/node_modules/npm'
    npm ERR! Linux 2.6.32-573.7.1.el6.x86_64
    npm ERR! argv "node" "/usr/lib/node_modules/npm/cli.js" "install" "-g" "-f"
    npm ERR! node v0.10.36
    npm ERR! npm  v3.6.0
    npm ERR! path /usr/lib/node_modules/npm
    npm ERR! code EISGIT

    npm ERR! git /usr/lib/node_modules/npm: Appears to be a git repo or submodule.
    npm ERR! git     /usr/lib/node_modules/npm
    npm ERR! git Refusing to remove it. Update manually,
    npm ERR! git or move it out of the way first.

任何见解将不胜感激。 谢谢!

刚刚进行Centos 6.4安装

curl --silent --location https://rpm.nodesource.com/setup_4.x | bash -

不是最有用的命令执行此操作...

curl --location https://rpm.nodesource.com/setup_4.x | bash -

(可能也想尝试-k curl标志)

这将给出更详细的输出,这可能暗示了问题所在

也参观...

https://rpm.nodesource.com/setup_4.x

这为您提供了使用wget进行安装的方法。

我也不相信节点4可以在Centos 6.4上运行-我认为您应该尝试版本0.10

最坏的情况是从源代码构建Node ...

https://www.digitalocean.com/community/tutorials/how-to-install-and-run-a-node-js-app-on-centos-6-4-64bit

如果您使用代理,请确保已设置代理环境变量。

暂无
暂无

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

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