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
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
360
TypeScriptでWebAssemblyに入門しよう
is_ryo
0
400
Honoが良さそう🔥
is_ryo
1
1.5k
頑張らないオレオレVuex規約を作った話
is_ryo
4
2.9k
AppSyncで始めるGraphQL
is_ryo
1
660
Other Decks in Programming
See All in Programming
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
390
Androidだけじゃない、DroidKaigiで広がった私の技術スタック
akkeylab
0
120
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
180
Rでドレミ/Do-Re-Mi_with_R
florets1
0
120
Jetpack Compose Mechanisms
skydoves
2
360
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
440
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
130
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
580
パーソナライズPodcastを作った話
repunit11
0
120
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
440
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
250
Security issues being discussed on Web Platforms
petamoriken
0
1.4k
Featured
See All Featured
Making Projects Easy
brettharned
120
6.8k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
Optimising Largest Contentful Paint
csswizardry
37
4k
Typedesign – Prime Four
hannesfritz
42
3.2k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
420
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
610
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
420
Navigating Team Friction
lara
192
16k
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のデプロイはフレームワーク等 で管理しないと大変…
おわり