generator-teams: Missing Binding when using different npm versions (32bit / 64bit)

Describe the bug Using Azure DevOps to deploy the app to a windows azure Site i am getting the following error: Error: Missing binding D:\local\Temp\zipdeploy\extracted\node_modules\node-sass\vendor\win32-ia32-57\binding.node Node Sass could not find a binding for your current environment: Windows 32-bit with Node.js 8.x Found bindings for the following environments: Windows 64-bit with Node.js 8.x

To Reproduce i am using Azure DevOps Build & Release to build the app. So the Build is using the Node.js Tool Installer to specify the node.js version and then runs the npm install command. It all runs with a hosted agent that requires node.js and npm. The azure app service which runs the application is a default windows site. After that i want to deploy it via Azure DevOps Release. I am using the Task “App Service Deploy” to deploy it. If i don’t specify a deployment method it uses “Run from Package” and everything is fine. (Except that i cannot make changes in the root folder, but thats the concept of the run from package). If i change it to deploy via “Zip Deploy” i get the above error. So i got this one already in my dev environment, but there i could get a simple workaround - install and use the 32bit version of node.js and then deploy it to azure (via VS Code extension). Now it is not possible to use 32bit nodejs in the Azure DevOps Build task as i saw as a limitation of the windows app services in azure.

Expected behavior I want to get a working deployment via Azure DevOps.

Detailed information

  • Generator version: 2.9.0
  • OS: Windows 10
  • Node version: 8.15.1
  • Npm version: 6.4.1

Thanks for your help and the awesome Teams-Template!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (11 by maintainers)

Most upvoted comments

I was able to fix this issue by adding the command to rebuild node-sass into the deploy.cmd file. My deployment is happening via Github Actions, but it may also work for different workflows. This is the command I added, between the npm install and the npm build:

IF EXIST "%DEPLOYMENT_SOURCE%\package.json" (
  echo Rebuilding node-sass
  pushd "%DEPLOYMENT_SOURCE%"
  call :ExecuteCmd !NPM_CMD! rebuild node-sass
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

You can see the complete deploy.cmdof my project here. Hope this hepls other running into the same problem.

Thanks for your help. I will give it a try. I am on holiday the next 2 weeks so it takes a while.

After playing around with an existing web app. I figured out that there are both versions of NodeJS installed on the Windows Web site. To fully use the 64bit version I changed the environmental variable. with the following code in the Kudu Powershell:

[Environment]::SetEnvironmentVariable("PATH", "D:\home\site\deployments\tools;D:\Program Files (x86)\SiteExtensions\Kudu\82.10503.3890\bin\Scripts;D:\Program Files (x86)\MSBuild\14.0\Bin;D:\Program Files\Git\cmd;D:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;D:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn;D:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0;D:\Program  Files\Git\bin;D:\Program Files\Git\usr\bin;D:\Program Files\Git\mingw64\bin;D:\Program Files (x86)\npm\6.4.1;C:\DWASFiles\Sites\#1rgnodejstest\AppData\npm;D:\Program Files (x86)\bower\1.7.9;D:\Program Files (x86)\grunt\0.1.13;D:\Program Files (x86)\gulp\3.9.0.1;D:\Program Files (x86)\funcpack\1.0.0;D:\Program Files\nodejs\10.15.2;D:\Windows\system32;D:\Windows;D:\Windows\System32\Wbem;D:\Windows\System32\WindowsPowerShell\v1.0\;D:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;;D:\Program Files (x86)\dotnet;D:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;D:\Program Files (x86)\Git\cmd;D:\Program Files (x86)\PHP\v5.6;D:\Python27;", "Process")

I updated only the references for NodeJS and the change for that is not persistent. After messing around the complete web application it was time to create a new one, which actually brought something interesting to my attention. When you have to select the RunStack the option to use NodeJS on Windows becomes unavailable. At least I was able to install node-sassproperly.

Screenshot 2019-06-17 at 18 11 05

The Windows in this screenshot is greyed out which makes sense when you like to use NodeJS on a production environment. So this option doesn’t seem to be legit anymore at all.

Then I also checked the Azure DevOps configuration for an existing project and it showed up an Ubuntu image that will be used for the CI part. Without knowing anything specific but it seems like silently the Windows/NodeJS has been dropped at all. At least from my experiences, I made during my trials.

Thanks, @bastianjohn for the heads-up, but I doubt that limitation exists. Need to try it out.

@StfBauer i’ve tried this one at the very beginning. Unfortunately this has no effect. I’ve read in the limitations in azure that the app service has 32bit node.js only.

@wictorwilen this should work. I just thought there would be a better way, but i will give it a try!

Thanks!

Thanks for reporting. We’ll take a look at this and I’ll try to reproduce the issue.

Ping @StfBauer - seems related to the SASS pieces, you’ve seen this before?