-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
Can't install sample project #39321
Comments
I am looking into this. Note for anyone else investigating. All examples cause an issue. |
I could reproduce it, this seems to be a bug. 👍 Thanks for reporting. @titusdmoore feel free to debug. A good starting point might be: https://github.com/vercel/next.js/blob/canary/packages/create-next-app/helpers/examples.ts |
Another update, the issue does appear to be in the |
@titusdmoore I recently found out that this might be an issue with the next.js/packages/create-next-app/index.ts Lines 140 to 162 in b0f5901
|
I'm using NVM to downgrade Node to LTS (16). Doing so, create works. I've used curl to verify endpoint really works ( |
Any node version |
That's really weird though. I have checked the source code of |
@SukkaW Indeed weird, although this is enough to reproduce the issue: import { promisify } from "node:util"
import Stream from "node:stream"
import tar from "tar"
import got from "got"
const pipeline = promisify(Stream.pipeline)
pipeline(
got.stream("https://codeload.github.com/vercel/next.js/tar.gz/canary"),
tar.extract({ cwd: process.cwd(), strip: 3 }, [
"next.js-canary/examples/with-mongodb",
])
) To fix this in A workaround I can see is to catch the |
Greetings, in response to #39181 (comment), a queston from the issue #39181. At the time of opening the issue, the environment I was running it with is However, I've moved to Windows 10 since then, and I've still been experiencing the same problem, |
…0182) `create-next-app` currently cannot extract examples/git repos in Node 18+, because of an issue with `node-tar` (isaacs/node-tar#321). The files are extracted, but an error is thrown that the stream has been prematurely closed. To prevent `create-next-app` from not being able to finish, ~for now, we can swallow this error, and hopefully `node-tar` will be patched soon.~ we can save the tar in the `tmp` folder and extract it from there as suggested: #40182 (review) I cannot reproduce this on earlier Node.js versions. More context: #39321 (comment) Fixes #39321 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
…rcel#40182) `create-next-app` currently cannot extract examples/git repos in Node 18+, because of an issue with `node-tar` (isaacs/node-tar#321). The files are extracted, but an error is thrown that the stream has been prematurely closed. To prevent `create-next-app` from not being able to finish, ~for now, we can swallow this error, and hopefully `node-tar` will be patched soon.~ we can save the tar in the `tmp` folder and extract it from there as suggested: vercel#40182 (review) I cannot reproduce this on earlier Node.js versions. More context: vercel#39321 (comment) Fixes vercel#39321 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
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. |
Verify canary release
Provide environment information
OS: MacOS Monterey 12.5
npm: 8.15.0
Node.js: 18.7.0
Which example does this report relate to?
blog-starter
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
Trouble with first install with
npx create-next-app --example blog-starter
.Error message is this.
Expected Behavior
It worked fine when the Node version was 16.16.0.
In 18.7.0, I think there is a bug around the sample installation.
To Reproduce
OS: MacOS Monterey 12.5
The text was updated successfully, but these errors were encountered: