我的 sequelize-auto 命令执行抛出错误 "Please install tedious package manually"

My sequelize-auto command execution throws error "Please install tedious package manually"

我的 SQL 服务器数据库中的表太多,我的应用程序使用 sequelize ORM of node.js。 我发现有一种方法可以搭建我的数据库模型,它是 sequelize-auto 命令。

所以我创建了一个命令并 运行 它。但它会引发错误!

这是我的 sequelize-auto 命令:

sequelize-auto -h my server_ip_address -d database_name -u username -x mypassword  --dialect mssql -c ./api/config/onlinestore.json -o ./api/models/newScafolded

但是当我 运行 这个命令时它抛出这个错误:

    C:\Users\AMoha\AppData\Roaming\npm\node_modules\sequelize-auto\node_modules\sequelize\lib\dialects\mssql\connection-manager.js:21
        throw new Error('Please install tedious package manually');
        ^

    Error: Please install tedious package manually
        at new ConnectionManager (C:\Users\AMoha\AppData\Roaming\npm\node_modules\sequelize-auto\node_modules\sequelize\lib\dialects\mssql\connection-manager.js:21:13)
        at new MssqlDialect (C:\Users\AMoha\AppData\Roaming\npm\node_modules\sequelize-auto\node_modules\sequelize\lib\dialects\mssql\index.js:12:28)
        at new Sequelize (C:\Users\AMoha\AppData\Roaming\npm\node_modules\sequelize-auto\node_modules\sequelize\lib\sequelize.js:233:18)
        at new AutoSequelize (C:\Users\AMoha\AppData\Roaming\npm\node_modules\sequelize-auto\lib\index.js:19:22)
        at Object.<anonymous> (C:\Users\AMoha\AppData\Roaming\npm\node_modules\sequelize-auto\bin\sequelize-auto:90:12)
        at Module._compile (internal/modules/cjs/loader.js:945:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:962:10)
        at Module.load (internal/modules/cjs/loader.js:798:32)
        at Function.Module._load (internal/modules/cjs/loader.js:711:12)
        at Function.Module.runMain (internal/modules/cjs/loader.js:1014:10)
        at internal/main/run_main_module.js:17:11

我安装和使用了繁琐的包。

这是我的package.json内容:

{
  "name": "onlinestore",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "dev": "babel-watch ./bin/www",
    "start": "node ./bin/www"
  },
  "dependencies": {
    "body-parser": "^1.19.0",
    "braces": "^3.0.2",
    "constantinople": "^4.0.1",
    "cookie-parser": "~1.3.3",
    "cors": "^2.8.5",
    "custom-env": "^1.0.0",
    "debug": "^4.1.0",
    "express": "^4.16.4",
    "express-jwt": "^3.4.0",
    "jade": "~1.9.1",
    "jsonwebtoken": "^5.7.0",
    "lodash": "^4.17.15",
    "mongoose": "^5.8.7",
    "morgan": "^1.9.1",
    "passport": "^0.2.2",
    "passport-local": "^1.0.0",
    "sequelize": "^5.21.5",
    "serve-favicon": "^2.5.0",
    "tedious": "^6.7.0",
    "uglify-js": "^3.4.9"
  },
  "devDependencies": {
    "@babel/cli": "^7.4.4",
    "@babel/core": "^7.4.4",
    "@babel/preset-env": "^7.4.4",
    "babel-watch": "^7.0.0",
    "gulp": "^4.0.0",
    "gulp-concat": "^2.6.0",
    "gulp-ng-annotate": "^1.1.0",
    "gulp-ng-html2js": "^0.2.3",
    "gulp-sourcemaps": "^1.5.2",
    "gulp-uglify": "^1.2.0",
    "gulp-watch": "^5.0.1"
  }
}

你有什么想法?

终于找到解决方法了

我应该在同一个路径下安装 tedious 和 mssql 包。

我 运行 下面的命令,我的问题解决了:

npm install -g mssql tedious

我再次搜索,终于找到了整体解决方案。 用于从数据库自动导出续集模型的 GUI 桌面应用程序。单击 here 看看它会做什么。我用过它并且对我有用。