3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
Ubuntu 安裝/測試 nodejs [How To Install Node JS In Ubuntu Linux] 資料來源: https://www.youtube.com/watch?v=II7L8rpJ_6g https://github.com/nodesource/distributions/blob/master/README.md https://nodejs.org/en/about/ GITHUB:https://github.com/jash-git/How-To-Install-Node-JS-In-Ubuntu-Linux $sudo apt-get install curl $sudo apt-get install python-software-properties #curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - $curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - $sudo apt-get update $sudo apt-get install -y nodejs $nodejs -v $npm -v $gedit app.js const http = require('http'); const hostname = '127.0.0.1'; const port = 3000; const server = http.createServer((req, res) => { res.statusCode = 200; res.setHeader('Content-Type', 'text/plain'); res.end('Hello World\n'); }); server.listen(port, hostname, () => { console.log(`Server running at http://${hostname}:${port}/`); }); $nodejs app.js

本文由jashliaoeuwordpress提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦