1

I am unable to install the NodeJs perf monitor "StackImpact" on either of my Azure Web Apps (Windows based running Kudu). It all works fine locally on my Windows 10 laptop but NPM install fails on the servers (output below)

I've tried upgrading to Node 10.6 (latest version Azure supports), then downgrading back to Node 8.11.1. I double checked that the machines are running in 64bit.

... 89 verbose stack Error: stackimpact@1.3.10 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 stackimpact@1.3.10 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 stackimpact@1.3.10 install: `node node-gyp-fallback.js` 98 error Exit status 1 99 error Failed at the stackimpact@1.3.10 install script. 99 error This is probably not a problem with npm. There is likely additional logging output above. 100 verbose exit [ 1, true ]

Any help would be greatly appreciated!

Jerry Liu
  • 17,282
  • 4
  • 40
  • 61
soutarm
  • 831
  • 1
  • 8
  • 14
  • StackImpact agent includes pre-buit native add-ons for 64-bit systems, but not for 32-bit. That's why the agent tries to fall back to building it and fails. We plan to also include pre-built 32-bit add-ons ass well. – logix Dec 24 '18 at 12:09

1 Answers1

1

soutarm. I reproduce your issue on my side.

enter image description here

According to my observation, it has nothing to do with node version or npm version. It said node-gyp not found.

So, I followed this case to run the command npm install -global node-gyp. You could check it under the D:\local\AppData\npm>.

enter image description here

As we know, node-gyp needs to rely on python2.7 and Microsoft's vc++ build tools for compilation, this is fine on Linux systems because Linux is installed by default, but the Windows operating system does not install python2.7 and vc++ Build tool by default.

I tried to install that npm install --global --production windows-build-tools but failed. It needs admin permission which is can't be touched by us in web app sandbox restrictions.

So,as workaround, maybe you have to install the packages locally then upload total node_modules folder to azure instead of installing packages in kudu.


Addition:

Azure support pointed out that the package only runs in 64 bit environments while their Web Apps run x86 Node by default, even if you've set the environment to x64.

You can override by manually copying x64 Node to the server, updating iisnode.yml to point to it then manually updating node_modules. All of which totally destroys any chance of a clean CI path.

Jay Gong
  • 23,163
  • 2
  • 27
  • 32
  • Nice! Thanks for taking the time to help out. I got a response from Azure support and they pointed out that the package only runs in 64 bit environments while their Web Apps run x86 Node by default, even if you've set the environment to x64. You can override by manually copying x64 Node to the server, updating iisnode.yml to point to it then manually updating node_modules. All of which totally destroys any chance of a clean CI path. It also would explain why it works on my laptop but not on Azure :/ – soutarm Dec 05 '18 at 03:02
  • @soutarm Thanks for your sharing, I already summarized that in my answer. – Jay Gong Dec 05 '18 at 03:15
  • Further update from Azure support is they recommend running a Linux-based WebApp (if that's an option) as they run x64 Node by default. I've yet to get this working however so can't confirm viability. – soutarm Dec 06 '18 at 04:22