Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next.js - 12.1.1 -> not allowing npx create-next-app #35607

Closed
1 task done
dhavalveera opened this issue Mar 26, 2022 · 8 comments · Fixed by #35608
Closed
1 task done

Next.js - 12.1.1 -> not allowing npx create-next-app #35607

dhavalveera opened this issue Mar 26, 2022 · 8 comments · Fixed by #35608
Labels
bug Issue was opened via the bug report template.

Comments

@dhavalveera
Copy link

dhavalveera commented Mar 26, 2022

Verify canary release

  • I verified that the issue exists in Next.js canary release

Provide environment information

'next' is not recognized as an internal or external command,
operable program or batch file.

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

after updating the create-next-app by npm install -g create-next-app after that when I am running the below command to start a Nextjs App, I am getting below error.

C:\Users\Dhaval Vira\Desktop\Coursera Learning\Next_Prisma>npx create-next-app demotwo
Creating a new Next.js app in C:\Users\Dhaval Vira\Desktop\Coursera Learning\Next_Prisma\demotwo.

Using yarn.

Installing dependencies:
- react
- react-dom
- next

'yarn' is not recognized as an internal or external command,
operable program or batch file.
node:events:504
      throw er; // Unhandled 'error' event
      ^

Error: spawn yarn ENOENT
    at notFoundError (C:\Users\Dhaval Vira\AppData\Roaming\npm\node_modules\create-next-app\dist\index.js:100:3828)
    at verifyENOENT (C:\Users\Dhaval Vira\AppData\Roaming\npm\node_modules\create-next-app\dist\index.js:100:4207)
    at ChildProcess.e.emit (C:\Users\Dhaval Vira\AppData\Roaming\npm\node_modules\create-next-app\dist\index.js:100:4062)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess.e.emit (C:\Users\Dhaval Vira\AppData\Roaming\npm\node_modules\create-next-app\dist\index.js:100:4103)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn yarn',
  path: 'yarn',
  spawnargs: [
    'add',
    '--exact',
    '--cwd',
    'C:\\Users\\Dhaval Vira\\Desktop\\Coursera Learning\\Next_Prisma\\demotwo',
    'react',
    'react-dom',
    'next'
  ]
}

Expected Behavior

after updating create-next-app to 12.1.1, npx create-next-app appname is not creating the Next app

To Reproduce

I tried npx create-next-app@latest appname but it's throwing the same error.

even I tried to uninstall the create-next-app & reinstalled it but it's throwing the same error.

and I install yarn globally then npx create-next-app appname run command properly without any error

@dhavalveera dhavalveera added the bug Issue was opened via the bug report template. label Mar 26, 2022
@git-no
Copy link

git-no commented Mar 26, 2022

I have the same issue. Can not run npx create-next-app@latestwithout error/break.
Node 16.14.2, no yarn installed.

@kodiakhq kodiakhq bot closed this as completed in #35608 Mar 26, 2022
kodiakhq bot pushed a commit that referenced this issue Mar 26, 2022
This fixes our package manager detection which was changed slightly in #34947 for `pnpm` support to ensure the default case still attempts detecting the available package manager if no preference is specified in the command args. This also adds a test case to ensure the install succeeds when we fail to detect a valid `yarn` binary and no preference is set via the `npm_config_user_agent` env variable. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Fixes: #35607
Fixes: #35599
@dhavalveera
Copy link
Author

when this update will be released @ijjk?

@nahuelDev23
Copy link

same error, ideas?

@JorneSaenen
Copy link

same error, ideas?

"npx create-next-app@latest --use-npm"

@W9968
Copy link

W9968 commented Mar 26, 2022

"npx create-next-app@latest --use-npm"

this does not help at least for my case it just stuck installing without any progress for about 20+ minutes

@ijjk
Copy link
Member

ijjk commented Mar 28, 2022

Hi, this has been fixed in the latest version of Next.js v12.1.2 please give it a try! Note: this may require running with @latest e.g. npx create-next-app@latest. Specific PR this was fixed in can be seen here #35608

@dhavalveera
Copy link
Author

@ijjk -> Thank you, sir, the problem is solved!!!! and I tried with npx create-next-app appname it's working perfectly fine.

Thanks a lot!

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2022
LuighiV pushed a commit to openpolitica/create-openpolitica-nextjs-app that referenced this issue Aug 24, 2022
This fixes our package manager detection which was changed slightly in vercel/next.js#34947 for `pnpm` support to ensure the default case still attempts detecting the available package manager if no preference is specified in the command args. This also adds a test case to ensure the install succeeds when we fail to detect a valid `yarn` binary and no preference is set via the `npm_config_user_agent` env variable. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Fixes: vercel/next.js#35607
Fixes: vercel/next.js#35599
pavleadev added a commit to pavleadev/next.js that referenced this issue Mar 29, 2023
This fixes our package manager detection which was changed slightly in vercel/next.js#34947 for `pnpm` support to ensure the default case still attempts detecting the available package manager if no preference is specified in the command args. This also adds a test case to ensure the install succeeds when we fail to detect a valid `yarn` binary and no preference is set via the `npm_config_user_agent` env variable. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Fixes: vercel/next.js#35607
Fixes: vercel/next.js#35599
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants