node.js - 部署到 Azure 上的 Node 时出现 node-icu-charset- detector 错误

标签 node.js git azure

当我使用 git 命令行推送到 Azure 时,我不断收到此错误消息(这是消息转储中可能第 20 行的第一行,完整消息如下)。

remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(326): error C2995: 'v8::Local Nan::imp::NanEnsureHandleOrPersistent(const v8::Local &)': function template has already been defined [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj]

我遇到了一个异步问题,我通过使用 ftp 将 node_modules\async 文件夹从我的开发环境复制到 Azure 中的 node_modules 文件夹来修复。这个想法的功劳来自这篇文章:

https://azure.microsoft.com/en-us/documentation/articles/nodejs-use-node-modules-azure-apps/

所以这是奇怪的事情 - 我的 package.json 中没有 node-icu-charset 并且它也不存在于 node_modules 文件夹中(本地或 Azure),所以我不能只复制这个包像我对异步所做的那样,由云来解决这个问题。

我正在Windows 10上使用VS Code进行开发,本地node.js版本是6.1.0,服务器node.js版本是6.1.0。 Azure 上的 npm 是 3.8.6。

在我的开发环境中,本地一切都工作正常,尽管我所做的几乎每次推送中都存在此错误,但 Azure 站点也按预期工作。

有人知道如何消除这个错误吗?

<小时/>
  "dependencies": {
    "async": "~2.0.0-rc.6",
    "config": "~1.21.0",
    "body-parser": "~1.13.2",
    "cookie-parser": "~1.3.5",
    "auth0": "~2.1.0",
    "express-jwt": "~3.4.0",
    "debug": "~2.2.0",
    "express": "~4.13.1",
    "jade": "~1.11.0",
    "morgan": "~1.6.1",
    "serve-favicon": "~2.3.0",
    "documentdb": "~1.7.0",
    "node-cache": "~3.2.1",
    "winston": "~2.2.0",
    "winston-irc": "~0.3.4"
  }
<小时/>

remote: Updating branch 'master'. remote: Updating submodules. remote: Preparing deployment for commit id 'b11dba66e0'. remote: Generating deployment script. remote: Running deployment command... remote: Handling node.js deployment. remote: KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot' remote: Copying file: 'package.json' remote: Copying file: 'config\default.json' remote: Copying file: 'node_modules\async\LICENSE' remote: Copying file: 'node_modules\async\package.json' remote: Copying file: 'node_modules\async\README.md' remote: Using start-up script bin/www from package.json. remote: Generated web.config. remote: Node.js versions available on the platform are: 0.6.20, 0.8.2, 0.8.19, 0.8.26, 0.8.27, 0.8.28, 0.10.5, 0.10.18, 0.10.21, 0.10.24, 0.10.26, 0.10.28, 0.10.29, 0.10.31, 0.10.32, 0.10.40, 0.12.0, 0.12.2, 0.12.3, 0.12.6, 4.0.0, 4.1.0, 4.1.2, 4.2.1, 4.2.2, 4.2.3, 4.2.4, 4.3.0, 4.3.2, 4.4.0, 4.4.1, 5.0.0, 5.1.1, 5.3.0, 5.4.0, 5.5.0, 5.6.0, 5.7.0, 5.7.1, 5.8.0, 5.9.1, 6.0.0, 6.1.0. remote: Selected node.js version 6.1.0. Use package.json file to choose a different version. remote: Selected npm version 3.8.6 remote: Updating iisnode.yml at D:\home\site\wwwroot\bin\iisnode.yml remote: ........... remote: remote: > [email protected] install D:\home\site\wwwroot\node_modules\node-icu-charset-detector remote: > node-gyp rebuild remote: remote: remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\npm\3.8.6\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild ) remote: ....... remote: Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. remote: node-icu-charset-detector.cpp remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(326): error C2995: 'v8::Local Nan::imp::NanEnsureHandleOrPersistent(const v8::Local &)': function template has already been defined [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote:
D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(319): note: see declaration of 'Nan::imp::NanEnsureHandleOrPersistent' remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(346): error C2995: 'v8::Local Nan::imp::NanEnsureLocal(const v8::Local &)': function template has already been defined [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote:
D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(334): note: see declaration of 'Nan::imp::NanEnsureLocal' remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(560): error C2039: 'GCEpilogueCallback': is not a member of 'v8::Isolate' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote:
d:\local\userprofile.node-gyp\6.1.0\include\node\v8.h(5306): note: see declaration of 'v8::Isolate' remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(560): error C2065: 'GCEpilogueCallback': undeclared identifier [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(561): error C2146: syntax error: missing ')' before identifier 'callback' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(561): error C2143: syntax error: missing ';' before '{' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(561): error C2447: '{': missing function header (old-style formal list?) [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(566): error C2039: 'GCEpilogueCallback': is not a member of 'v8::Isolate' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote:
d:\local\userprofile.node-gyp\6.1.0\include\node\v8.h(5306): note: see declaration of 'v8::Isolate' remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(566): error C2065: 'GCEpilogueCallback': undeclared identifier [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(566): error C2146: syntax error: missing ')' before identifier 'callback' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(566): error C2143: syntax error: missing ';' before '{' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(566): error C2447: '{': missing function header (old-style formal list?) [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(571): error C2039: 'GCPrologueCallback': is not a member of 'v8::Isolate' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote:
d:\local\userprofile.node-gyp\6.1.0\include\node\v8.h(5306): note: see declaration of 'v8::Isolate' remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(571): error C2065: 'GCPrologueCallback': undeclared identifier [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(572): error C2146: syntax error: missing ')' before identifier 'callback' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(572): error C2143: syntax error: missing ';' before '{' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(572): error C2447: '{': missing function header (old-style formal list?) [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(577): error C2039: 'GCPrologueCallback': is not a member of 'v8::Isolate' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote:
d:\local\userprofile.node-gyp\6.1.0\include\node\v8.h(5306): note: see declaration of 'v8::Isolate' remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(577): error C2065: 'GCPrologueCallback': undeclared identifier [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(577): error C2146: syntax error: missing ')' before identifier 'callback' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(577): error C2143: syntax error: missing ';' before '{' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(577): error C2447: '{': missing function header (old-style formal list?) [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(757): error C3083: 'smalloc': the symbol to the left of a '::' must be a type [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(757): error C2039: 'FreeCallback': is not a member of 'node' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote:
D:\local\UserProfile.node-gyp\6.1.0\include\node\node_object_wrap.h(8): note: see declaration of 'node' remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(757): error C2061: syntax error: identifier 'FreeCallback' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(761): error C2065: 'callback': undeclared identifier [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(761): error C2065: 'hint': undeclared identifier [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(768): error C2665: 'node::Buffer::New': none of the 4 overloads could convert all the argument types [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote:
D:\local\UserProfile.node-gyp\6.1.0\include\node\node_buffer.h(46): note: could be 'v8::MaybeLocal node::Buffer::New(v8::Isolate *,char *,size_t)' remote:
D:\local\UserProfile.node-gyp\6.1.0\include\node\node_buffer.h(34): note: or 'v8::MaybeLocal node::Buffer::New(v8::Isolate *,v8::Local,node::encoding)' remote:
D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(768): note: while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)' remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(772): error C2440: 'return': cannot convert from 'v8::MaybeLocal' to 'v8::Local' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote:
D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(772): note: No constructor could take the source type, or constructor overload resolution was ambiguous remote: gyp ERR! build error remote: gyp ERR! stack Error: msbuild failed with exit code: 1 remote: gyp ERR! stack at ChildProcess.onExit (C:\Program Files (x86)\npm\3.8.6\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23) remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(779): error C2039: 'Use': is not a member of 'node::Buffer' [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: gyp ERR! stack at emitTwo (events.js:106:13) remote:
D:\local\UserProfile.node-gyp\6.1.0\include\node\node_buffer.h(11): note: see declaration of 'node::Buffer' remote: gyp ERR! stack at ChildProcess.emit (events.js:191:7) remote: D:\home\site\wwwroot\node_modules\node-icu-charset-detector\node_modules\nan\nan.h(779): error C3861: 'Use': identifier not found [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12) remote: ..\node-icu-charset-detector.cpp(7): fatal error C1083: Cannot open include file: 'unicode/ucsdet.h': No such file or directory [D:\home\site\wwwroot\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj] remote: gyp ERR! System Windows_NT 6.2.9200 remote: gyp ERR! command "D:\Program Files (x86)\nodejs\6.1.0\node.exe" "C:\Program Files (x86)\npm\3.8.6\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" remote: gyp ERR! cwd D:\home\site\wwwroot\node_modules\node-icu-charset-detector remote: gyp ERR! node -v v6.1.0 remote: gyp ERR! node-gyp -v v3.3.1 remote: gyp ERR! not ok remote: npm WARN install:node-icu-ch[email protected] [email protected] install: node-gyp rebuild remote: npm WARN install:[email protected] Exit status 1 remote: Finished successfully. remote: Running post deployment command(s)... remote: Deployment successful.

最佳答案

通过一一检查这些依赖关系,我发现模块 winston-irc 是罪犯,其深层依赖关系包括链是 winston-irc= >irc=>node-irc=>node-icu-charset- detector

所以这可能是尚不支持直接部署任务的 native 模块之一。您可以从 .gitingore 文件中删除此 Node 模块,并使用应用程序项目将其上传到 Azure Web App。

如有任何进一步的疑问,请随时告诉我。

关于node.js - 部署到 Azure 上的 Node 时出现 node-icu-charset- detector 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37904102/

相关文章:

node.js - 使用nodejs在mongoDB oplog集合中查找每个新文档不起作用(光标似乎变得无效或死了)

mysql - Sequelize 具有相同外键的多对多表只选择一个值

git - git如何跟踪文件的变化

eclipse - 在不使用任何 git eclipse 插件的情况下在 eclipse 中进行开发?

azure - 我的 Protobuf Swagger API 应使用什么 MIME 类型?

node.js - Mongoose 模型在数组拼接后不保存

git - 推送失败但 git status 显示没有要提交的内容

azure - 是什么让 Azure Key Vault 比 Azure SQL DB 更安全?

c# - Azure worker 角色-防止回收

javascript - express-fileupload 模块将损坏的图像文件保存到我的硬盘的奇怪问题