| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

差分

ナビゲーションに移動 検索に移動
561 バイト追加 、 2023年10月24日 (火) 10:43
| [[Npm]] | [[JavaScript]] | [[TypeScript]] | [[npm]] | [[Electron]] | [[YEOMAN]] | [[Bower]] | [https://www.typea.info/blog/index.php/category/node-js/ ブログカテゴリ(Node.js)] | 
{{amazon|479812947X}}
 
==[[Node.js]]==
==インストール==
$ nvm alias default v0.10.29
default -> v0.10.29
===Hello [[Node.js]]===
*http://dev.classmethod.jp/server-side/vscode-nodejs-1/
[[Visual Studio Code]] |
*hello_node.js
var http = require('http');
http.createServer(function (request, response) {
response.writeHead(200,{'Content-Type':'text/plain'});
response.end('Hello World');
}).listen(8080);
console.log('Server running');
 
*実行
$ node hello_node.js
Server running
 
[[File:0818_hello_node_js.png]]
 
==[[npm]]==
*[[npm]]
 
==[[Tips]]==
===対話モードで利用する===
> node
> Math.sqrt(2);
1.4142135623730951
====エディタモード====
*Ctrl+Dで実行
> .editor
// Entering editor mode (^D to finish, ^C to cancel)
for(var i=0;i<2;i++){
console.log(i);
}
0
1
===トラブルシュート===
*[http://typea.info/blg/glob/2017/05/windows-nodejs-bower-ssl.html Windows の Node.js Bower などで SSLエラーが発生する]
===[[Mac]]にインストール===
----
====Homebrew インストール====
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
*https://brew.sh/
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
 
*Homebrewバージョン確認
brew -v
*nodebrew にパスを通す
echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bash_profile
 
====node.js インストール====
*エラーが出る場合
===[[Windows]]にインストール===
----
*nvm-windows
**https://blog.clock-up.jp/entry/2018/02/10/nodejs-manager-on-windows
*指定バージョンのインストール
> nvm install 13.11.0
===[[Ubuntu]]にインストール===
----
<pre>
$ sudo apt install curl
$ curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
$ source ~/.profile
$ nvm ls-remote
$ nvm install v16.0.0
$ nvm use v16.0.0
$ nvm ls
</pre>
===Hello [[Node.js]]===*http://dev.classmethod.jp/server-side/vscode-nodejs-1/[[Visual Studio Code]] | *hello_node.js var http = require('http'); http.createServer(function (request, response) { response.writeHead(200,{'Content-Type':'text/plain'}); response.end('Hello World'); }).listen(8080); console.log('Server running'); *実行 $ node hello_node.js Server running [[File:0818_hello_node_js.png]] ==[[npm]]==*[[npm]] ==[[Tips]]=====画像処理===*[https://note.affi-sapo-sv.com/nodejs-sharp.php sharp]===対話モードで利用する=== &gt; node &gt; Math.sqrt(2); 1.4142135623730951====エディタモード====*Ctrl+Dで実行 &gt; .editor // Entering editor mode (^D to finish, ^C to cancel) for(var i=0;i&lt;2;i++){ console.log(i); } 0 1===トラブルシュート===*[http://typea.info/blg/glob/2017/05/windows-nodejs-bower-ssl.html Windows の Node.js Bower などで SSLエラーが発生する]===Node.js の開発環境を整える===
*[http://typea.info/blg/glob/2017/08/react-1.html Node.js の開発環境を整える]
===[[React]]===
*[http://typea.info/blg/glob/2017/08/react-1.html React 開発の全体像を把握しつつ開発環境を整える]
 
[[category:プログラミング言語]]

案内メニュー