是否可以粘贴19小时前的Lock.json包以修复验证错误:进度插件无效选项(第3版)?

我正在使用Vue 3,并在19小时前将我的项目的一个运行良好的版本推送到GitHub。

大约5小时后,当我输入npm run serve时出现以下问题,导致以下信息行:

> zagnetic@0.1.0 serve

> vue-cli-service serve

INFO Starting development server...

然后显示以下错误:

ValidationError: Progress Plugin Invalid Options

options should NOT have additional properties
options should NOT have additional properties
options should NOT have additional properties
options should pass "instanceof" keyword validation
options should match exactly one schema in oneOf

    at validateOptions (/Users/mgav/zagnetic_vue/zagnetic/node_modules/webpack/node_modules/schema-utils/src/validateOptions.js:32:11)
    at new ProgressPlugin (/Users/mgav/zagnetic_vue/zagnetic/node_modules/webpack/lib/ProgressPlugin.js:62:3)
    at new Progress (/Users/mgav/zagnetic_vue/zagnetic/node_modules/progress-webpack-plugin/index.js:25:21)
    at new progressPlugin (/Users/mgav/zagnetic_vue/zagnetic/node_modules/progress-webpack-plugin/index.js:127:10)
    at /Users/mgav/zagnetic_vue/zagnetic/node_modules/webpack-chain/src/Plugin.js:14:18
    at Object.toConfig (/Users/mgav/zagnetic_vue/zagnetic/node_modules/webpack-chain/src/Plugin.js:78:22)
    at /Users/mgav/zagnetic_vue/zagnetic/node_modules/webpack-chain/src/Config.js:129:63
    at Array.map (<anonymous>)
    at module.exports.toConfig (/Users/mgav/zagnetic_vue/zagnetic/node_modules/webpack-chain/src/Config.js:129:40)
    at Service.resolveWebpackConfig (/Users/mgav/zagnetic_vue/zagnetic/node_modules/@vue/cli-service/lib/Service.js:261:34)

由于Package-Lock.json在错误发生期间的几个小时内发生了大量更改(但Package.json保持100%不变),是否可以仅将19小时前的Package-Lock.json文件粘贴到当前文件上以修复问题?

这样做有危险吗?

我的工作几乎完全是css,但在错误发生后,我做了一些基本的事情,比如npm cache clean --force,这可能导致了Package-Lock.json的一些差异。

Package-lock.json太大,无法发布,但这里是我的Package.json(与正在工作的推送到GitHub版本和当前(未推送)版本相同,但错误为:

{
  "name": "zagnetic",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build"
  },
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^1.2.36",
    "@fortawesome/free-brands-svg-icons": "^5.15.4",
    "@fortawesome/free-regular-svg-icons": "^5.15.4",
    "@fortawesome/free-solid-svg-icons": "^5.15.4",
    "@fortawesome/vue-fontawesome": "^3.0.0-4",
    "@headlessui/vue": "^1.4.1",
    "@tailwindcss/forms": "^0.3.3",
    "@tailwindcss/typography": "^0.4.1",
    "@vue/cli": "^5.0.0-beta.3",
    "core-js": "^3.6.5",
    "date-fns": "^2.23.0",
    "firebase": "^8.9.0",
    "tailwindcss": "^2.2.14",
    "vue": "^3.0.0",
    "vue-router": "^4.0.0-0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^5.0.0-beta.3",
    "@vue/cli-plugin-router": "^5.0.0-beta.3",
    "@vue/cli-service": "^5.0.0-beta.3",
    "@vue/compiler-sfc": "^3.2.11",
    "autoprefixer": "^10.3.4",
    "postcss": "^8.3.6",
    "postcss-cli": "^8.3.1"
  }
}

我已经使用"^5.0.0-beta.3"快一周了,没有任何问题,所以我认为这不是问题所在。

非常感谢您的帮助!


解决方案

在尝试恢复到较旧的包lock.json之前,我在终端中运行了npm update,现在一切正常!

我不会将其标记为正确答案,即使它已修复了根本问题,因为它实际上并没有解决所提出的问题(&q;是否可以恢复到较早版本的Package-lock.json,而不会造成损害?&q;)。

相关文章