首页 > 解决方案 > 原子中的 Npm 安装集会编码 eslint 不起作用

问题描述

我已经在 atom 中安装了 linter 和 linter-eslint 插件。但是安装 eslint rallycoding 会带来麻烦。可能是什么问题,我无法弄清楚。

以下是错误信息:

E:\zreactNative\test\ReduxTest>npm install --save-dev eslint-config-rallycoding
npm WARN deprecated eslint-plugin-class-property@1.1.0: please use eslint-plugin-babel and babel/semi
npm ERR! Unexpected end of JSON input while parsing near '...2.0","esutils":"^2.0.'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\bbeck\AppData\Roaming\npm-cache\_logs\2018-09-25T07_13_26_749Z-debug.log

2018-09-25T07_13_26_749Z-debug.log

包.json:

{
  "name": "ReduxTest",
  "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-native-elements": "^0.19.1",
    "react-native-vector-icons": "^5.0.0",
    "react-redux": "^5.0.7",
    "redux": "^4.0.0"
  },
  "devDependencies": {
    "babel-jest": "23.4.2",
    "babel-preset-react-native": "4.0.0",
    "eslint-plugin-babel": "^5.2.0",
    "jest": "23.5.0",
    "react-test-renderer": "16.3.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

标签: react-nativeatom-editoreslint

解决方案


解决了。这是 npm 的问题。npm cache clean --force 可以解决问题。


推荐阅读