【发布时间】:2016-11-23 22:01:54
【问题描述】:
为了使用 Node 库 Sharp 进行一些图像处理,我必须将 Azure 应用服务上的节点可执行文件升级到 64 位。我通过手动下载可执行文件然后在IISNode.yml 中设置其路径来做到这一点。
不幸的是,当我启动应用程序时,它会抛出以下错误:
应用程序抛出未捕获的异常并终止: 错误:%1 不是有效的 Win32 应用程序。
\\?\D:\home\site\wwwroot\node_modules\bcrypt\build\Release\bcrypt_lib.node
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Function.cls_wrapMethod [as _load] (D:\home\site\wwwroot\node_modules\newrelic\lib\shimmer.js:256:38)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at bindings (D:\home\site\wwwroot\node_modules\bindings\bindings.js:76:44)
at Object.<anonymous> (D:\home\site\wwwroot\node_modules\bcrypt\bcrypt.js:3:35)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Function.cls_wrapMethod [as _load] (D:\home\site\wwwroot\node_modules\newrelic\lib\shimmer.js:256:38)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (D:\home\site\wwwroot\node_modules\bookshelf-bcrypt\index.js:5:14)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
我正在使用 Appveyor CI 系统构建和部署应用程序。这是我的appveyor.yml 文件的相关部分:
install:
- ps: Install-Product node $env:nodejs_version x64
- SET CL=-DDELAYIMP_INSECURE_WRITABLE_HOOKS
- npm i --loglevel=warn
- npm prune --production
- 7z a api.zip * -x!test -x!db -x!.git -xr!.* -x!README.md -x!nodemon.json -x!appveyor.yml | FIND /V "ing "
您会看到我正在使用 64 位版本的 Node 进行构建。
在我的 Azure 应用服务上,我将平台设置为 64 位。
我尝试过的事情:
- 在 Azure 上将平台设置为 32 位
- 在应用服务上吹走 node_modules/
提前致谢!
【问题讨论】:
标签: node.js azure bcrypt appveyor