{"id":799,"hash":"dd71cb49fd4fb09b788511d73625abab3be2ff3ae2c89aec8e8158f5e8c95cec","pattern":"AWS SAM - Esbuild Failed: cannot find esbuild","full_message":"I'm trying out AWS SAM with nodeJS and Typescript using 'sam init', but when I want to build the example hello-world-typescript application using 'sam build', I get the following message:\n\nBuilding codeuri: C:\\RF\\GitHub\\rf-09-06\\hello-world runtime: nodejs14.x metadata: {'BuildMethod': 'esbuild', 'BuildProperties': {'Minify': True, 'Target': 'es2020', 'Sourcemap': True, 'EntryPoints': ['app.ts']}} architecture: x86_64 functions: ['HelloWorldFunction']\nRunning NodejsNpmEsbuildBuilder:CopySource\nRunning NodejsNpmEsbuildBuilder:NpmInstall\nRunning NodejsNpmEsbuildBuilder:EsbuildBundle\n\nBuild Failed\nError: NodejsNpmEsbuildBuilder:EsbuildBundle - Esbuild Failed: cannot find esbuild\n\nAny idea how to resolve it?\n\nThanks!","ecosystem":"npm","package_name":"typescript","package_version":null,"solution":"It can be solved in either of the 2 ways:\n\nInstall esbuild globally using npm install -g esbuild\n\nAs mentioned in the AWS SAM github issues, move esbuild to non-dev dependency (npm install esbuild) -  Since esbuild will bundle your code, it won't be packaged in your Lambda.\n\nPS: latest version of hello-world-typescript has this already corrected as mentioned in point 2.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/72557584/aws-sam-esbuild-failed-cannot-find-esbuild","votes":9,"created_at":"2026-04-19T04:51:44.609482+00:00","updated_at":"2026-04-19T04:51:44.609482+00:00"}