Installing NPM on AWS EC2

后端 未结 9 1024
名媛妹妹
名媛妹妹 2021-01-31 13:52

Working on Ec2 on AWS.

I have installed Node.js and it works fine.

But the problem arises when trying to install npm.

I am using the following command to

相关标签:
9条回答
  • Get the http://npmjs.org/install.sh file on your system first and then execute it directly instead of piping with curl.

    • Use chmod +x install.sh to make it executable
    • Then run ./install.sh
    0 讨论(0)
  • 2021-01-31 14:55

    Edit as my answer wasn't pertinent anymore:

    Try:

    curl --silent --location https://rpm.nodesource.com/setup | bash -
    
    yum -y install nodejs 
    

    https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#enterprise-linux-and-fedora-core

    0 讨论(0)
  • 2021-01-31 14:57

    Follow this AWS Tutorial that uses Node Version Manager.

    Node Version Manager (NVM) lets you install multiple versions of Node.js and switch between them.


    Here are the steps:

    Install NVM

    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
    

    Activate NVM

    . ~/.nvm/nvm.sh
    

    Install Node (choose version)

    nvm install 4.4.5
    

    Confirm Successful Installation

    node -e "console.log('Running Node.js ' + process.version)"
    
    0 讨论(0)
提交回复
热议问题