How to install fibers package on Azure Web App

Viewed 224

I cannot install an application using Vuetify on Azure Web App with a dependency on fibers package.

This package fails all the time, even when trying to install it alone (npm install fibers).

I run a simple Windows machine with a Node LTS stack. Although I tried with other stacks and even Linux with similar result.

The output message gives an alternative to build the package yourself but those guides require administrative privileges which is not possible to have on Azure Web App (to the best of my knowledge at least).

The package is quite popular which should be a wide problem on Azure developers, right?

Here the full output message from CMD (via Kudu):

D:\home\site\wwwroot>npm install fibers
gyp ERR! build error 
gyp ERR! stack Error: `D:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\Program Files (x86)\npm\6.12.0\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "D:\\Program Files (x86)\\nodejs\\12.13.0\\node.exe" "D:\\Program Files (x86)\\npm\\6.12.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
gyp ERR! cwd D:\home\site\wwwroot\node_modules\fibers
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'` 
Alpine users please run: `sudo apk add python make g++`
'nodejs' is not recognized as an internal or external command,
operable program or batch file.
npm WARN enoent ENOENT: no such file or directory, open 'D:\home\site\wwwroot\package.json'
npm WARN wwwroot No description
npm WARN wwwroot No repository field.
npm WARN wwwroot No README data
npm WARN wwwroot No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fibers@5.0.0 install: `node build.js || nodejs build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the fibers@5.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\local\AppData\npm-cache\_logs\2020-07-22T15_13_22_997Z-debug.log
1 Answers

In Azure webapp, the operating environment of node is more complicated. Azure generally only supports basic npm,npx and other global installation packages. I haven't encountered the rest for the time being. Because the environment is more complicated, I recommend using Linux runtime environment when creating webapp.

Steps to troubleshoot:

  1. Ensure that the local project is running normally and upload the code to github. If there is confidential information, remember to select the private mode when creating the project. For more detail, you can refer to my answer in this post which can tell you how to trouble shooting.

  2. Then use git continuous deployment to deploy the application to Azure.

Generally speaking, most of the deployment problems can be solved after this step. If not, you can view the specific error message in the Action.

Of course, if you are unwilling to use git deployment, you can use FTP to publish the local running code after building it, provided that git can be deployed and run successfully.

Related