gpt4 book ai didi

mysql - Azure MySql + Sequelize 之间的连接

转载 作者:行者123 更新时间:2023-11-29 10:44:44 26 4
gpt4 key购买 nike

我在配置 Azure Mysql 和 Node + Sequelize 之间的连接时遇到问题。难道是node版本的问题?这是我在部署过程中收到的错误:

错误:

remote: npm ERR! Error: ENOENT, chmod 'D:\home\site\wwwroot\node_modules\sequelize\node_modules\moment\locale\ar-ly.js'
remote: npm ERR! If you need help, you may report this *entire* log,
remote: npm ERR! including the npm and node versions, at:
remote: npm ERR! <http://github.com/npm/npm/issues>
remote:
remote: npm ERR! System Windows_NT 6.2.9200
remote: npm ERR! command "D:\\Program Files (x86)\\nodejs\\0.10.28\\node.exe" "D:\\Program Files (x86)\\npm\\1.4.9\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
remote: npm ERR! cwd D:\home\site\wwwroot
remote: npm ERR! node -v v0.10.28
remote: npm ERR! npm -v 1.4.9
remote: npm ERR! path D:\home\site\wwwroot\node_modules\sequelize\node_modules\moment\locale\ar-ly.js
remote: npm ERR! fstream_path D:\home\site\wwwroot\node_modules\sequelize\node_modules\moment\locale\ar-ly.js
remote: npm ERR! fstream_type File
remote: npm ERR! fstream_class FileWriter
remote: npm ERR! fstream_finish_call chmod
remote: npm ERR! code ENOENT
remote: npm ERR! errno 34
remote: npm ERR! fstream_stack D:\Program Files (x86)\npm\1.4.9\node_modules\npm\node_modules\fstream\lib\writer.js:305:19
remote: npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
remote: npm ERR! Error: EPERM, lstat 'D:\home\site\wwwroot\node_modules\sequelize\node_modules\lodash\_createOver.js'
remote: npm ERR! { [Error: EPERM, lstat 'D:\home\site\wwwroot\node_modules\sequelize\node_modules\lodash\_createOver.js']
remote: npm ERR! errno: 50,
remote: npm ERR! code: 'EPERM',
remote: npm ERR! path: 'D:\\home\\site\\wwwroot\\node_modules\\sequelize\\node_modules\\lodash\\_createOver.js',
remote: npm ERR! fstream_type: 'File',
remote: npm ERR! fstream_path: 'D:\\home\\site\\wwwroot\\node_modules\\sequelize\\node_modules\\lodash\\_createOver.js',
remote: npm ERR! fstream_class: 'FileWriter',
remote: npm ERR! fstream_stack:
remote: npm ERR! [ 'D:\\Program Files (x86)\\npm\\1.4.9\\node_modules\\npm\\node_modules\\fstream\\lib\\writer.js:284:26',
remote: npm ERR! 'Object.oncomplete (fs.js:107:15)' ] }
remote: npm ERR!
remote: npm ERR! Please try running this command again as root/Administrator.
remote:
remote: npm ERR! System Windows_NT 6.2.9200
remote: npm ERR! command "D:\\Program Files (x86)\\nodejs\\0.10.28\\node.exe" "D:\\Program Files (x86)\\npm\\1.4.9\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
remote: npm ERR! cwd D:\home\site\wwwroot
remote: npm ERR! node -v v0.10.28
remote: npm ERR! npm -v 1.4.9
remote: npm ERR! path D:\home\site\wwwroot\node_modules\sequelize\node_modules\lodash\_createOver.js
remote: npm ERR! fstream_path D:\home\site\wwwroot\node_modules\sequelize\node_modules\lodash\_createOver.js
remote: npm ERR! fstream_type File
remote: npm ERR! fstream_class FileWriter
remote: npm ERR! code EPERM
remote: npm ERR! errno 50
remote: npm ERR! stack Error: EPERM, lstat 'D:\home\site\wwwroot\node_modules\sequelize\node_modules\lodash\_createOver.js'
remote: Failed exitCode=34, command="D:\Program Files (x86)\nodejs\0.10.28\node.exe" "D:\Program Files (x86)\npm\1.4.9\node_modules\npm\bin\npm-cli.js" install --production
remote: npm ERR! fstream_stack D:\Program Files (x86)\npm\1.4.9\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
remote: An error has occurred during web site deployment.
remote: npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
remote: npm ERR! error rolling back Error: EPERM, unlink 'D:\home\site\wwwroot\node_modules\sequelize\node_modules\moment-timezone\builds\moment-timezone-with-data-2012-2022.min.js'
remote: npm ERR! error rolling back sequelize@3.30.4 { [Error: EPERM, unlink 'D:\home\site\wwwroot\node_modules\sequelize\node_modules\moment-timezone\builds\moment-timezone-with-data-2012-2022.min.js']
remote: npm ERR! error rolling back errno: 50,
remote: npm ERR! error rolling back code: 'EPERM',
remote: npm ERR! error rolling back path: 'D:\\home\\site\\wwwroot\\node_modules\\sequelize\\node_modules\\moment-timezone\\builds\\moment-timezone-with-data-2012-2022.min.js' }

这是有关连接的代码:

var sequelize = new Sequelize('db-name', 'user', 'password', {
host: 'dbname.database.windows.net',
dialect: 'mssql',
pool: {
max: 5,
min: 0,
idle: 10000
},
dialectOptions: {
encrypt: true
}
});

最佳答案

我在这个配置中遇到了同样的问题(Web App Service + NodeJS + Sequelize + MySQL)。看来问题出在windows机器上的node版本。

关于mysql - Azure MySql + Sequelize 之间的连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44821723/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com