ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • AWS EC2에 Nodejs 설치
    오픈소스 2020. 6. 1. 15:55

     

    https://nodejs.org/ko/

     

    Node.js

    Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.

    nodejs.org

     

     

    현재 최신버전은 14.3.0이며, 안정화 버전은 12.17.0 LTS입니다.

     

    패키지 매니저를 통해 설치 

    https://nodejs.org/ko/download/package-manager/

     

    패키지 매니저로 Node.js 설치하기 | Node.js

    Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.

    nodejs.org

     

     

    $ sudo yum install -y gcc-c++ make 
    curl -sL https://rpm.nodesource.com/setup_12.x | sudo -E bash

    그러면 아래와 같이 로그가 나오게 됩니다.

    ## Installing the NodeSource Node.js 12.x repo...
    
    
    ## Inspecting system...
    
    + rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release
    + uname -m
    
    ## Confirming "el7-x86_64" is supported...
    
    + curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_12.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'
    
    ## Downloading release setup RPM...
    
    + mktemp
    + curl -sL -o '/tmp/tmp.1P1sHPeIpP' 'https://rpm.nodesource.com/pub_12.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'
    
    ## Installing release setup RPM...
    
    + rpm -i --nosignature --force '/tmp/tmp.1P1sHPeIpP'
    
    ## Cleaning up...
    
    + rm -f '/tmp/tmp.1P1sHPeIpP'
    
    ## Checking for existing installations...
    
    + rpm -qa 'node|npm' | grep -v nodesource
    
    ## Run `sudo yum install -y nodejs` to install Node.js 12.x and npm.
    ## You may also need development tools to build native addons:
         sudo yum install gcc-c++ make
    ## To install the Yarn package manager, run:
         curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
         sudo yum install yarn
    

     

    그리고 nodejs를 설치합니다.

    $ sudo yum install -y nodejs

     

    Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
    nodesource                                                                                                                                                 | 2.5 kB  00:00:00     
    nodesource/x86_64/primary_db                                                                                                                               |  38 kB  00:00:00     
    Resolving Dependencies
    --> Running transaction check
    ---> Package nodejs.x86_64 2:12.17.0-1nodesource will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ==================================================================================================================================================================================
     Package                               Arch                                  Version                                              Repository                                 Size
    ==================================================================================================================================================================================
    Installing:
     nodejs                                x86_64                                2:12.17.0-1nodesource                                nodesource                                 22 M
    
    Transaction Summary
    ==================================================================================================================================================================================
    Install  1 Package
    
    Total download size: 22 M
    Installed size: 68 M
    Downloading packages:
    warning: /var/cache/yum/x86_64/2/nodesource/packages/nodejs-12.17.0-1nodesource.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 34fa74dd: NOKEY 0.0 B/s |  11 MB  --:--:-- ETA 
    Public key for nodejs-12.17.0-1nodesource.x86_64.rpm is not installed
    nodejs-12.17.0-1nodesource.x86_64.rpm                                                                                                                      |  22 MB  00:00:00     
    Retrieving key from file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
    Importing GPG key 0x34FA74DD:
     Userid     : "NodeSource <gpg-rpm@nodesource.com>"
     Fingerprint: 2e55 207a 95d9 944b 0cc9 3261 5ddb e8d4 34fa 74dd
     Package    : nodesource-release-el7-1.noarch (installed)
     From       : /etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
    Warning: RPMDB altered outside of yum.
      Installing : 2:nodejs-12.17.0-1nodesource.x86_64                                                                                                                            1/1 
      Verifying  : 2:nodejs-12.17.0-1nodesource.x86_64                                                                                                                            1/1 
    
    Installed:
      nodejs.x86_64 2:12.17.0-1nodesource                                                                                                                                             
    
    Complete!
    

     

    버전 확인

    $ node -v
    v12.17.0
    

     

    $ npm -v
    6.14.4
    

     

Copyright 2020. bluewins All Rights Reserved.