程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了使用 npx create-react-app大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决使用 npx create-react-app?

开发过程中遇到使用 npx create-react-app的问题如何解决?下面主要结合日常开发的经验,给出你关于使用 npx create-react-app的解决方法建议,希望对你解决使用 npx create-react-app有所启发或帮助;

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

解决方法

我通常做的是说我希望我的项目被称为“我的应用程序”我创建一个文件夹“我的应用程序”在我的终端中打开它然后输入 npx create-react-app ./ 我不确定这是最好的解决方案,但也许可以尝试一下,看看它是否有效

,

输入 powersHell npm install -g create-react-app 然后输入 create-react-app todos-listenter image description here

大佬总结

以上是大佬教程为你收集整理的使用 npx create-react-app全部内容,希望文章能够帮你解决使用 npx create-react-app所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:npx使用