Javascript 在';附近解析时JSON输入意外结束;。。。0.0“&引用;“橡子球”:';
不幸的是,我在安装react native时遇到问题 安装时出现此错误Javascript 在';附近解析时JSON输入意外结束;。。。0.0“&引用;“橡子球”:';,javascript,json,reactjs,react-native,Javascript,Json,Reactjs,React Native,不幸的是,我在安装react native时遇到问题 安装时出现此错误 Unexpected end of JSON input while parsing near '...0.0","acorn-globals":' 我认为问题在于一个叫做jest的东西,因为当我尝试只安装jest时, 我也犯了同样的错误,我不知道开什么玩笑,我才刚刚开始学习 以下是日志文件: 393 verbose stack SyntaxError: Unexpected end of JSON input while
Unexpected end of JSON input while parsing near '...0.0","acorn-globals":'
我认为问题在于一个叫做jest的东西,因为当我尝试只安装jest时,
我也犯了同样的错误,我不知道开什么玩笑,我才刚刚开始学习
以下是日志文件:
393 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...0.0","acorn-globals":'
393 verbose stack at JSON.parse (<anonymous>)
393 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\node_modules\json-parse-better-errors\index.js:7:17)
393 verbose stack at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\body.js:96:50)
393 verbose stack at process._tickCallback (internal/process/next_tick.js:68:7)
394 verbose cwd D:\Dev\React-Native\Sektorian
395 verbose Windows_NT 10.0.16299
396 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "jest" "babel-jest" "babel-preset-react-native" "react-test-renderer@16.3.1" "--save-dev" "--save-exact"
393详细堆栈语法错误:在“…0.0”、“acorn globals”附近解析时JSON输入意外结束:
393 JSON.parse()处的详细堆栈
393 parseJson的详细堆栈(C:\Program Files\nodejs\node\u modules\npm\node\u modules\pacote\node\u modules\make fetch\node\u modules\node fetch npm\node\u modules\json parse better errors\index.js:7:17)
393 consumerbody.call.then.buffer上的详细堆栈(C:\Program Files\nodejs\node\U modules\npm\node\U modules\pacote\node\U modules\make fetch Occess\node\U modules\node fetch npm\src\body.js:96:50)
393进程处的详细堆栈。_tickCallback(internal/process/next_tick.js:68:7)
394详细cwd:\Dev\React Native\Sektorian
395详细窗口\u NT 10.0.16299
396详细argv“C:\\Program Files\\nodejs\\node.exe”“C:\\Program Files\\nodejs\\node\u modules\\npm\\bin\\npm cli.js”“install”“jest”“babel jest”“babel preset react native”“react测试-renderer@16.3.1“”--save dev”“--save exact”
您认为问题出在哪里?似乎与NPM相关的错误,您可以尝试通过以下方式解决:
- 清除NPM的缓存
NPM缓存清理
- 删除节点模块
- 使用
重新安装依赖项npm install
npm cache clean --force
然后我卸载了所需的软件包:
sudo npm uninstall -g create-react-app
然后用--save标志重新安装,这似乎解决了问题:
sudo install -g create-react-app --save
希望有帮助!祝您编码愉快!删除node_modules文件夹,转到package.json所在的目录并启动命令npm安装