【发布时间】:2018-12-12 11:55:51
【问题描述】:
我正在尝试使用official document 在我的 React-Native 项目中设置/安装 Native-Base。但是每次都会出错。
命令: npm install native-base --save
错误:
npm 错误!在“...yish/-/is-arrayish-0”附近解析时 JSON 输入意外结束。
npm 错误!可以在以下位置找到此运行的完整日志:
npm 错误! /home/abhijitsrivastava/.npm/_logs/2018-07-04T06_03_24_057Z-debug.log
系统规格:
node --version
v8.1.0
npm --version
6.0.0
react-native --version
react-native-cli: 2.0.1
react-native: 0.55.4
Machine: Ubuntu 16.04LTS
IDE: Visual Studio Code Version 1.23.0
根据compatibility 矩阵,一切正常。不知道怎么解决。
更新:
这是我的 package.json 文件。
{
"name": "xyz",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.3.1",
"react-native": "^0.55.4",
"react-navigation": "^2.3.1",
"redux": "^4.0.0"
},
"devDependencies": {
"babel-jest": "23.0.1",
"babel-preset-react-native": "4.0.0",
"jest": "23.1.0",
"react-test-renderer": "16.3.1"
},
"jest": {
"preset": "react-native"
}
}
【问题讨论】:
标签: node.js react-native npm visual-studio-code native-base