程序包依赖性@ vue / eslint-config-standard @ ^ 3.0.1的奇怪@ vue-cli 3错误

时间:2018-08-16 18:16:43

标签: npm vue-cli

很难不加评论地将其保留在此处-但我刚刚升级到@ vue-cli的最新版本,并且收到以下错误:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @vue/eslint-config-standard@^3.0.1
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

在nam网站上查找-eslint-config-standard v3.0.1或更高版本还不存在!?

有关详细信息:

vue-cli v3.0.1 ,npm v6.4.0 和节点 v8.11.3

我的项目应用程序配置为:

? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, PWA, Vuex, CSS Pre-processors, Linter, Unit, E2E
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): SCSS/SASS
? Pick a linter / formatter config: Prettier
? Pick additional lint features: Lint on save
? Pick a unit testing solution: Mocha
? Pick a E2E testing solution: Cypress
? Where do you prefer placing config for Babel, PostCSS, ESLint, etc.? In package.json

1 个答案:

答案 0 :(得分:0)

您的package.json应该是这样的:

这是我的配置文件:

  • package.json
"devDependencies": {
    "@vue/cli-plugin-babel": "^3.0.4",
    "@vue/cli-plugin-eslint": "^3.0.4",
    "@vue/cli-service": "^3.0.4",
    "@vue/eslint-config-standard": "^4.0.0",

    "node-sass": "^4.9.0",
    "postcss-px2rem": "^0.3.0",
    "sass-loader": "^7.0.1",
    "stylus": "^0.54.5",
    "stylus-loader": "^3.0.2",
    "vue-cli-plugin-cube-ui": "^0.2.4",
    "vue-template-compiler": "^2.5.21"
  },
……
  • .eslintrc.js
module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: ["plugin:vue/essential", "@vue/standard"],
  rules: {
    "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
    "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
    "space-before-function-paren": 0,
    indent: 0
  },
  parserOptions: {
    parser: "babel-eslint"
  }
};

我还删除了node_modulespackage-lock.json文件。

最后,npm install

希望,可以为您提供帮助。

  

@vue/eslint-config-standard配置是专门为vue-cli设置使用而设计的,并不供外部使用。您无需进行额外的配置。