首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法通过npm安装安装react脚本

无法通过npm安装安装react脚本
EN

Stack Overflow用户
提问于 2021-02-05 11:00:14
回答 1查看 593关注 0票数 0

我是节点和react的新手,在创建应用程序时,我尝试使用npx创建- react app示例创建一个new应用程序,npm正在尝试安装new script模块并出现以下错误:

代码语言:javascript
运行
复制
4967 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\react-scripts\node_modules\watchpack-chokidar2\node_modules\chokidar\node_modules\fsevents):
4968 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
4969 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
4969 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
4969 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   win32
4969 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
4970 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\react-scripts\node_modules\webpack-dev-server\node_modules\chokidar\node_modules\fsevents):
4971 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
4972 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
4972 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
4972 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   win32
4972 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
4973 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...rollup-1.12.5.tgz","f'
4973 verbose stack     at JSON.parse (<anonymous>)
4973 verbose stack     at parseJson (C:\Software\node-v12.13.1-win-x64\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
4973 verbose stack     at C:\Software\node-v12.13.1-win-x64\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
4973 verbose stack     at runMicrotasks (<anonymous>)
4973 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:93:5)
4974 verbose cwd C:\Personal\Learning\react
4975 verbose Windows_NT 10.0.19042
4976 verbose argv "C:\\Software\\node-v12.13.1-win-x64\\node.exe" "C:\\Software\\node-v12.13.1-win-x64\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "react-scripts"
4977 verbose node v12.13.1
4978 verbose npm  v6.12.1
4979 error Unexpected end of JSON input while parsing near '...rollup-1.12.5.tgz","f'
4980 verbose exit [ 1, true ]

我在google上搜索错误,我找不到解决方案,我已经采取了一些步骤来解决这个问题。

globally

  • removed
  1. 试图在npm配置中安装react脚本,并尝试安装

所有这些都不起作用

EN

Stack Overflow用户

发布于 2021-02-05 11:20:47

我建议升级您的node.js,然后再次尝试npm安装:

代码语言:javascript
运行
复制
npm cache clean -f
npm install -g n
n stable
npm install
票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66062051

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档