如何在azure web app上安装Fibres包

goucqfw6  于 2021-06-21  发布在  Kudu
关注(0)|答案(1)|浏览(393)

我无法在azure web app上使用vuetify安装依赖于Fibres包的应用程序。
这个软件包总是失败,即使试图单独安装它( npm install fibers ).
我运行一个简单的windows机器,它有一个节点lts堆栈。尽管我尝试了其他栈,甚至linux,但结果都很相似。
输出消息提供了一个自己构建包的替代方法,但是那些指南需要管理权限,这在azureweb应用上是不可能的(至少据我所知)。
这个软件包非常流行,这对azure开发者来说应该是个大问题,对吧?
以下是来自cmd的完整输出消息(通过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
brvekthn

brvekthn1#

在azurewebapp中,节点的操作环境更加复杂。azure通常只支持基本的 npm , npx 以及其他全局安装包。我暂时还没有遇到其他人。因为环境比较复杂,我建议使用 Linux runtime environment 创建webapp时。
故障排除步骤:
确保本地项目正常运行,并将代码上载到 github . 如果有机密信息,记得选择 private 创建项目时的模式。更多细节,你可以参考我在这篇文章中的答案,它可以告诉你如何解决问题。
然后使用 git continuous deployment 将应用程序部署到azure。
一般来说,经过这一步,大部分部署问题都可以得到解决。如果没有,您可以在 Action .
当然,如果您不愿意使用git部署,可以使用 FTP 在构建本地运行代码后发布该代码,前提是git可以成功部署和运行。

相关问题