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
is_ryo
February 12, 2020
Programming
1.5k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
LambdaのNodejsをアップデートしたら困った話
is_ryo
February 12, 2020
Transcript
37 slides
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のデプロイはフレームワーク等 で管理しないと大変…
おわり
More Decks by is_ryo
See All by is_ryo
生成AIとエンジニアの仕事と私~実践知を添えて~
is_ryo
0
140
Unknownのことをちゃんと知りたい_関西フロントエンド忘年会
[email protected]
× KINTOテクノロジーズ
is_ryo
0
56
tRPC入門
is_ryo
1
370
TypeScriptでWebAssemblyに入門しよう
is_ryo
0
410
Honoが良さそう🔥
is_ryo
1
1.5k
頑張らないオレオレVuex規約を作った話
is_ryo
4
3k
AppSyncで始めるGraphQL
is_ryo
1
670
Other Decks in Programming
See All in Programming
はじめてのPLATEAU
nokonoko1203
1
670
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
210
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
210
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
230
AI Augmentation Techniques with Liberty
ivargrimstad
1
560
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
270
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
360
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
980
DroidKnights 2026 Android A2UI Jetpack Compose 기반의 안전한 AI UI 렌더링 - 박제창
itsmedreamwalker
1
260
AI時代のIaC入門 〜なぜインフラをコードで管理したいのか?〜 / Introduction to IaC in the AI Era
akihisaikeda
6
1.6k
Kotlin JVM用に作られたライブラリのKMPを前提とした再設計
jsoizo
0
230
どうしても Eloquent でリポジトリパターンをやりたいんだ #phpcon_niigata / phpcon-niigata-2026
shogogg
0
670
Featured
See All Featured
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
480
Become a Pro
speakerdeck
PRO
31
6.4k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
320
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
350
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Believing is Seeing
oripsolob
1
290
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
540
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
550
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k