我意外刪除了我的node_modules
文件夾。我知道恢復它的方法只是運行npm install
,但這不適用於我的情況。這是說我的JSON
文件有問題。我在Terminal
中收到此錯誤。無意中刪除了node_modules文件夾
這是我的Package.js
文件:
{
"name": "App",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"aws-sdk": "git://github.com/aws/aws-sdk-js.git#react-native",
"react": "^16.0.0-alpha.12",
"react-native": "^0.45.1",
"react-native-aws-signature": "0.0.9",
"react-native-dropdown-menu": "^1.1.0",
"react-native-dynamodb": "0.0.5",
"react-redux": "^5.0.5",
"redux": "^3.7.1"
},
"devDependencies": {
"babel-jest": "20.0.3",
"babel-preset-react-native": "2.0.0",
"jest": "20.0.4",
"react-test-renderer": "16.0.0-alpha.12"
},
"jest": {
"preset": "react-native"
},
}
錯誤:
Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! Please include the following file with any support request: