HTML/CSS/JavaScriptの練習 実践 雑多な記録2 基本

https://seesaawiki.jp/lifewithslackzaurus/d/HTML/CSS/JavaScript%a4%ce%ce%fd%bd%ac%20%bc%c2%c1%a9%20%bb%a8%c2%bf%a4%ca%b5%ad%cf%bf の続き。
練習場
https://oldcygwin.web.fc2.com/
ログインしてからftp
https://web.fc2.com/

practice200.html~practice299.html:
JavaScriptの練習(ライブラリ使う編)。どういうフレームワークとライブラリがあるのか、
サラっと見てみるかな。ajax、extjs、jquery、node、vue、nuxt。
javascript ライブラリ カレンダー、でググった。
https://ajike.github.io/clndr-javascript/
(jQuery.js、そのうちやってみよう)
https://ja.wikipedia.org/wiki/JavaScript%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA
JavaScriptライブラリ – Wikipedia
\
node.jsの実行環境がspitzではまだできてないため、https://seesaawiki.jp/lifewithslackarmzaurus14_1/d/HTML/CSS/JavaScript%a4%ce%ce%fd%bd%ac%20local%20Web%a5%b5%a1%bc%a5%d0%20Node%2ejs
できるまでは、PC/AT機で実行する。https://seesaawiki.jp/lifewithslackarmzaurus14_1/d/32bit%20PC/AT%b5%a1%20%a4%ce%b4%c4%b6%ad
サンプルはFC2にも置いておく。
実行する時はFC2からDLしてきて以下の様にする。
Slack-14.1$ node practice200.js
\
参考書籍のリアルタイムチャットアプリを動かしてみる:
Slack-14.1$ mkdir chat-example; cd chat-example
nodejs-v6.4.0で実行:
Slack-14.1$ npm init -y
Slack-14.1$ npm install express socket.io –save
Error: Missing required argument #1
https://github.com/npm/cli/issues/681
\
nodejs-v6.17.1(マイナーリリース最新(最終?))で実行:
Slack-14.1$ npm init -y
\Wrote to ~/examples/javascript/oldcygwin.web.fc2.com/practice200/chat-example/package.json:
\{
\ “name”: “chat-example”,
\ “version”: “1.0.0”,
\ “description”: “”,
\ “main”: “index.js”,
\ “scripts”: {
\ “test”: “echo \”Error: no test specified\” && exit 1″
\ },
\ “keywords”: [],
\ “author”: “”,
\ “license”: “ISC”
\}
Slack-14.1$ npm install express socket.io –save
\chat-example@1.0.0 ~/examples/javascript/oldcygwin.web.fc2.com/practice200/chat-example
\+– express@4.17.1
\| +– accepts@1.3.7
\| | +– mime-types@2.1.32
\| | | `– mime-db@1.49.0
\| | `– negotiator@0.6.2
\| +– array-flatten@1.1.1
\| +– body-parser@1.19.0
\| | +– bytes@3.1.0
\| | +– http-errors@1.7.2
\| | | +– inherits@2.0.3
\| | | `– toidentifier@1.0.0
\| | +– iconv-lite@0.4.24
\| | | `– safer-buffer@2.1.2
\| | `– raw-body@2.4.0
\| +– content-disposition@0.5.3
\| +– content-type@1.0.4
\| +– cookie@0.4.0
\| +– cookie-signature@1.0.6
\| +– debug@2.6.9
\| | `– ms@2.0.0
\| +– depd@1.1.2
\| +– encodeurl@1.0.2
\| +– escape-html@1.0.3
\| +– etag@1.8.1
\| +– finalhandler@1.1.2
\| | `– unpipe@1.0.0
\| +– fresh@0.5.2
\| +– merge-descriptors@1.0.1
\| +– methods@1.1.2
\| +– on-finished@2.3.0
\| | `– ee-first@1.1.1
\| +– parseurl@1.3.3
\| +– path-to-regexp@0.1.7
\| +– proxy-addr@2.0.7
\| | +– forwarded@0.2.0
\| | `– ipaddr.js@1.9.1
\| +– qs@6.7.0
\| +– range-parser@1.2.1
\| +– safe-buffer@5.1.2
\| +– send@0.17.1
\| | +– destroy@1.0.4
\| | +– mime@1.6.0
\| | `– ms@2.1.1
\| +– serve-static@1.14.1
\| +– setprototypeof@1.1.1
\| +– statuses@1.5.0
\| +– type-is@1.6.18
\| | `– media-typer@0.3.0
\| +– utils-merge@1.0.1
\| `– vary@1.1.2
\`– socket.io@4.2.0
\ +– @types/cookie@0.4.1
\ +– @types/cors@2.8.12
\ +– @types/node@16.7.13
\ +– base64id@2.0.0
\ +– debug@4.3.2
\ | `– ms@2.1.2
\ +– engine.io@5.2.0
\ | +– UNMET PEER DEPENDENCY bufferutil@^4.0.1
\ | +– cookie@0.4.1
\ | +– cors@2.8.5
\ | | `– object-assign@4.1.1
\ | +– debug@4.3.2
\ | | `– ms@2.1.2
\ | +– engine.io-parser@4.0.3
\ | | `– base64-arraybuffer@0.1.4
\ | +– UNMET PEER DEPENDENCY utf-8-validate@^5.0.2
\ | `– ws@7.4.6
\ +– socket.io-adapter@2.3.2
\ `– socket.io-parser@4.0.4
\ +– @types/component-emitter@1.2.10
\ +– component-emitter@1.3.0
\ `– debug@4.3.2
\ `– ms@2.1.2
\
\npm WARN ws@7.4.6 requires a peer of bufferutil@^4.0.1 but none was installed.
\npm WARN ws@7.4.6 requires a peer of utf-8-validate@^5.0.2 but none was installed.
\npm WARN chat-example@1.0.0 No description
\npm WARN chat-example@1.0.0 No repository field.
Slack-14.1$ ls -l
\total 4
\drwxr-xr-x 64 ore 500 2048 Sep 8 xx:yy node_modules
\-rw-r–r– 1 ore 500 303 Sep 8 xx:yy package.json
Slack-14.1$ elvis app.jp
Slack-14.1$ elvis index.html
Slack-14.1$ node app.js
\~/examples/javascript/oldcygwin.web.fc2.com/practice200/chat-example/node_modules/engine.io/lib/server.js:282
\ async handshake(transportName, req, closeConnection) {
\ ^^^^^^^^^
\
\SyntaxError: Unexpected identifier
\ at createScript (vm.js:56:10)
\ at Object.runInThisContext (vm.js:97:10)
\ at Module._compile (module.js:549:28)
\ at Object.Module._extensions..js (module.js:586:10)
\ at Module.load (module.js:494:32)
\ at tryModuleLoad (module.js:453:12)
\ at Function.Module._load (module.js:445:3)
\ at Module.require (module.js:504:17)
\ at require (internal/module.js:20:19)
\ at Object.<anonymous> (~/examples/javascript/oldcygwin.web.fc2.com/practice200/chat-example/node_modules/engine.io/lib/engine.io.js:6:16)
https://stackoverflow.com/questions/65938800/syntaxerror-unexpected-identifier-after-installing-socket-io-on-node-js-express
(node-v10以上でやれってか)
https://seesaawiki.jp/lifewithslackarmzaurus_14_2/d/HTML/CSS/JavaScript%a4%ce%ce%fd%bd%ac%20local%20Web%a5%b5%a1%bc%a5%d0%20Node%2ejs
https://seesaawiki.jp/lifewithslackarmzaurus_14_2/d/HTML/CSS/JavaScript%a4%ce%ce%fd%bd%ac%20%bc%c2%c1%a9%20%bb%a8%c2%bf%a4%ca%b5%ad%cf%bf%a3%b2

ライブラリ使う編の練習の続きはこっちでやる
https://seesaawiki.jp/lifewithslackarmzaurus_15_0/d/HTML/CSS/JavaScript%a4%ce%ce%fd%bd%ac%20%bc%c2%c1%a9%20%bb%a8%c2%bf%a4%ca%b5%ad%cf%bf%a3%b2

参考書籍:
Software Design 2016年10月号 Webサーバはなぜ動くのか? HTTP,CGI,サーブレット,Node.js,Railsを一挙解説
https://gihyo.jp/magazine/SD/archive/2016/201610

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です