2 4 6 8 10 12 14 | constport=3000; constserver=http.createServer((req,res)=>{ res.setHeader('Content-Type','text/plain'); }); server.listen(port,hostname,()=>{ console.log(`Server running at http://${hostname}:${port}/`); |
2 4 6 8 10 12 14 | constport=3000; constserver=http.createServer((req,res)=>{ res.setHeader('Content-Type','text/plain'); }); server.listen(port,hostname,()=>{ console.log(`Server running at http://${hostname}:${port}/`); |
Ctrl + ~
Terminal
then pressing Enter.node - v
in the Terminal and press Enter. npm i -g npm
. If you get a bunch of checkPermissions
warnings, you should run the command as the superuser like this: sudo npm i -g npm
-bash: node: command not found
. Continue with these instructions to install it.Terminal
then pressing Enter.node - v
in the Terminal to verify that Node.js is installed correctly and to see the version of Node.js that was installed.