Azure上的节点部署失败(KeystoneJs CMS)

时间:2016-10-15 12:48:52

标签: node.js azure keystonejs kudu

我有一个使用KeystoneJs框架的简单CMS。当我进行提交然后在azure中触发部署时,它的部署失败。

我正在使用Azure App Services,在标准层上运行。

以前在Windows上Node-gyp存在问题,但根据this,它已被修复。

目前我正在尝试进行FTP部署。

我对节点并不熟悉,因此不确定诊断问题的最佳步骤是什么。

这是package.json

{
  "name": "MyApp",
  "version": "0.0.0",
  "private": true,
  "dependencies": {
    "keystone": "^0.3.22",
    "async": "^1.5.0",
    "lodash": "^4.13.1",
    "dotenv": "^2.0.0"
  },
  "devDependencies": {
    "eslint": "^2.12.0",
    "eslint-config-keystone": "^2.3.1",
    "eslint-plugin-react": "^5.1.1",
    "gulp": "^3.7.0",
    "gulp-shell": "^0.5.0",
    "gulp-watch": "^4.3.5"
  },
   "engines": {
    "node": "6.7.0",
    "npm": "3.9.5"
  },
  "scripts": {
    "lint": "eslint .",
    "start": "node keystone.js"
  }
}

这是NPD安装在Kudu上的输出

D:\home\site\wwwroot>npm install
npm WARN package.json assert@1.3.0 assert is also the name of a node core module.
npm WARN package.json asap@1.0.0 No repository field.
npm WARN package.json babel-traverse@6.16.0 No description
npm WARN package.json callsite@1.0.0 No repository field.
npm WARN package.json babel-plugin-syntax-jsx@6.13.0 No description
npm WARN package.json babel-plugin-syntax-flow@6.13.0 No description
npm WARN package.json bcrypt-pbkdf@1.0.0 No repository field.
npm WARN package.json buffer@4.9.1 buffer is also the name of a node core module.
npm WARN package.json crypto@0.0.3 crypto is also the name of a node core module.
npm WARN package.json css@1.0.8 No repository field.
npm WARN package.json css-parse@1.0.4 No repository field.
npm WARN package.json css-stringify@1.0.5 No repository field.
npm WARN package.json dateformat@1.0.2-1.2.3 No repository field.
npm WARN package.json events@1.1.1 events is also the name of a node core module.
npm WARN package.json indexof@0.0.1 No repository field.
npm WARN package.json pause@0.0.1 No repository field.
npm WARN package.json node-uuid@1.2.0 No repository field.
npm WARN package.json querystring@0.2.0 querystring is also the name of a node core module.
npm WARN package.json punycode@1.4.1 punycode is also the name of a node core module.
npm WARN package.json string_decoder@0.10.31 string_decoder is also the name of a node core module.
npm WARN package.json sprintf@0.1.1 No repository field.
npm WARN package.json uid2@0.0.3 No repository field.
npm WARN package.json url@0.11.0 url is also the name of a node core module.
npm WARN package.json util@0.10.3 util is also the name of a node core module.

> bson@0.2.22 install D:\home\site\wwwroot\node_modules\bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)


D:\home\site\wwwroot\node_modules\bson>node "D:\Program Files (x86)\npm\1.4.28\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild 

> buffertools@2.1.4 install D:\home\site\wwwroot\node_modules\buffertools
> node-gyp rebuild


D:\home\site\wwwroot\node_modules\buffertools>node "D:\Program Files (x86)\npm\1.4.28\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild 
Traceback (most recent call last):
  File "D:\Program Files (x86)\npm\1.4.28\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 18, in <module>
    sys.exit(gyp.script_main())
  File "D:\Program Files (x86)\npm\1.4.28\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 534, in script_main
    return main(sys.argv[1:])
  File "D:\Program Files (x86)\npm\1.4.28\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 527, in main
    return gyp_main(args)
  File "D:\Program Files (x86)\npm\1.4.28\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 503, in gyp_main
    options.circular_check)
  File "D:\Program Files (x86)\npm\1.4.28\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 98, in Load
    generator.CalculateVariables(default_variables, params)
  File "D:\Program Files (x86)\npm\1.4.28\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1867, in CalculateVariables
    generator_flags.get('msvs_version', 'auto'))
  File "D:\Program Files (x86)\npm\1.4.28\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSVersion.py", line 402, in SelectVisualStudioVersion
    versions = _DetectVisualStudioVersions(version_map[version], 'e' in version)
KeyError: '2015'


npm ERR! buffertools@2.1.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the buffertools@2.1.4 install script.
npm ERR! This is most likely a problem with the buffertools 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 their info via:
npm ERR!     npm owner ls buffertools
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "node" "D:\\Program Files (x86)\\npm\\1.4.28\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd D:\home\site\wwwroot
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE

如果您需要更多信息以便诊断问题,请告诉我。

1 个答案:

答案 0 :(得分:0)

您的package.json指定了以下引擎:

"engines": {
  "node": "6.7.0",
  "npm": "3.9.5"
}

...但看起来您的服务器正在运行节点v0.10.x和npm v1.x(取自您发布的调试信息)

KeystoneJS要求节点&gt; = 0.12.x,并且从npm v2.11.2

修复了您在链接到node-gyp问题的问题中的信息

如果您更新节点和npm版本,它应该开始工作。