node.js - sequelize-auto 找不到模块“续集”
问题描述
我目前正在开发一个带有 node、react 和 express 的 web 应用程序。我想尝试使用 sequelize-auto 库来测试它是否真的可以为我生成一个模型,所以我不需要输入那么多,也不需要以后多用。但是,我有一个问题,它说即使它在那里也找不到续集。我什至用它来获取我的数据并将其显示在正在工作的屏幕上。这是我的 package.json:
{
"name": "db-app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@reduxjs/toolkit": "^1.5.0",
"auto": "^10.16.0",
"axios": "^0.21.1",
"bootstrap": "^4.6.0",
"cassandra-driver": "^4.6.1",
"cors": "^2.8.5",
"express": "^4.17.1",
"express-validator": "^6.9.2",
"got": "^11.8.1",
"materialize-css": "^1.0.0",
"mssql": "^6.3.1",
"mysql": "^2.18.1",
"mysql2": "^2.2.5",
"mysqljs": "0.0.2-security",
"react": "^17.0.1",
"react-bootstrap": "^1.4.3",
"react-materialize": "^3.9.6",
"react-redux": "^7.2.2",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"request": "^2.88.2",
"sequelize": "^6.5.0",
"sequelize-auto": "^0.7.10",
"tedious": "^9.2.3",
"tedious-connection-pool": "^1.0.5"
},
"devDependencies": {
"redux-devtools": "^3.7.0"
}
}
和我的命令:
sequelize-auto -o "./models" -d Information -h localhost -u secret -p 5000 -x secret# -e tedious -t Information
如果需要更多信息,请告诉我。我觉得即使我现在不使用它也可能非常有用。
解决方案
您可以在命令中将“sequelize-auto”替换为“node_modules/sequelize-auto/bin/sequelize-auto”。命令应如下所示:
node_modules/sequelize-auto/bin/sequelize-auto -o "./models" -d Information -h localhost -u secret -p 5000 -x secret# -e tedious -t Information
如果您已经npx
安装(检查which npx
),您不必费心在 node_modules 中调用二进制“隐藏”。它能够查找二进制文件本身:npx sequelize-auto ..
推荐阅读
- regex - 如何在正则表达式中区分具有相同格式的捕获组
- haskell - 在 Haskell 服务端中进行客户端绑定 - ConnectionError
- angular - 如何在 NgFor 循环中以角材料的每行显示最多 5 张卡片
- c# - Winforms:运行 oledb 连接时出错(可安装的 Isam,未为命令对象设置 Commandtext)
- uwp - UWP C# UART RS485 通信问题
- c - 带有管道到文件的 Echo 服务器
- vuejs2 - 防止 el-menu-item 在单击时添加“is-active”类
- tar - tar.bz2 无法统计:没有这样的文件或目录
- node.js - Angular 通用 - 运行 node.js 时出现警告
- php - 如何在 laravel spatie 中更新/编辑 custom_properties?