11import Heading from ' @theme/Heading' ;
2+ import CodeBlock from ' @theme/CodeBlock' ;
23
34{ /* ------------------------------------------------------------------------ */ }
45
@@ -36,20 +37,37 @@ should review the content of the file before executing it.
3637
3738If you trust the script, you can use the following shortcut:
3839
39- ``` sh
40- curl https://raw.githubusercontent.com/xpack/assets/master/scripts/install-nvm-node-npm-xpm.sh | bash
40+ { props .os === ' macos' ? (
41+ <CodeBlock language = " sh" >
42+ { ` curl --fail --silent --show-error --location https://raw.githubusercontent.com/xpack/assets/master/scripts/install-nvm-node-npm-xpm.sh | \$ {SHELL}
4143
42- export NVM_DIR=" ${HOME} /.nvm"
43- source " ${NVM_DIR} /nvm.sh"
44- ```
44+ export NVM_DIR="\$ {HOME}/.nvm"
45+ source "\$ {NVM_DIR}/nvm.sh" ` }
46+ </CodeBlock >
47+ ) : (
48+ <CodeBlock language = " sh" >
49+ { ` wget --quiet --output-document=- https://raw.githubusercontent.com/xpack/assets/master/scripts/install-nvm-node-npm-xpm.sh | \$ {SHELL}
50+
51+ export NVM_DIR="\$ {HOME}/.nvm"
52+ source "\$ {NVM_DIR}/nvm.sh" ` }
53+ </CodeBlock >
54+ )}
4555
4656Otherwise download and check the script:
4757
48- ``` sh
49- mkdir -pv " ${HOME} /Downloads/"
50- curl --output " ${HOME} /Downloads/install-nvm-node-npm-xpm.sh" https://raw.githubusercontent.com/xpack/assets/master/scripts/install-nvm-node-npm-xpm.sh
51- cat " ${HOME} /Downloads/install-nvm-node-npm-xpm.sh"
52- ```
58+ { props .os === ' macos' ? (
59+ <CodeBlock language = " sh" >
60+ { ` mkdir -pv "\$ {HOME}/Downloads/"
61+ curl --output "\$ {HOME}/Downloads/install-nvm-node-npm-xpm.sh" https://raw.githubusercontent.com/xpack/assets/master/scripts/install-nvm-node-npm-xpm.sh
62+ cat "\$ {HOME}/Downloads/install-nvm-node-npm-xpm.sh" ` }
63+ </CodeBlock >
64+ ) : (
65+ <CodeBlock language = " sh" >
66+ { ` mkdir -pv "\$ {HOME}/Downloads/"
67+ wget --quiet --output-document="\$ {HOME}/Downloads/install-nvm-node-npm-xpm.sh" https://raw.githubusercontent.com/xpack/assets/master/scripts/install-nvm-node-npm-xpm.sh
68+ cat "\$ {HOME}/Downloads/install-nvm-node-npm-xpm.sh" ` }
69+ </CodeBlock >
70+ )}
5371
5472When confident, run it:
5573
@@ -66,7 +84,8 @@ This script will install `nvm` (the Node Version Manager), `node`,
6684
6785To automatically activate ` nvm ` , the script adds several lines
6886to the shell initialization script. Therefore, it is necessary
69- to restart the shell to apply these changes.
87+ to restart the shell to apply these changes or to manually
88+ export ` NVM_DIR ` and source the script .
7089
7190:::
7291
0 commit comments