3

今天无法在我的任何项目上运行 snyk,到处都出现相同的错误。

snyk test --strict-out-of-sync=false结果是:

Dependency fsevents was not found in package-lock.json. Your package.json and package-lock.json are probably out of sync. Please run "npm install" and try again.

npm install 并且npm install什么npm i --package-lock-only也不做

FSEvents 甚至不是 package.json 中的要求

package.json 的相关部分:

  "dependencies": {
    "bcrypt": "^5.0.1",
    "cookie-parser": "^1.4.5",
    "cors": "^2.8.5",
    "csurf": "^1.11.0",
    "debug": "~4.3.1",
    "express": "~4.17.1",
    "express-handlebars": "^5.3.0",
    "express-rate-limit": "^5.2.6",
    "helmet": "^4.4.1",
    "morgan": "~1.10.0",
    "mysql2": "^2.2.5",
    "node-cron": "^3.0.0",
    "node-fetch": "^2.6.1",
    "nodemailer": "^6.5.0",
    "redis": "^3.1.0",
    "sequelize": "^6.6.2",
    "sequelize-cli": "^6.2.0",
    "uuid": "^8.3.2",
    "winston": "^3.3.3"
  },
  "devDependencies": {
    "app-root-path": "^3.0.0",
    "babel-eslint": "^10.1.0",
    "chai": "^4.3.4",
    "chai-http": "^4.3.0",
    "eslint": "^7.23.0",
    "express-openapi-validate": "^0.5.1",
    "js-yaml": "^4.0.0",
    "jsdoc": "^3.6.6",
    "mocha": "^8.3.2",
    "nyc": "^15.1.0",
    "openapi-types": "^7.2.3",
    "sinon": "^10.0.0",
    "snyk": "^1.526.0",
    "swagger-jsdoc": "^6.1.0",
    "winston-syslog": "^2.4.4"
  }
}
4

1 回答 1

1

我希望你已经解决了这个问题,但是发现这个线程有同样的问题,所以如果以后有人发现它就发布。

fsevents可能是您的某些其他依赖项的传递依赖项,请检查 package-lock.json 中的哪个。它是一个仅用于访问文件系统事件的 MacOS (darwin) 软件包。

我通过运行让它工作

npm upgrade

在再次运行 snyk 之前。

于 2021-11-17T14:01:19.960 回答