slanatech / swagger-stats

API Observability. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices.
https://swaggerstats.io/
MIT License
893 stars 137 forks source link

Is it related to the latest version? #243

Closed xyy7260 closed 1 year ago

xyy7260 commented 1 year ago

I use "swagger-stats": "^0.99.2", View package.json shows "version": "0.99.5",

image

Is it related to the latest version?

my package.json

  "dependencies": {
    "accesscontrol": "^2.2.1",
    "acl": "^0.4.11",
    "ali-oss": "^6.17.1",
    "async": "^3.2.0",
    "bcryptjs": "^2.4.3",
    "body-parser": "^1.19.0",
    "compressing": "^1.6.2",
    "connect-mongo": "^3.2.0",
    "connect-timeout": "^1.9.0",
    "cookie-parser": "^1.4.5",
    "crypto": "^1.0.1",
    "csv-parse": "^4.10.1",
    "elasticsearch": "^15.5.0",
    "esm": "^3.2.25",
    "express": "^4.17.1",
    "express-history-api-fallback": "^2.2.1",
    "express-list-endpoints": "^4.0.1",
    "express-session": "^1.17.1",
    "format-json": "^1.0.3",
    "fs": "0.0.1-security",
    "get-json": "^1.0.1",
    "https": "^1.0.0",
    "jsonschema": "^1.2.6",
    "jsonwebtoken": "^8.5.1",
    "lodash": "^4.17.15",
    "logform": "^2.1.2",
    "minimist": "^1.2.5",
    "minimist-options": "^4.1.0",
    "mongoose": "^5.9.16",
    "mongoose-autopopulate": "^0.12.2",
    "multer": "^1.4.2",
    "mustache-express": "^1.3.0",
    "mysql": "^2.18.1",
    "node-fetch": "^2.6.7",
    "node-yaml-config": "0.0.6",
    "nodejs-base64": "^1.0.3",
    "nodemailer": "^6.4.11",
    "passport": "^0.4.1",
    "passport-http": "^0.3.0",
    "passport-local": "^1.0.0",
    "prom-client": "^13.1.0",
    "request": "^2.88.2",
    "swagger-stats": "^0.99.2",
    "triple-beam": "^1.3.0",
    "uid-safe": "^2.1.5",
    "winston": "^3.2.1",
    "winston-daily-rotate-file": "^4.4.2",
    "xlsx": "^0.16.1"
  },
/Users/Shared/Previously Relocated Items/Security/web/易得医数/edoc/server/node_modules/swagger-stats/lib/swsElasticEmitter.js:1

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/Shared/Previously Relocated Items/Security/web/易得医数/edoc/server/node_modules/swagger-stats/node
_modules/axios/index.js not supported.
Instead change the require of index.js in null to a dynamic import() which is available in all CommonJS modules.

    at Object.<anonymous> (/Users/Shared/Previously Relocated Items/Security/web/易得医数/edoc/server/node_modules/swagger-stats/lib/swsElasticEmitter
.js:13:15)
sv2 commented 1 year ago

Yes, in latest version there was a change to use Axios. Do you happen to have "type": "module" in your package.json ?

xyy7260 commented 1 year ago

Yes, in latest version there was a change to use Axios. Do you happen to have "type": "module" in your package.json ?

no,

but I add "type": "module" extra error

xyy7260 commented 1 year ago

"swagger-stats": "^0.99.2",

"swagger-stats": "^0.95.19", OK