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

create-next-app suddenly stopped working #36002

Closed
1 task done
MisterCrispyFL opened this issue Apr 8, 2022 · 5 comments
Closed
1 task done

create-next-app suddenly stopped working #36002

MisterCrispyFL opened this issue Apr 8, 2022 · 5 comments
Labels
bug Issue was opened via the bug report template.

Comments

@MisterCrispyFL
Copy link

Verify canary release

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

Provide environment information

npm ERR! canceled

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\erick\AppData\Local\npm-cache_logs\2022-04-08T12_06_57_308Z-debug-0.log

Log data:
0 verbose cli C:\Program Files\nodejs\node.exe C:\Users\erick\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
1 info using npm@8.6.0
2 info using node@v16.14.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:C:\Users\erick\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:C:\Users\erick.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:C:\Users\erick\AppData\Roaming\npm\etc\npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:validate Completed in 0ms
15 timing config:load:credentials Completed in 1ms
16 timing config:load:setEnvs Completed in 0ms
17 timing config:load Completed in 7ms
18 timing npm:load:configload Completed in 7ms
19 timing npm:load:mkdirpcache Completed in 1ms
20 timing npm:load:mkdirplogs Completed in 0ms
21 verbose title npm exec next info
22 verbose argv "exec" "--yes" "false" "--" "next" "info"
23 timing npm:load:setTitle Completed in 1ms
24 timing config:load:flatten Completed in 2ms
25 timing npm:load:display Completed in 3ms
26 verbose logfile logs-max:10 dir:C:\Users\erick\AppData\Local\npm-cache_logs
27 verbose logfile C:\Users\erick\AppData\Local\npm-cache_logs\2022-04-08T12_06_57_308Z-debug-0.log
28 timing npm:load:logFile Completed in 3ms
29 timing npm:load:timers Completed in 0ms
30 timing npm:load:configScope Completed in 0ms
31 timing npm:load Completed in 15ms
32 silly logfile start cleaning logs, removing 2 files
33 silly logfile done cleaning log files
34 http fetch GET 200 https://registry.npmjs.org/next 336ms (cache updated)
35 timing arborist:ctor Completed in 1ms
36 timing arborist:ctor Completed in 0ms
37 timing command:exec Completed in 390ms
38 verbose stack Error: canceled
38 verbose stack at exec (C:\Users\erick\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmexec\lib\index.js:156:17)
38 verbose stack at async module.exports (C:\Users\erick\AppData\Roaming\npm\node_modules\npm\lib\cli.js:78:5)
39 verbose cwd C:\Users\erick\source\Projects
40 verbose Windows_NT 10.0.22000
41 verbose node v16.14.0
42 verbose npm v8.6.0
43 error canceled
44 verbose exit 1
45 timing npm Completed in 466ms
46 verbose code 1
47 error A complete log of this run can be found in:
47 error C:\Users\erick\AppData\Local\npm-cache_logs\2022-04-08T12_06_57_308Z-debug-0.log

What browser are you using? (if relevant)

Firefox 99.0

How are you deploying your application? (if relevant)

No response

Describe the Bug

When trying to run npx create-next-app@latest --typescript I get the following error:

Usage Error: The nearest package directory (C:\Users\erick\source\Projects\nexttest) doesn't seem to be part of the project declared in C:\Users\erick.

- If C:\Users\erick isn't intended to be a project, remove any yarn.lock and/or package.json file there.
- If C:\Users\erick is intended to be a project, it might be that you forgot to list source/Projects/nexttest in its workspace configuration.
- Finally, if C:\Users\erick is fine and you intend source/Projects/nexttest to be treated as a completely separate project (not even a workspace), create an empty yarn.lock file in it.

$ yarn add [--json] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ...

Aborting installation.
  yarn add --exact --cwd C:\Users\erick\source\Projects\nexttest react react-dom next has failed.

This started happening last week and it happens on both my desktop computer as well as my laptop.

It created the folder (nexttest, in this case) and puts a package.json in said folder with just
{
"name": "nexttest",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
}
}

The same thing happens if I use @canary as of this morning.

Expected Behavior

It worked fine building empty sites before.

To Reproduce

Run npx create-next-app@latest --typescript and try to install.

@MisterCrispyFL MisterCrispyFL added the bug Issue was opened via the bug report template. label Apr 8, 2022
@DanielBailey-web
Copy link

In case this is blocking you, you could use an example instead.

npx create-next-app --example with-typescript with-typescript-app
# or
yarn create next-app --example with-typescript with-typescript-app
# or
pnpm create next-app -- --example with-typescript with-typescript-app

@MisterCrispyFL
Copy link
Author

Same problem:

PS C:\Users\erick\source\Projects> npx create-next-app --example with-typescript with-typescript-app
Creating a new Next.js app in C:\Users\erick\source\Projects\with-typescript-app.

Downloading files for example with-typescript. This might take a moment.

Installing packages. This might take a couple of minutes.

Usage Error: The nearest package directory (C:\Users\erick\source\Projects\with-typescript-app) doesn't seem to be part of the project declared in C:\Users\erick.

  • If C:\Users\erick isn't intended to be a project, remove any yarn.lock and/or package.json file there.
  • If C:\Users\erick is intended to be a project, it might be that you forgot to list source/Projects/with-typescript-app in its workspace configuration.
  • Finally, if C:\Users\erick is fine and you intend source/Projects/with-typescript-app to be treated as a completely separate project (not even a workspace), create an empty yarn.lock file in it.

$ yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--mode #0]

Aborting installation.
yarn install has failed.

@MisterCrispyFL
Copy link
Author

Ok, I've got it working. Somehow, my yarn version got updated to latest (3+). I set it back to 1.22.1 and it started working again.

@timneutkens
Copy link
Member

Sounds like this is particular to yarn and is not related to create-next-app as it only invokes yarn to install packages. Seemingly there is a package.json / yarn.lock in your $HOME directory which is causing yarn to error out.

@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 May 21, 2022
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

No branches or pull requests

4 participants
@timneutkens @MisterCrispyFL @DanielBailey-web and others