sst: `sst init` errors in fresh directory


Discussion on Discord https://discord.com/channels/983865673656705025/1177071497974648952/1220196175165132881.

Trying to initialize an sst project in a completely new directory. Did the following.

  • mkdir sst-ion-test
  • cd sst-ion-test
  • pnpm init
  • sst init

sst init when run with verbose just gives the following.

image

From SyncLinear.com | ION-216

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 19 (9 by maintainers)

Most upvoted comments

I was able to track down the issue with my init after running with the newly provided details in --verbose. Init script was failing on bun install. I found this issue https://github.com/oven-sh/bun/issues/4988 it suggested that bun is having issues with ipv6. After disabling ipv6 init/bun works as expected. Maybe don’t use bun or get bun to fix the upstream bugs.

@thdxr I am still having some issues, here is what I did:

Steps

  1. Install sst - curl -fsSL https://ion.sst.dev/install | bash (v0.0.193)
  2. Create Next.js app - npx create-next-app@latest ion-nextjs --typescript --tailwind --eslint
  3. cd ion-nextjs
  4. Init sst - AWS_PROFILE="personal" sst init --verbose

Output

▲ (0xMBP14.lan) ion-nextjs [main] AWS_PROFILE="personal" sst init --verbose
time=2024-03-22T11:31:37.883-05:00 level=INFO msg="checking for bun" path="/Users/stamati/Library/Application Support/sst/bin/bun"

   ███████╗███████╗████████╗
   ██╔════╝██╔════╝╚══██╔══╝
   ███████╗███████╗   ██║   
   ╚════██║╚════██║   ██║   
   ███████║███████║   ██║   
   ╚══════╝╚══════╝   ╚═╝   

>  Next.js detected. This will...
   - create an sst.config.ts
   - modify the tsconfig.json
   - add the sst sdk to package.json

✓  Template: nextjs

✓  Using: aws

time=2024-03-22T11:31:39.918-05:00 level=INFO msg="creating project" name=ion-nextjs
time=2024-03-22T11:31:39.919-05:00 level=INFO msg="copying template" path=templates/nextjs/files/sst-env.d.ts
time=2024-03-22T11:31:39.919-05:00 level=INFO msg="copying template" path=templates/nextjs/files/sst.config.ts
time=2024-03-22T11:31:39.920-05:00 level=INFO msg=patching file=tsconfig.json
time=2024-03-22T11:31:39.924-05:00 level=INFO msg=patching file=package.json
time=2024-03-22T11:31:39.927-05:00 level=INFO msg="handling .gitignore" section="# open-next"
⠋  Installing providers...time=2024-03-22T11:31:39.929-05:00 level=INFO msg="esbuild building"
time=2024-03-22T11:31:39.941-05:00 level=INFO msg="esbuild built" outfile=/Users/stamati/Developer/Sandbox/ion-nextjs/.sst/eval/eval-1711125099928.mjs
time=2024-03-22T11:31:39.942-05:00 level=INFO msg="evaluating config"
time=2024-03-22T11:31:39.988-05:00 level=INFO msg="config evaluated"
time=2024-03-22T11:31:39.988-05:00 level=INFO msg="installing platform"
⠙  Installing providers...time=2024-03-22T11:31:40.046-05:00 level=INFO msg="installing deps"
time=2024-03-22T11:31:40.046-05:00 level=INFO msg="writing package.json"
time=2024-03-22T11:31:40.046-05:00 level=INFO msg="adding dependency" name=aws
time=2024-03-22T11:31:40.047-05:00 level=INFO msg="fetching deps"
⠋  Installing providers...time=2024-03-22T11:31:41.021-05:00 level=ERROR msg="exited with error" err="failed to run bun install bun install v1.0.35 (940448d6)\nnode:internal/child_process:1124\n    result.error = new ErrnoException(result.error, 'spawnSync ' + options.file);\n                   ^\n\n<ref *1> Error: spawnSync /Users/stamati/Developer/Sandbox/ion-nextjs/.sst/platform/node_modules/esbuild/bin/esbuild EACCES\n    at Object.spawnSync (node:internal/child_process:1124:20)\n    at spawnSync (node:child_process:876:24)\n    at Object.execFileSync (node:child_process:919:15)\n    at validateBinaryVersion (/Users/stamati/Developer/Sandbox/ion-nextjs/.sst/platform/node_modules/esbuild/install.js:99:28)\n    at /Users/stamati/Developer/Sandbox/ion-nextjs/.sst/platform/node_modules/esbuild/install.js:286:5 {\n  errno: -13,\n  code: 'EACCES',\n  syscall: 'spawnSync /Users/stamati/Developer/Sandbox/ion-nextjs/.sst/platform/node_modules/esbuild/bin/esbuild',\n  path: '/Users/stamati/Developer/Sandbox/ion-nextjs/.sst/platform/node_modules/esbuild/bin/esbuild',\n  spawnargs: [ '--version' ],\n  error: [Circular *1],\n  status: null,\n  signal: null,\n  output: null,\n  pid: 0,\n  stdout: null,\n  stderr: null\n}\n\nNode.js v21.5.0\n\nerror: postinstall script from \"esbuild\" exited with 1\n"
×  Unexpected error occurred. Please check the logs or run with --verbose for more details.