next-learn: Could not locate the repository
I keep running into a “Could not locate the repository” error when following the instructions at https://nextjs.org/learn/basics/create-nextjs-app/setup
npx: installed 1 in 2.349s
Could not locate the repository for "https://github.com/vercel/next-learn/tree/master/basics/learn-starter". Please check that the repository exists and try again.
Instructions say to check https://github.com/vercel/next-learn/blob/master/basics/errors/install.md but there’s not much detail there and the commands are a bit different. I followed the text based instructions there (not the specific command) and removed everything past the project name which was then “Successful” but when starting the app it quickly failed for other reasons:
Installing dependencies:
- react
- react-dom
- next
+ react@17.0.2
+ react-dom@17.0.2
+ next@12.0.7
added 243 packages from 223 contributors and audited 255 packages in 44.584s
found 0 vulnerabilities
Installing devDependencies:
- eslint
- eslint-config-next
> core-js-pure@3.20.2 postinstall C:\code\nextjs-blog\node_modules\core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
+ eslint@8.6.0
+ eslint-config-next@12.0.7
added 170 packages from 100 contributors and audited 425 packages in 34.247s
found 0 vulnerabilities
Initialized a git repository.
Success! Created nextjs-blog at C:\code\nextjs-blog
started server on 0.0.0.0:3000, url: http://localhost:3000
(node:19500) UnhandledPromiseRejectionWarning: ReferenceError: TextEncoder is not defined
at C:\code\nextjs-blog\node_modules\next\dist\compiled\react-server-dom-webpack\cjs\react-server-dom-webpack-writer.browser.development.server.js:67:19
at Object.<anonymous> (C:\code\nextjs-blog\node_modules\next\dist\compiled\react-server-dom-webpack\cjs\react-server-dom-webpack-writer.browser.development.server.js:900:5)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\code\nextjs-blog\node_modules\next\dist\compiled\react-server-dom-webpack\writer.browser.server.js:6:20)
(node:19500) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:19500) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
error - Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error
Error: Not supported
at Object.loadConfig [as default] (C:\code\nextjs-blog\node_modules\next\dist\server\config.js:399:74)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nextjs-blog@ dev: `next dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nextjs-blog@ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 32
I succeeded by turning off the VPN. Switching the network environment may be one of the solutions.
The master branch no longer exists, so try the main branch instead.
npx create-next-app nextjs-blog --use-npm --example "https://github.com/vercel/next-learn/tree/main/basics/learn-starter"I’ve met same issues. Here’s my solution:
npm run dev, it worked well.Updated node to latest with
nvm install nodeand it worked.Updated node to 18.19.0 and it worked.
In case others find this thread in the future…ran into the reported issue as well. Issue persisted while running node v16.15.0 but was finally able to create the next app using the example template with node v18.19.0.
the app init command
npx create-next-app nextjs-blog --use-npm --example "https://github.com/vercel/next-learn/tree/master/basics/learn-starter"still results in the same error as before Could not locate the repository for “https://github.com/vercel/next-learn/tree/master/basics/learn-starter”. Please check that the repository exists and try again. Starting a project without example template usingnpx create-next-app next-blogworks fine but of course that doesn’t make use of the template.Apparently this issue is back again. Which is not exactly a big deal since we can just use the executable and follow the prompts, but it’s not really a good thing when the official documentation points to commands that don’t work.