bun icon indicating copy to clipboard operation
bun copied to clipboard

bunx create-next-app fails to create next app - Multiple packages are failing

Open iam-hussain opened this issue 2 years ago • 16 comments

What version of Bun is running?

1.0.0

What platform is your computer?

Darwin 22.5.0 x86_64 i386

What steps can reproduce the bug?

Run bunx create-next-app ✔ What is your project named? my-app ✔ Would you like to use TypeScript? Yes ✔ Would you like to use ESLint? Yes ✔ Would you like to use Tailwind CSS? Yes ✔ Would you like to use src/ directory? Yes ✔ Would you like to use App Router? (recommended) Yes ✔ Would you like to customize the default import alias? No

Creating a new Next.js app in ....

Ref:

  • https://bun.sh/guides/ecosystem/nextjs
  • https://nextjs.org/docs/pages/api-reference/create-next-app

What is the expected behavior?

Create the NEXT JS application successfully and I will be able to run bun run dev

What do you see instead?

On bun run dev

bun run dev
$ next dev
/bin/bash: next: command not found
error: script "dev" exited with code 127

Additional information

https://app.warp.dev/block/8c1hJUg5kxvplwscni2820

bunx create-next-app
✔ What is your project named? … my-app
✔ Would you like to use TypeScript? … No / Yes
✔ Would you like to use ESLint? … No / Yes
✔ Would you like to use Tailwind CSS? … No / Yes
✔ Would you like to use `src/` directory? … No / Yes
✔ Would you like to use App Router? (recommended) … No / Yes
✔ Would you like to customize the default import alias? … No / Yes
Creating a new Next.js app in /Volumes/Code/my-app.

Using bun.

Initializing project with template: app-tw


Installing dependencies:
- react
- react-dom
- next
- typescript
- @types/react
- @types/node
- @types/react-dom
- tailwindcss
- postcss
- autoprefixer
- eslint
- eslint-config-next

bun add v1.0.0 (822a00c4)
error: Unexpected installing @types/node
error: Unexpected installing @types/react
error: Unexpected installing @types/react-dom
error: Unexpected installing autoprefixer
error: Unexpected installing eslint
error: Unexpected installing eslint-config-next
error: Unexpected installing next
error: Unexpected installing postcss
error: Unexpected installing react
error: Unexpected installing react-dom
error: Unexpected installing tailwindcss
error: Unexpected installing typescript
error: Unexpected installing @types/prop-types
error: Unexpected installing @types/scheduler
error: Unexpected installing csstype
error: Unexpected installing browserslist
error: Unexpected installing caniuse-lite
error: Unexpected installing fraction.js
error: Unexpected installing normalize-range
error: Unexpected installing picocolors
error: Unexpected installing postcss-value-parser
error: Unexpected installing @eslint-community/eslint-utils
error: Unexpected installing @eslint-community/regexpp
error: Unexpected installing @eslint/eslintrc
error: Unexpected installing @eslint/js
error: Unexpected installing @humanwhocodes/config-array
error: Unexpected installing @humanwhocodes/module-importer
error: Unexpected installing @nodelib/fs.walk
error: Unexpected installing ajv
error: Unexpected installing chalk
error: Unexpected installing cross-spawn
error: Unexpected installing debug
error: Unexpected installing doctrine
error: Unexpected installing escape-string-regexp
error: Unexpected installing eslint-scope
error: Unexpected installing eslint-visitor-keys
error: Unexpected installing espree
error: Unexpected installing esquery
error: Unexpected installing esutils
error: Unexpected installing fast-deep-equal
error: Unexpected installing file-entry-cache
error: Unexpected installing find-up
error: Unexpected installing glob-parent
error: Unexpected installing globals
error: Unexpected installing graphemer
error: Unexpected installing ignore
error: Unexpected installing imurmurhash
error: Unexpected installing is-glob
error: Unexpected installing is-path-inside
error: Unexpected installing js-yaml
error: Unexpected installing json-stable-stringify-without-jsonify
error: Unexpected installing levn
error: Unexpected installing lodash.merge
error: Unexpected installing minimatch
error: Unexpected installing natural-compare
error: Unexpected installing optionator
error: Unexpected installing strip-ansi
error: Unexpected installing text-table
error: Unexpected installing @next/eslint-plugin-next
error: Unexpected installing @rushstack/eslint-patch
error: Unexpected installing @typescript-eslint/parser
error: Unexpected installing eslint-import-resolver-node
error: Unexpected installing eslint-import-resolver-typescript
error: Unexpected installing eslint-plugin-import
error: Unexpected installing eslint-plugin-jsx-a11y
error: Unexpected installing eslint-plugin-react
error: Unexpected installing eslint-plugin-react-hooks
error: Unexpected installing @next/env
error: Unexpected installing @swc/helpers
error: Unexpected installing busboy
error: Unexpected installing styled-jsx
error: Unexpected installing watchpack
error: Unexpected installing zod
error: Unexpected installing @next/swc-darwin-x64
error: Unexpected installing nanoid
error: Unexpected installing source-map-js
error: Unexpected installing loose-envify
error: Unexpected installing scheduler
error: Unexpected installing @alloc/quick-lru
error: Unexpected installing arg
error: Unexpected installing chokidar
error: Unexpected installing didyoumean
error: Unexpected installing dlv
error: Unexpected installing fast-glob
error: Unexpected installing jiti
error: Unexpected installing lilconfig
error: Unexpected installing micromatch
error: Unexpected installing normalize-path
error: Unexpected installing object-hash
error: Unexpected installing postcss-import
error: Unexpected installing postcss-js
error: Unexpected installing postcss-load-config
error: Unexpected installing postcss-nested
error: Unexpected installing postcss-selector-parser
error: Unexpected installing resolve
error: Unexpected installing sucrase
error: Unexpected installing electron-to-chromium
error: Unexpected installing node-releases
error: Unexpected installing update-browserslist-db
error: Unexpected installing import-fresh
error: Unexpected installing strip-json-comments
error: Unexpected installing @humanwhocodes/object-schema
error: Unexpected installing @nodelib/fs.scandir
error: Unexpected installing fastq
error: Unexpected installing fast-json-stable-stringify
error: Unexpected installing json-schema-traverse
error: Unexpected installing uri-js
error: Unexpected installing ansi-styles
error: Unexpected installing supports-color
error: Unexpected installing path-key
error: Unexpected installing shebang-command
error: Unexpected installing which
error: Unexpected installing ms
error: Unexpected installing esrecurse
error: Unexpected installing estraverse
error: Unexpected installing acorn
error: Unexpected installing acorn-jsx
error: Unexpected installing flat-cache
error: Unexpected installing locate-path
error: Unexpected installing path-exists
error: Unexpected installing type-fest
error: Unexpected installing is-extglob
error: Unexpected installing argparse
error: Unexpected installing prelude-ls
error: Unexpected installing type-check
error: Unexpected installing brace-expansion
error: Unexpected installing deep-is
error: Unexpected installing @aashutoshrathi/word-wrap
error: Unexpected installing fast-levenshtein
error: Unexpected installing ansi-regex
error: Unexpected installing glob
error: Unexpected installing @typescript-eslint/scope-manager
error: Unexpected installing @typescript-eslint/types
error: Unexpected installing @typescript-eslint/typescript-estree
error: Unexpected installing @typescript-eslint/visitor-keys
error: Unexpected installing is-core-module
error: Unexpected installing enhanced-resolve
error: Unexpected installing eslint-module-utils
error: Unexpected installing get-tsconfig
error: Unexpected installing array-includes
error: Unexpected installing array.prototype.findlastindex
error: Unexpected installing array.prototype.flat
error: Unexpected installing array.prototype.flatmap
error: Unexpected installing has
error: Unexpected installing object.fromentries
error: Unexpected installing object.groupby
error: Unexpected installing object.values
error: Unexpected installing semver
error: Unexpected installing tsconfig-paths
error: Unexpected installing @babel/runtime
error: Unexpected installing aria-query
error: Unexpected installing ast-types-flow
error: Unexpected installing axe-core
error: Unexpected installing axobject-query
error: Unexpected installing damerau-levenshtein
error: Unexpected installing emoji-regex
error: Unexpected installing jsx-ast-utils
error: Unexpected installing language-tags
error: Unexpected installing object.entries
error: Unexpected installing array.prototype.tosorted
error: Unexpected installing es-iterator-helpers
error: Unexpected installing object.hasown
error: Unexpected installing prop-types
error: Unexpected installing string.prototype.matchall
error: Unexpected installing tslib
error: Unexpected installing streamsearch
error: Unexpected installing client-only
error: Unexpected installing glob-to-regexp
error: Unexpected installing graceful-fs
error: Unexpected installing js-tokens
error: Unexpected installing anymatch
error: Unexpected installing braces
error: Unexpected installing is-binary-path
error: Unexpected installing readdirp
error: Unexpected installing fsevents
error: Unexpected installing @nodelib/fs.stat
error: Unexpected installing merge2
error: Unexpected installing picomatch
error: Unexpected installing read-cache
error: Unexpected installing camelcase-css
error: Unexpected installing yaml
error: Unexpected installing cssesc
error: Unexpected installing util-deprecate
error: Unexpected installing path-parse
error: Unexpected installing supports-preserve-symlinks-flag
error: Unexpected installing @jridgewell/gen-mapping
error: Unexpected installing commander
error: Unexpected installing lines-and-columns
error: Unexpected installing mz
error: Unexpected installing pirates
error: Unexpected installing ts-interface-checker
error: Unexpected installing escalade
error: Unexpected installing parent-module
error: Unexpected installing resolve-from
error: Unexpected installing run-parallel
error: Unexpected installing reusify
error: Unexpected installing punycode
error: Unexpected installing color-convert
error: Unexpected installing has-flag
error: Unexpected installing shebang-regex
error: Unexpected installing isexe
error: Unexpected installing flatted
error: Unexpected installing keyv
error: Unexpected installing rimraf
error: Unexpected installing p-locate
error: Unexpected installing balanced-match
error: Unexpected installing concat-map
error: Unexpected installing fs.realpath
error: Unexpected installing inflight
error: Unexpected installing inherits
error: Unexpected installing once
error: Unexpected installing path-is-absolute
error: Unexpected installing globby
error: Unexpected installing ts-api-utils
error: Unexpected installing tapable
error: Unexpected installing resolve-pkg-maps
error: Unexpected installing call-bind
error: Unexpected installing define-properties
error: Unexpected installing es-abstract
error: Unexpected installing get-intrinsic
error: Unexpected installing is-string
error: Unexpected installing es-shim-unscopables
error: Unexpected installing function-bind
error: Unexpected installing @types/json5
error: Unexpected installing json5
error: Unexpected installing minimist
error: Unexpected installing strip-bom
error: Unexpected installing regenerator-runtime
error: Unexpected installing dequal
error: Unexpected installing object.assign
error: Unexpected installing language-subtag-registry
error: Unexpected installing asynciterator.prototype
error: Unexpected installing es-set-tostringtag
error: Unexpected installing globalthis
error: Unexpected installing has-property-descriptors
error: Unexpected installing has-proto
error: Unexpected installing has-symbols
error: Unexpected installing internal-slot
error: Unexpected installing iterator.prototype
error: Unexpected installing safe-array-concat
error: Unexpected installing object-assign
error: Unexpected installing react-is
error: Unexpected installing regexp.prototype.flags
error: Unexpected installing side-channel
error: Unexpected installing fill-range
error: Unexpected installing binary-extensions
error: Unexpected installing pify
error: Unexpected installing @jridgewell/set-array
error: Unexpected installing @jridgewell/sourcemap-codec
error: Unexpected installing @jridgewell/trace-mapping
error: Unexpected installing any-promise
error: Unexpected installing thenify-all
error: Unexpected installing callsites
error: Unexpected installing queue-microtask
error: Unexpected installing color-name
error: Unexpected installing json-buffer
error: Unexpected installing p-limit
error: Unexpected installing wrappy
error: Unexpected installing array-union
error: Unexpected installing dir-glob
error: Unexpected installing slash
error: Unexpected installing lru-cache
error: Unexpected installing object-keys
error: Unexpected installing array-buffer-byte-length
error: Unexpected installing arraybuffer.prototype.slice
error: Unexpected installing available-typed-arrays
error: Unexpected installing es-to-primitive
error: Unexpected installing function.prototype.name
error: Unexpected installing get-symbol-description
error: Unexpected installing gopd
error: Unexpected installing is-array-buffer
error: Unexpected installing is-callable
error: Unexpected installing is-negative-zero
error: Unexpected installing is-regex
error: Unexpected installing is-shared-array-buffer
error: Unexpected installing is-typed-array
error: Unexpected installing is-weakref
error: Unexpected installing object-inspect
error: Unexpected installing safe-regex-test
error: Unexpected installing string.prototype.trim
error: Unexpected installing string.prototype.trimend
error: Unexpected installing string.prototype.trimstart
error: Unexpected installing typed-array-buffer
error: Unexpected installing typed-array-byte-length
error: Unexpected installing typed-array-byte-offset
error: Unexpected installing typed-array-length
error: Unexpected installing unbox-primitive
error: Unexpected installing which-typed-array
error: Unexpected installing has-tostringtag
error: Unexpected installing reflect.getprototypeof
error: Unexpected installing isarray
error: Unexpected installing functions-have-names
error: Unexpected installing to-regex-range
error: Unexpected installing @jridgewell/resolve-uri
error: Unexpected installing thenify
error: Unexpected installing yocto-queue
error: Unexpected installing path-type
error: Unexpected installing yallist
error: Unexpected installing is-date-object
error: Unexpected installing is-symbol
error: Unexpected installing for-each
error: Unexpected installing has-bigints
error: Unexpected installing which-boxed-primitive
error: Unexpected installing which-builtin-type
error: Unexpected installing is-number
error: Unexpected installing is-bigint
error: Unexpected installing is-boolean-object
error: Unexpected installing is-number-object
error: Unexpected installing is-async-function
error: Unexpected installing is-finalizationregistry
error: Unexpected installing is-generator-function
error: Unexpected installing which-collection
error: Unexpected installing is-map
error: Unexpected installing is-set
error: Unexpected installing is-weakmap
error: Unexpected installing is-weakset
error: Unexpected installing postcss
error: Unexpected
 installed [email protected]
 installed [email protected]
 installed [email protected] with binaries:
  - next
 installed [email protected] with binaries:
  - tsc
  - tsserver
 installed @types/[email protected]
 installed @types/[email protected]
 installed @types/[email protected]
 installed [email protected] with binaries:
  - tailwind
  - tailwindcss
 installed [email protected]
 installed [email protected] with binaries:
  - autoprefixer
 installed [email protected] with binaries:
  - eslint
 installed [email protected]

Failed to install 334 packages
 installing minimatch
error: Unexpected installing debug
error: Unexpected installing debug
error: Unexpected installing doctrine
error: Unexpected installing doctrine
error: Unexpected installing resolve
error: Unexpected installing glob-parent
error: Unexpected installing glob-parent
error: Unexpected installing glob
error: Unexpected installing minimatch
error: Unexpected installing semver
error: Unexpected installing ms
error: Unexpected installing debug
error: Unexpected installing ms
error: Unexpected installing minimatch
error: Unexpected installing glob
error: Unexpected installing ms
[32.02s] done
Initialized a git repository.

Success! Created my-app at /Volumes/Code/my-app

iam-hussain avatar Sep 10 '23 13:09 iam-hussain

For me it freezes at choosing Typescript. I have to kill the terminal.

➜  bunx create-next-app@latest
✔ What is your project named? … test-bun-1
? Would you like to use TypeScript? › No / Yes
➜  bun --version
1.0.0

OS: Ubuntu 22.04.3

kopparam avatar Sep 10 '23 14:09 kopparam

@kopparam refer to this #4664

sonyarianto avatar Sep 10 '23 14:09 sonyarianto

Using the oven/bun docker image.


root@0b616bee0a8a:/home/bun/app# bun --version
1.0.1

root@0b616bee0a8a:/home/bun/app# bunx create-next-app@latest

error: SystemResources

----- bun meta -----
Bun v1.0.1 (31aec4eb) Linux x64 #1 SMP PREEMPT_DYNAMIC Debian 6.3.11-1rodete2 (2023-08-24)
BunxCommand:
Elapsed: 19ms | User: 4ms | Sys: 14ms
RSS: 33.55MB | Peak: 19.05MB | Commit: 33.55MB | Faults: 0
----- bun meta -----

0   0x5600a249ae2b
1   ???
2   ???
3   ???
4   ???
5   ???

Crash report saved to:
  ~/.bun-crash/v1.0.1-1694794113899.crash

Search GitHub issues https://bun.sh/issues or ask for #help in https://bun.sh/discord

I was excited to give bun a try and wanted to see how it works for a simple next-js app. Please suggest if there are known workarounds.

smsohan avatar Sep 15 '23 16:09 smsohan

everytime after running command to make nextjs app and for react native it start making with yarn

$ bunx create-next-app@latest
error: Script not found "create-next-app@latest"

rohan3155 avatar Apr 10 '24 02:04 rohan3155

This is confusing but each of the errors shown here have different causes

The OP's error: Unexpected is very likely fixed by now, as we've made lots of changes in the time since. If it continues to happen, we should have a different error message at least that is more clear.

@rohan3155 it looks like it somehow got into a state where bunx is no longer an alias of bun, or bun is unaware of the existence of bunx. Can you file a separate issue for that and include whether you're running on Linux, macOS, or WIndows?

Jarred-Sumner avatar Apr 10 '24 02:04 Jarred-Sumner

I wrote it like this bunx create next-app@latest instead of bunx create-next-app@latest and it worked with me

abdulApp avatar May 21 '24 22:05 abdulApp

create next-app@latest with bunx

When I tried "bunx create-next-app@latest," it said "script not found." However, when I tried "bunx create next-app@latest," it worked. The thing that continues to amaze me is that, even after taking all the requirements, "npm install" rather than "bun install" is used to install the program.

rohan3155 avatar May 22 '24 04:05 rohan3155

I wrote it like this bunx create next-app@latest instead of bunx create-next-app@latest and it worked with me

Thanks, your solution is right guys!! run bunx create next-app instead of bunx create-next-app

programmersEmperor avatar Jun 11 '24 15:06 programmersEmperor

Thanks for your help @abdulApp, I was very stressed about the bunx create-next-app command. It is better to use the bunx create next-app command.

DavidSerranoFranco avatar Jun 14 '24 06:06 DavidSerranoFranco

everytime after running command to make nextjs app and for react native it start making with yarn

$ bunx create-next-app@latest
error: Script not found "create-next-app@latest"

have you found any solution?

Bdisha123 avatar Jul 21 '24 12:07 Bdisha123

Stuck in the same problem

subhasishdasfreelance avatar Jul 21 '24 13:07 subhasishdasfreelance

everytime after running command to make nextjs app and for react native it start making with yarn

$ bunx create-next-app@latest
error: Script not found "create-next-app@latest"

have you found any solution?

it worked

bunx create next-app@latest

Raiza-Hub avatar Aug 12 '24 13:08 Raiza-Hub

I wrote it like this bunx create next-app@latest instead of bunx create-next-app@latest and it worked with me

This solution works

Divyajyoti1820 avatar Aug 19 '24 04:08 Divyajyoti1820

guys that's not a solution as shadcn scripts also rely on bun and it's showing not found there as well, still stuck on this. Previously it was all working fine

fzkhan19 avatar Aug 28 '24 08:08 fzkhan19

After using "bunx create next-app", it says resolving [1/1] and got stuck. Waiting for any helping hand.

Ajeet990 avatar Aug 30 '24 02:08 Ajeet990

bunx create next-app@latest my-app

SashenJayathilaka avatar Dec 07 '24 04:12 SashenJayathilaka

this bunx create next-app@latest worked for me

bernardyamoah avatar Apr 23 '25 03:04 bernardyamoah