Node.js tips and tricks: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
(Created page with " == Install latest Node.js<ref>https://deb.nodesource.com/</ref> == <syntaxhighlight lang="bash"> #Install Node.js 20.x LTS $curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash - $sudo apt-get install -y nodejs </syntaxhighlight> == References == <references />")
 
No edit summary
Line 6: Line 6:
$sudo apt-get install -y nodejs
$sudo apt-get install -y nodejs


</syntaxhighlight>
== Change node version ==
<syntaxhighlight lang="bash">
# Get available version list using nvm
$ nvm ls
        v4.9.1
        v6.17.1
        v8.8.1
        v8.9.4
        v8.17.0
      v10.24.1
->    v14.15.1
      v16.20.0
      v18.16.0
        system
default -> v14.15.1
# change version v18 and check the changing version
$ nvm use v18.16.0
$ nvm ls
        v4.9.1
        v6.17.1
        v8.8.1
        v8.9.4
        v8.17.0
      v10.24.1
      v14.15.1
      v16.20.0
->    v18.16.0
        system
default -> v14.15.1
</syntaxhighlight>
</syntaxhighlight>


== References ==
== References ==
<references />
<references />

Revision as of 09:19, 29 May 2024

Install latest Node.js[1]

#Install Node.js 20.x LTS
$curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash - 
$sudo apt-get install -y nodejs

Change node version

# Get available version list using nvm
$ nvm ls
         v4.9.1
        v6.17.1
         v8.8.1
         v8.9.4
        v8.17.0
       v10.24.1
->     v14.15.1
       v16.20.0
       v18.16.0
         system
default -> v14.15.1

# change version v18 and check the changing version
$ nvm use v18.16.0
$ nvm ls
         v4.9.1
        v6.17.1
         v8.8.1
         v8.9.4
        v8.17.0
       v10.24.1
       v14.15.1
       v16.20.0
->     v18.16.0
         system
default -> v14.15.1

References