Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 创建新项目时出错。使用CreateReact应用程序_Node.js_Reactjs_Npm_Npm Install - Fatal编程技术网

Node.js 创建新项目时出错。使用CreateReact应用程序

Node.js 创建新项目时出错。使用CreateReact应用程序,node.js,reactjs,npm,npm-install,Node.js,Reactjs,Npm,Npm Install,我在创建新的React项目时面临问题。 下面是我如何创建react项目的命令 npx create-react-app helloworld 但项目并没有成功创建。 下面是错误的屏幕截图 我在图片中突出显示的区域每次都会发生变化。有时用不同的文件显示此错误。有时会出现下面提到的响应时间错误: 我尝试了以下解决方案: npm配置集注册表=”http://registry.npmjs.org/“ npm缓存清理--强制执行 重新安装node.js 我在这篇文章中附上几行日志文件。请帮我解决

我在创建新的React项目时面临问题。 下面是我如何创建react项目的命令

npx create-react-app helloworld
但项目并没有成功创建。 下面是错误的屏幕截图

我在图片中突出显示的区域每次都会发生变化。有时用不同的文件显示此错误。有时会出现下面提到的响应时间错误:

我尝试了以下解决方案:

  • npm配置集注册表=”http://registry.npmjs.org/“
  • npm缓存清理--强制执行
  • 重新安装node.js
我在这篇文章中附上几行日志文件。请帮我解决这个问题

        0 info it worked if it ends with ok
    1 verbose cli [
    1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
    1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
    1 verbose cli   'install',
    1 verbose cli   '--save',
    1 verbose cli   '--save-exact',
    1 verbose cli   '--loglevel',
    1 verbose cli   'error',
    1 verbose cli   'react',
    1 verbose cli   'react-dom',
    1 verbose cli   'react-scripts',
    1 verbose cli   'cra-template'
    1 verbose cli ]
    2 info using npm@6.14.4
    3 info using node@v12.16.3
    4 verbose npm-session a2a652d86a598482
    5 silly install loadCurrentTree
    6 silly install readLocalPackageData
    7 http fetch GET 304 http://registry.npmjs.org/react 258ms (from cache)
    8 http fetch GET 304 http://registry.npmjs.org/react-dom 258ms (from cache)
    9 http fetch GET 304 http://registry.npmjs.org/react-scripts 265ms (from cache)
    10 silly pacote tag manifest for react@latest fetched in 296ms
    11 silly pacote tag manifest for react-scripts@latest fetched in 281ms
    12 silly pacote tag manifest for react-dom@latest fetched in 283ms
    13 http fetch GET 304 http://registry.npmjs.org/cra-template 281ms (from cache)

26 http fetch GET 304 http://registry.npmjs.org/object-assign 73ms (from cache)
27 http fetch GET 304 http://registry.npmjs.org/loose-envify 74ms (from cache)
28 http fetch GET 304 http://registry.npmjs.org/prop-types 73ms (from cache)
29 silly pacote range manifest for object-assign@^4.1.1 fetched in 77ms
30 silly resolveWithNewModule object-assign@4.1.1 checking installable status
201 silly saveTree `-- react@16.13.1
202 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\react-scripts\node_modules\fsevents):
203 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
204 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
204 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
204 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   win32
204 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
205 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...cript-eslint/parser",'
205 verbose stack     at JSON.parse (<anonymous>)
205 verbose stack     at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
205 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
205 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:97:5)
206 verbose cwd H:\React\helloworld
207 verbose Windows_NT 10.0.18363
208 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "--save-exact" "--loglevel" "error" "react" "react-dom" "react-scripts" "cra-template"
209 verbose node v12.16.3
210 verbose npm  v6.14.4
211 error Unexpected end of JSON input while parsing near '...cript-eslint/parser",'
212 verbose exit [ 1, true ]
0信息如果它以ok结尾,它就工作了
1详细cli[
1详细cli'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli'C:\\Program Files\\nodejs\\node\u modules\\npm\\bin\\npm cli.js',
1详细cli“安装”,
1详细cli'--save',
1详细cli'--保存精确',
1详细cli'--loglevel',
1详细cli“错误”,
1个详细cli“react”,
1详细cli“react dom”,
1详细cli“反应脚本”,
1个详细cli“cra模板”
1详细cli]
2信息使用npm@6.14.4
3信息使用node@v12.16.3
4详细的npm会议a2a652d86a598482
5.安装loadCurrentTree
6.安装readLocalPackageData
7 http获取304http://registry.npmjs.org/react 258ms(来自缓存)
8 http获取304http://registry.npmjs.org/react-dom 258ms(来自缓存)
9 http获取304http://registry.npmjs.org/react-scripts 265ms(来自缓存)
10个愚蠢的pacote标签清单react@latest取得296毫秒的成绩
11 react的愚蠢pacote标签清单-scripts@latest以281ms的速度获取
react的12个愚蠢的pacote标签清单-dom@latest取得283ms
13 http获取304http://registry.npmjs.org/cra-template 281ms(来自缓存)
26 http获取304http://registry.npmjs.org/object-assign 73ms(来自缓存)
27 http获取304http://registry.npmjs.org/loose-envify 74ms(来自缓存)
28 http获取304http://registry.npmjs.org/prop-types 73ms(来自缓存)
29在77毫秒内获取的对象分配@^4.1.1的范围清单
30使用newmodule对象进行解析-assign@4.1.1检查可安装状态
201愚蠢的保存树`--react@16.13.1
202警告可选跳过可选依赖项:fsevents@2.1.2(节点\模块\反应脚本\节点\模块\事件):
203 warn notsup跳过可选依赖项:不支持的平台fsevents@2.1.2:通缉{“os”:“达尔文”,“拱门”:“任何”}(当前:{“os”:“win32”,“拱门”:“x64”})
204详细notsup跳过可选依赖项:有效OS:darwin
204详细notsup跳过可选依赖项:有效Arch:any
204详细notsup跳过可选依赖项:实际操作系统:win32
204详细notsup跳过可选依赖项:实际Arch:x64
205详细堆栈语法错误:在“…script eslint/parser”附近解析时JSON输入意外结束
205 JSON.parse()处的详细堆栈
205 parseJson处的详细堆栈(C:\Program Files\nodejs\node\u modules\npm\node\u modules\json parse better errors\index.js:7:17)
205位于C:\Program Files\nodejs\node\u modules\npm\node\u modules\node fetch npm\src\body.js的详细堆栈:96:50
205 processTicksAndRejections的详细堆栈(internal/process/task_queues.js:97:5)
206详细cwd H:\React\helloworld
207详细窗口\u NT 10.0.18363
208详细argv“C:\\Program Files\\nodejs\\node.exe”“C:\\Program Files\\nodejs\\node\U模块\\npm\\bin\\npm cli.js”“安装”“--save”“--save exact”“--loglevel”“错误”“反应”“反应”“反应dom”“反应脚本”“cra模板”
209详细节点v12.16.3
210详细的npm v6.14.4
211在“…script eslint/parser”附近进行分析时,JSON输入意外结束,出现错误
212详细退出[1,true]

尝试手动删除位于
C:\Users\Shoaib\AppData\Roaming\NPM\u缓存的NPM缓存
尝试手动删除位于
C:\Users\Shoaib\AppData\Roaming\NPM\u缓存的NPM缓存