Unable to create a new create-react-app
Created by: grantspilsbury
I am trying to create a new create-react-app project. I can run other yarn and npm commands such as yarn add axios
or npm install axios
or npm init
and it works. But does not work if I run the create react app commands eg yarn create react-app my-app
and npm init react-app my-app
and npx create-react-app my-app
.
If I run yarn create react-app my-app
it logs
yarn create v1.22.19
[1/4] 🔍 Resolving packages...
warning create-react-app > tar-pack > tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
[2/4] 🚚 Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: https://registry.yarnpkg.com/tar/-/tar-2.2.2.tgz: aborted.
info If you think this is a bug, please open a bug report with the information provided in "/Users/grant./.config/yarn/global/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
This is the output in the bug report "/Users/grant./.config/yarn/global/yarn-error.log".
Arguments:
/Users/grant./.nvm/versions/node/v18.13.0/bin/node /Users/grant./.nvm/versions/node/v18.13.0/bin/yarn create react-app my-app
PATH:
/Users/grant./.nvm/versions/node/v18.13.0/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
Yarn version:
1.22.19
Node version:
18.13.0
Platform:
darwin x64
Trace:
Error: aborted
at connResetException (node:internal/errors:718:14)
at TLSSocket.socketCloseListener (node:_http_client:456:19)
at TLSSocket.emit (node:events:525:35)
at node:net:320:12
at TCP.done (node:_tls_wrap:588:7)
npm manifest:
{
"dependencies": {
"create-next-app": "^13.1.5"
}
}
yarn manifest:
No manifest
Lockfile:
No lockfile
If I run npm init create-react-app my-app
it logs the following to the console
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
npm ERR! code ECONNRESET
npm ERR! network aborted
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/grant./.npm/_logs/2023-01-27T00_51_43_117Z-debug-0.log
This is the output in the bug report “Users/grant./.npm/_logs/2023-01-27T00_51_43_117Z-debug-0.log”
…
373 silly audit
373 silly audit For more information see this blog post: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
374 timing reifyNode:node_modules/tar-pack Completed in 167ms
375 timing reifyNode:node_modules/through2/node_modules/readable-stream Completed in 169ms
376 timing reifyNode:node_modules/debug Completed in 170ms
377 timing reifyNode:node_modules/readable-stream Completed in 171ms
378 timing reifyNode:node_modules/hyperquest Completed in 173ms
379 timing reifyNode:node_modules/fstream Completed in 179ms
380 timing reifyNode:node_modules/minimist Completed in 180ms
381 timing reifyNode:node_modules/tar-pack/node_modules/readable-stream Completed in 183ms
382 timing reifyNode:node_modules/fs-extra Completed in 194ms
383 timing reifyNode:node_modules/semver Completed in 195ms
384 timing reifyNode:node_modules/prompts Completed in 199ms
385 notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
386 http fetch POST 426 http://registry.npmjs.org/-/npm/v1/security/audits/quick 150ms
387 verbose audit error HttpErrorGeneral: 426 Upgrade Required - POST http://registry.npmjs.org/-/npm/v1/security/audits/quick
387 verbose audit error at /Users/grant./.nvm/versions/node/v18.13.0/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:95:15
387 verbose audit error at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
387 verbose audit error at async [getReport] (/Users/grant./.nvm/versions/node/v18.13.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js:335:21)
387 verbose audit error at async AuditReport.run (/Users/grant./.nvm/versions/node/v18.13.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js:106:19) {
387 verbose audit error headers: [Object: null prototype] {
387 verbose audit error date: [ 'Fri, 27 Jan 2023 00:52:26 GMT' ],
387 verbose audit error 'content-type': [ 'text/plain' ],
387 verbose audit error 'content-length': [ '271' ],
387 verbose audit error connection: [ 'keep-alive' ],
387 verbose audit error 'npm-notice': [
387 verbose audit error 'Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/'
387 verbose audit error ],
387 verbose audit error vary: [ 'Accept-Encoding' ],
387 verbose audit error server: [ 'cloudflare' ],
387 verbose audit error 'cf-ray': [ '78fd816fa9cc5ab4-MEL' ],
387 verbose audit error via: [ 'HTTP/1.1 m_proxy_mel1' ],
387 verbose audit error 'x-fetch-attempts': [ '1' ]
387 verbose audit error },
387 verbose audit error statusCode: 426,
387 verbose audit error code: 'E426',
387 verbose audit error method: 'POST',
387 verbose audit error uri: 'http://registry.npmjs.org/-/npm/v1/security/audits/quick',
387 verbose audit error body: <Buffer 42 65 67 69 6e 6e 69 6e 67 20 4f 63 74 6f 62 65 72 20 34 2c 20 32 30 32 31 2c 20 61 6c 6c 20 63 6f 6e 6e 65 63 74 69 6f 6e 73 20 74 6f 20 6e 70 6d 20 ... 221 more bytes>,
387 verbose audit error pkgid: undefined
387 verbose audit error }
388 silly audit error Beginning October 4, 2021, all connections to npm websites and the npm registry - including for package installation - must use HTTPS and TLS 1.2 or higher.
388 silly audit error
388 silly audit error For more information see this blog post: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
389 timing auditReport:getReport Completed in 325ms
390 silly audit report null
391 timing reify:audit Completed in 325ms
392 verbose stack Error: aborted
392 verbose stack at connResetException (node:internal/errors:718:14)
392 verbose stack at TLSSocket.socketCloseListener (node:_http_client:456:19)
392 verbose stack at TLSSocket.emit (node:events:525:35)
392 verbose stack at node:net:320:12
392 verbose stack at TCP.done (node:_tls_wrap:588:7)
393 verbose cwd /Users/grant./Documents/Repos/test
394 verbose Darwin 22.2.0
395 verbose node v18.13.0
396 verbose npm v9.4.0
397 error code ECONNRESET
398 error network aborted
399 error network This is a problem related to network connectivity.
399 error network In most cases you are behind a proxy or have bad network settings.
399 error network
399 error network If you are behind a proxy, please make sure that the
399 error network 'proxy' config is set properly. See: 'npm help config'
400 verbose exit 1
401 timing npm Completed in 43344ms
402 verbose unfinished npm timer command:init 1674780703163
403 verbose unfinished npm timer reify 1674780735103
404 verbose unfinished npm timer reify:unpack 1674780745902
405 verbose unfinished npm timer reifyNode:node_modules/tar 1674780745904
406 verbose unfinished npm timer reify:rollback:createSparse 1674780746457
407 verbose code 1
408 error A complete log of this run can be found in:
408 error /Users/grant./.npm/_logs/2023-01-27T00_51_43_117Z-debug-0.log
If I run npx create-react-app my-app it logs the following to the console
node:internal/modules/cjs/loader:1042
throw err;
^
Error: Cannot find module 'has-flag'
Require stack:
- /Users/grant./.npm/_npx/c67e74de0542c87c/node_modules/chalk/node_modules/supports-color/index.js
- /Users/grant./.npm/_npx/c67e74de0542c87c/node_modules/chalk/source/index.js
- /Users/grant./.npm/_npx/c67e74de0542c87c/node_modules/create-react-app/createReactApp.js
- /Users/grant./.npm/_npx/c67e74de0542c87c/node_modules/create-react-app/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
at Module._load (node:internal/modules/cjs/loader:885:27)
at Module.require (node:internal/modules/cjs/loader:1105:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (/Users/grant./.npm/_npx/c67e74de0542c87c/node_modules/chalk/node_modules/supports-color/index.js:4:17)
at Module._compile (node:internal/modules/cjs/loader:1218:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
at Module.load (node:internal/modules/cjs/loader:1081:32)
at Module._load (node:internal/modules/cjs/loader:922:12)
at Module.require (node:internal/modules/cjs/loader:1105:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/grant./.npm/_npx/c67e74de0542c87c/node_modules/chalk/node_modules/supports-color/index.js',
'/Users/grant./.npm/_npx/c67e74de0542c87c/node_modules/chalk/source/index.js',
'/Users/grant./.npm/_npx/c67e74de0542c87c/node_modules/create-react-app/createReactApp.js',
'/Users/grant./.npm/_npx/c67e74de0542c87c/node_modules/create-react-app/index.js'
]
}
Node.js v18.13.0
Node.js v18.13.0 npm --version 9.4.0
I have tried: clearing the yarn / npm cache
npm config set registry=https://registry.npmjs.com/
npm cache verify
yarn install --network-timeout 1000000
npm uninstall -g create-react-app
npm install -g create-react-app -d
`yarn config get proxy`
undefined
yarn config get https-proxy
undefined