Installing NPM on AWS EC2

后端 未结 9 1023
名媛妹妹
名媛妹妹 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条回答
  • 2021-01-31 14:32

    Firstly

    sudo yum install make

    You can run this to get zip of desired version of node

    wget https://nodejs.org/dist/v8.10.0/node-v8.10.0.tar.gz
    

    Then you can unzip it like this

    tar -xvf node-v8.10.0.tar.gz
    

    then go in to the extracted directory and install node like this

    ./configure && make && sudo make install
    
    0 讨论(0)
  • 2021-01-31 14:40
    sudo yum install nodejs npm --enablerepo=epel
    
    0 讨论(0)
  • 2021-01-31 14:43

    git clone https://github.com/isaacs/npm.git cd npm sudo make install

    And if you don't have git, do this first: sudo yum install git

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

    This guide worked perfectly: https://tecadmin.net/install-latest-nodejs-amazon-linux/

    1. Make sure you have make

    # sudo yum install -y gcc-c++ make

    1. Install source

    # curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash -

    1. Install node

    # sudo yum install -y nodejs

    Note - you'll have to run sudo npm install to get the installs to work.

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

    I found his tutorial that has been very usefull to me: The last chapter explains how to install node and npm compiling it.

    http://iconof.com/blog/how-to-install-setup-node-js-on-amazon-aws-ec2-complete-guide/#installNode

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

    To install NodeJS 6.x execute the following commands:

    curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
    yum install nodejs --enablerepo=nodesource
    

    Update

    You can install NodeJS 7 and 8 in the same way. Just specify the version you need instead of 6 in the command above.

    Update

    To update to NodeJS 10 (or any other version) do the following:

    rm -rf /etc/yum.repos.d/nodesource-el*
    curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash -
    yum install nodejs --enablerepo=nodesource
    
    0 讨论(0)
提交回复
热议问题