简体   繁体   中英

npm install errors centos 6

I was wondering a) the cause of my npm make install error, and b) the potential consequences of the failure. (I forgot to mention in the original post that the npm install command now works, and so to be specific I was just wondering if there are any unforeseen consequences to the failures described below.)

This was a fresh CentOs 6 install:

    # 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

Oops, npm not found... I found the following: How can I add npm (node.js package manager) to the PATH? , so ran:

    # 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.

Any insight would be most appreciated. Thanks!

Just been doing a Centos 6.4 install

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

not the most helpful command do this ...

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

(might want to try -k curl flag also)

which will give more verbose output which might hint at the problem

also visit ...

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

which gives you a way of installing using wget.

Also Im not convinced node 4 works on Centos 6.4 - I think you should try version 0.10

Worst case scenario, build Node from source ...

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

If you are behind a proxy make sure your proxy env vars are set.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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