question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Cannot find module 'esbuild'" error when installing `aws-nodejs-typescript` template

See original GitHub issue

Are you certain it’s a bug?

  • Yes, it looks like a bug

Is the issue caused by a plugin?

  • It is not a plugin issue

Are you using the latest version?

  • Yes, I’m using the latest version

Is there an existing issue for this?

  • I have searched existing issues, it hasn’t been reported yet

Issue description

When installing the aws-nodejs-typescript template, after running yarn sls deploy, I get the following error:

Cannot find module 'esbuild'

I simply fixed it by installing esbuild, but it hampers the dev experience.

Service configuration (serverless.yml) content

N/A

Command name and used flags

serverless deploy

Command output

N/A

Environment information

N/A

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ThomasAribartcommented, Jan 7, 2022

Yes I did use sls create but did run npm install as well 😃 I had to add esbuild to devDependencies to make the deploy work

0reactions
iaforekcommented, Mar 15, 2022

I can confirm same issue.

My environment:

  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              14.17.0
     Framework Version:         2.72.3 (local)
     Plugin Version:            5.5.4
     SDK Version:               4.3.2
     Components Version:        3.18.2

Steps to reproduce:

sls create -t aws-nodejs-typescript
npm install
sls deploy

GIves: Error: Cannot find module 'esbuild'

Additionally:

Note we no longer recommend sls create for new projects setup. Instead please use sls interactive setup,

Running just sls gives me following options (note no typescript in the list):

 What do you want to make? (Use arrow keys)
❯ AWS - Node.js - Starter 
  AWS - Node.js - HTTP API 
  AWS - Node.js - Scheduled Task 
  AWS - Node.js - SQS Worker 
  AWS - Node.js - Express API 
  AWS - Node.js - Express API with DynamoDB 
  AWS - Python - Starter 
  AWS - Python - HTTP API 
  AWS - Python - Scheduled Task 
  AWS - Python - SQS Worker 
  AWS - Python - Flask API 
  AWS - Python - Flask API with DynamoDB 
  Other

Interestingly, when selecting Other I get

Run “serverless create --help” to view available templates and create a new project from one of those templates.

Adding esbuild to package.json obviously fixed the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

serverless AWS deployment fails because of esbuild
When I try to deploy my serverless application to AWS I'm running into this error: I'm using the aws-nodejs-typescript template. You installed ......
Read more >
Cannot find module 'esbuild' when page crashes upon deploy
Hi all, I'm having a problem with my deploy on Netlify. My Next.js project builds and deploys perfectly. However, when I go to...
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
I'm getting the error because I'm trying to import the freeCodeCamp icon from the react-icons package, which I don't have installed. import { ......
Read more >
Building a serverless app with TypeScript - LogRocket Blog
Build a serverless application using TypeScript and the serverless framework, an open source CLI and hosted dashboard.
Read more >
aws-nodejs-typescriptのテンプレートを使ってみる - Qiita
serverless.yml から serverless.ts になったことやビルドツールが webpack から esbuild になったことにより詰まったので、シェアできればと思い、まとめ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found