azure上的节点部署失败(keystonejs cms)

j8ag8udp  于 2021-06-20  发布在  Kudu
关注(0)|答案(1)|浏览(364)

我有一个带有keystonejs框架的简单cms。当我做出一个提交,然后在azure中触发一个部署时,它的部署就失败了。
我使用的是标准层上运行的azure应用程序服务。
以前有个问题 Node-gyp 在Windows上,但根据这个,它已经修好了。
目前,我正在求助于做ftp部署。
我不太熟悉node,所以不确定诊断问题的最佳步骤是什么。
这是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"
  }
}

这是在kudu上安装npm的输出

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

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

tag5nh1u

tag5nh1u1#

你的 package.json 指定以下引擎:

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

... 但是看起来您的服务器正在运行node v0.10.x和npm v1.x(取自您发布的调试信息)
keystonejs要求node>=0.12.x,根据链接到node的问题中的信息,gyp问题已从npm v2.11.2中修复
如果您更新了node和npm版本,它应该可以开始工作了。

相关问题