【发布时间】:2021-06-04 17:14:12
【问题描述】:
error messages when running npx create-react-app
当尝试使用 create-react-app 生成器创建新的 react 应用程序时,我似乎遇到了这个下载错误。不知道如何解决它。我以前多次使用 npx create-react-app ,但最近它已经停止工作。有什么建议吗?
Andrewcarey@Andrews-MacBook-Air Strangers_Things % npx create-react-app my-app
internal/modules/cjs/loader.js:311
throw err;
^
Error: Cannot find module '/Users/andrewcarey/.npm/_npx/c67e74de0542c87c/node_modules/brace-expansion/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:303:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:516:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/Users/andrewcarey/.npm/_npx/c67e74de0542c87c/node_modules/minimatch/minimatch.js:10:14)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32) {
code: 'MODULE_NOT_FOUND',
path: '/Users/andrewcarey/.npm/_npx/c67e74de0542c87c/node_modules/brace-expansion/package.json',
requestPath: 'brace-expansion'
}
npm ERR! code 1
npm ERR! path /Users/andrewcarey/Desktop/Strangers_Things
npm ERR! command failed
npm ERR! command sh -c create-react-app "my-app"
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/andrewcarey/.npm/_logs/2021-06-01T00_36_33_693Z-debug.log
【问题讨论】:
-
你机器上的 node 和 npm 版本是什么?您需要在您的机器上安装 Node >= 10.16 和 npm >= 5.6。