Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
LambdaのNodejsをアップデートしたら困った話
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
is_ryo
February 12, 2020
Programming
1.4k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
LambdaのNodejsをアップデートしたら困った話
is_ryo
February 12, 2020
More Decks by is_ryo
See All by is_ryo
生成AIとエンジニアの仕事と私~実践知を添えて~
is_ryo
0
130
Unknownのことをちゃんと知りたい_関西フロントエンド忘年会
[email protected]
× KINTOテクノロジーズ
is_ryo
0
51
tRPC入門
is_ryo
1
350
TypeScriptでWebAssemblyに入門しよう
is_ryo
0
400
Honoが良さそう🔥
is_ryo
1
1.4k
頑張らないオレオレVuex規約を作った話
is_ryo
4
2.9k
AppSyncで始めるGraphQL
is_ryo
1
660
Other Decks in Programming
See All in Programming
App Intentsのビルドプロセスを支える技術
kntkymt
0
380
Family mrubyの進捗
kishima
1
120
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
350
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
7.2k
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
1
560
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
720
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
3
550
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
250
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
290
Webの地図
yosuke_furukawa
PRO
6
4.6k
AIエージェント時代のコードレビューを設計する
nogu66
6
2.7k
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
420
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
247
13k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
530
How to Talk to Developers About Accessibility
jct
2
550
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
410
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
It's Worth the Effort
3n
188
29k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
How STYLIGHT went responsive
nonsquared
100
6.3k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
410
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
460
Transcript
2020/02/12 関西Node学園 9時限目 Ryosuke Izumi
Ryosuke Izumi WebApplication / IoT AWS / Vue / TypeScript
/ Serverless v-kansai & kansai.ts organizer @is_ryo
今日の話題
Lambda+Node.js の小話
AWS使ってる人
AWS使えるって 言える人いますか?
Lambda使ってる人
Lambda って便利ですよね
ほんとユースケースが多い
個人的には Python とか Nodejs をLambda上で動かすことが多い
https://twitter.com/Keisuke69/status/1224630084465643520
ただEOLが近づいてくると AWSからメールが飛んでくる
AWS「Nodejs v8 はもうすぐEOL だから10か12にバージョン上げ てね。EOLになったあとも動くけ ど、Lambda自体の更新はできな くなるよ。よろしく。」
めっちゃ親切やん…
Lambda 上の Nodejs も ちゃんとメンテナンスしないと いけない…
やったこと
Nodejs8.10 → Nodejs10.x
基本的に脳死状態で アップデートしていった (真似しちゃダメ。絶対。)
あるLambdaだけアップデート したあとにエラーを吐き出した…
何が起きたか
module が見つからん! っていうエラーが出た
こんな書き方になっていた…
おわかりいただけただろうか?
None
原因
Nodejs10.x から AmazonLinux2 上に展開されるようになってい て、環境変数$NODE_PATHの内 容が変わっていた。
Lambda Workers (EC2 Instances) Host OS Hypervisor MicroVM Lambda Lambda
EC2 Bare Metal Instance Host OS Host Kernel KVM Firecraker MicroVM Lambda Firecraker MicroVM Lambda EC2 モデル Firecraker モデル
• Nodejs8.10 • Nodejs10.x
• Nodejs8.10 /opt/nodejs/node8/node_modules:/opt/nodejs /node_modules:/var/runtime/node_modules:/v ar/runtime:/var/task:/var/runtime/node_mod ules • Nodejs10.x /opt/nodejs/node10/node_modules:/opt/nodej s/node_modules:/var/runtime/node_modules
https://nodejs.org/docs/v12.13.1/api/modules.html
/var/task に path が通って なかったので参照できなかった
解決方法
ちゃんと相対パスで書こう
import文を使おう
まとめ
• require はちゃんと相対パスで書こう • import文っていう方法もあるよ • アップデートはNodejs だけの問題じゃ ないときあるので気をつけよう •
Lambdaのデプロイはフレームワーク等 で管理しないと大変…
おわり