azure Web应用程序中lwip的node-gyp重建问题:致命错误C1083:无法打开包含文件:'nan.h':没有此类文件或目录 [英] node-gyp rebuild issue for lwip in azure web app: fatal error C1083: Cannot open include file: 'nan.h': No such file or directory

查看:238
本文介绍了azure Web应用程序中lwip的node-gyp重建问题:致命错误C1083:无法打开包含文件:'nan.h':没有此类文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在azure中部署了一个节点应用程序. azure Web应用程序中的环境详细信息如下-

I have deployed a node application in azure. Environment detail in azure web app is as following-

Python version : 2.7
Platform : 32 bit 
Dotnet framework : 4.6
Node version : 6.3.0
Npm version: 3.10.3

在我的应用程序中,我正在使用lwip,它需要使用可视C ++构建工具进行构建.当我执行npm install时,它在node-gyp rebuild上失败.对于相同的消息类型,我收到很多错误消息

In my application I am using lwip, which need build using visual C++ build tools. When I do npm install its failing on node-gyp rebuild. I am getting many error message for the same message type

严重错误C1083:无法打开包含文件:'nan.h':没有此类文件或 目录"

"fatal error C1083: Cannot open include file: 'nan.h': No such file or directory"

我检查了node_modules中是否有nan模块.

I have checked that nan module is there in the node_modules.

完整的日志附在这里:

D:\home\site\wwwroot>npm install

> lwip@0.0.9 install D:\home\site\wwwroot\node_modules\lwip
> node-gyp rebuild


D:\home\site\wwwroot\node_modules\lwip>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\npm\3.10.3\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild ) 
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  init.cpp
d:\home\site\wwwroot\node_modules\lwip\src\decoder\decoder.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_decoder.vcxproj]
  util.cpp
d:\home\site\wwwroot\node_modules\lwip\src\decoder\decoder.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_decoder.vcxproj]
  buffer_worker.cpp
d:\home\site\wwwroot\node_modules\lwip\src\decoder\decoder.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_decoder.vcxproj]
  jpeg_decoder.cpp
d:\home\site\wwwroot\node_modules\lwip\src\decoder\decoder.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_decoder.vcxproj]
  png_decoder.cpp
d:\home\site\wwwroot\node_modules\lwip\src\decoder\decoder.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_decoder.vcxproj]
  gif_decoder.cpp
d:\home\site\wwwroot\node_modules\lwip\src\decoder\decoder.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_decoder.vcxproj]
  init.cpp
d:\home\site\wwwroot\node_modules\lwip\src\encoder\encoder.h(11): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_encoder.vcxproj]
  jpeg_worker.cpp
d:\home\site\wwwroot\node_modules\lwip\src\encoder\encoder.h(11): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_encoder.vcxproj]
  png_worker.cpp
d:\home\site\wwwroot\node_modules\lwip\src\encoder\encoder.h(11): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_encoder.vcxproj]
  gif_worker.cpp
d:\home\site\wwwroot\node_modules\lwip\src\encoder\encoder.h(11): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_encoder.vcxproj]
  init.cpp
d:\home\site\wwwroot\node_modules\lwip\src\image\image.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_image.vcxproj]
  image.cpp
d:\home\site\wwwroot\node_modules\lwip\src\image\image.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_image.vcxproj]
  resize_worker.cpp
d:\home\site\wwwroot\node_modules\lwip\src\image\image.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_image.vcxproj]
  rotate_worker.cpp
d:\home\site\wwwroot\node_modules\lwip\src\image\image.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_image.vcxproj]
  blur_worker.cpp
d:\home\site\wwwroot\node_modules\lwip\src\image\image.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_image.vcxproj]
  crop_worker.cpp
d:\home\site\wwwroot\node_modules\lwip\src\image\image.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_image.vcxproj]
  mirror_worker.cpp
d:\home\site\wwwroot\node_modules\lwip\src\image\image.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_image.vcxproj]
  pad_worker.cpp
d:\home\site\wwwroot\node_modules\lwip\src\image\image.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_image.vcxproj]
  sharpen_worker.cpp
d:\home\site\wwwroot\node_modules\lwip\src\image\image.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_image.vcxproj]
  hsla_worker.cpp
d:\home\site\wwwroot\node_modules\lwip\src\image\image.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_image.vcxproj]
  opacify_worker.cpp
d:\home\site\wwwroot\node_modules\lwip\src\image\image.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_image.vcxproj]
  paste_worker.cpp
d:\home\site\wwwroot\node_modules\lwip\src\image\image.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_image.vcxproj]
  setpixel_worker.cpp
d:\home\site\wwwroot\node_modules\lwip\src\image\image.h(13): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [D:\home\site\wwwroot\node_modules\lwip\build\lwip_image.vcxproj]
gyp ERR! build error 
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files (x86)\npm\3.10.3\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "D:\\Program Files (x86)\\nodejs\\6.3.0\\node.exe" "C:\\Program Files (x86)\\npm\\3.10.3\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\home\site\wwwroot\node_modules\lwip
gyp ERR! node -v v6.3.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@0.3.8
npm WARN brief@0.0.1 No repository field.
npm WARN brief@0.0.1 No license field.
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\6.3.0\\node.exe" "D:\\Program Files (x86)\\npm\\3.10.3\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.3.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE

npm ERR! lwip@0.0.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the lwip@0.0.9 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the lwip package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs lwip
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls lwip
npm ERR! There is likely additional logging output above.


npm ERR! Please include the following file with any support request:
npm ERR!     D:\home\site\wwwroot\npm-debug.log

谢谢

推荐答案

当前,Azure Azure应用服务不支持所有本机模块,并且可能无法编译具有特定先决条件的模块.

Currently, Azure Azure App Service does not support all native modules and might fail at compiling those with very specific prerequisites.

作为一种解决方法,您可以在安装了所有本机模块先决条件的本地Windows计算机上运行npm install.然后,将创建的node_modules文件夹作为应用程序的一部分部署到Azure App Service.

As a workaround, you can run npm install on your local Windows machine that has all the native module's prerequisites installed. Then, deploy the created node_modules folder as part of the application to Azure App Service.

请参考 https://azure.microsoft.com/zh-CN/documentation/articles/nodejs-use-node-modules-azure-apps/了解更多信息.

这篇关于azure Web应用程序中lwip的node-gyp重建问题:致命错误C1083:无法打开包含文件:'nan.h':没有此类文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆