node.js - 无法在 Azure Web App 上安装 StackImpact

标签 node.js azure npm azure-web-app-service

我无法在我的任何一个 Azure Web Apps(基于 Windows 的运行 Kudu)上安装 NodeJs 性能监视器“StackImpact”。在我的 Windows 10 笔记本电脑上本地一切正常,但 NPM 在服务器上安装失败(输出如下)

我尝试升级到 Node 10.6(Azure 支持的最新版本),然后降级回 Node 8.11.1。我仔细检查了机器是否以 64 位运行。

... 89 verbose stack Error: <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3241465351595b5f4253514672031c011c0302" rel="noreferrer noopener nofollow">[email protected]</a> install: `node node-gyp-fallback.js` 89 verbose stack Exit status 1 89 verbose stack at EventEmitter.<anonymous> (D:\Program Files (x86)\npm\6.1.0\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16) 89 verbose stack at EventEmitter.emit (events.js:182:13) 89 verbose stack at ChildProcess.<anonymous> (D:\Program Files (x86)\npm\6.1.0\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 89 verbose stack at ChildProcess.emit (events.js:182:13) 89 verbose stack at maybeClose (internal/child_process.js:961:16) 89 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5) 90 verbose pkgid <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b3c0c7d2d0d8dadec3d2d0c7f3829d809d8283" rel="noreferrer noopener nofollow">[email protected]</a> 91 verbose cwd D:\home\site\wwwroot 92 verbose Windows_NT 10.0.14393 93 verbose argv "D:\\Program Files (x86)\\nodejs\\10.6.0\\node.exe" "D:\\Program Files (x86)\\npm\\6.1.0\\node_modules\\npm\\bin\\npm-cli.js" "install" "stackimpact" 94 verbose node v10.6.0 95 verbose npm v6.1.0 96 error code ELIFECYCLE 97 error errno 1 98 error <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="97e4e3f6f4fcfefae7f6f4e3d7a6b9a4b9a6a7" rel="noreferrer noopener nofollow">[email protected]</a> install: `node node-gyp-fallback.js` 98 error Exit status 1 99 error Failed at the <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f4878095979f9d9984959780b4c5dac7dac5c4" rel="noreferrer noopener nofollow">[email protected]</a> install script. 99 error This is probably not a problem with npm. There is likely additional logging output above. 100 verbose exit [ 1, true ]

任何帮助将不胜感激!

最佳答案

南臂。我在我这边重现了您的问题。

enter image description here

据我观察,与node版本或npm版本无关。它说未找到node-gyp。

所以,我遵循了这个case运行命令npm install -global node-gyp。您可以在 D:\local\AppData\npm> 下查看它。

enter image description here

众所周知,node-gyp需要依赖python2.7微软的vc++构建工具来编译,这在Linux系统上没问题,因为Linux是通过安装的默认,但Windows操作系统默认不安装python2.7和vc++ Build工具。

我尝试安装 npm install --global --product windows-build-tools 但失败了。它需要 admin 权限,在 Web 应用程序沙箱限制中我们无法触及该权限。

因此,作为解决方法,也许您必须在本地安装软件包,然后将整个 node_modules 文件夹上传到 azure,而不是在 kudu 中安装软件包。

<小时/>

添加:

Azure 支持指出,该包仅在 64 位环境中运行,而其 Web 应用程序默认运行 x86 Node ,即使您已将环境设置为 x64。

您可以通过手动将 x64 Node 复制到服务器、更新 iisnode.yml 以指向它,然后手动更新 node_modules 来进行覆盖。所有这些都完全破坏了干净 CI 路径的任何机会。

关于node.js - 无法在 Azure Web App 上安装 StackImpact,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53603748/

相关文章:

azure - 我可以在 Azure 环境之外使用 Azure Synapse 功能吗?

javascript - npm live-server 安装 : symlink error (even when running as root/admin)

node.js - 使用 winston : Is there a Cassandra transport? 记录

Azure 通知中心 : what are registration types "Native" and "Template"?

Azure 数据资源管理器成本估算器给出了难以置信的估算

javascript - 在ember js中导入模块时出现异常

javascript - Gulp JavaScript 文件过滤,无需其父文件夹

Node.js 和 PostgresQL 与 Express

node.js - 如何选择行以使用 Hough 变换查找收据?

javascript - Accounts.onCreatedUser 的奇怪错误