Kudu npm安装失败 [英] Kudu npm install failed

查看:127
本文介绍了Kudu npm安装失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在Azure上使用kudu部署项目时遇到一个非常奇怪的错误.

I'm getting a very strange error when trying to deploy my project with kudu on Azure.

我已经用VueJs用dotnet构建了我的项目.我使用了以下模板" https://github.com/MarkPieszak/aspnetcore-Vue-starter "

I have build my project with dotnet with VueJs. I have used the following template "https://github.com/MarkPieszak/aspnetcore-Vue-starter"

我现在尝试将WEBSITE_NODE_DEFAULT_VERSION设置为几个不同的版本,但是没有任何运气.

I have tried setting the WEBSITE_NODE_DEFAULT_VERSION to a few different version now without any luck.

这是Kudu的出没地点:

Here are the out from Kudu:

Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET Core Web Application deployment.
  Restore completed in 735.88 ms for D:\home\site\repository\projectx.csproj.
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 345.52 ms for D:\home\site\repository\projectx.csproj.
  projectx -> D:\home\site\repository\bin\Release\netcoreapp2.1\projectx.dll
  projectx -> D:\home\site\repository\bin\Release\netcoreapp2.1\projectx.Views.dll
  NPM Installing dependencies...
  npm WARN package.json assert@1.4.1 assert is also the name of a node core module.
  npm WARN package.json buffer@4.9.1 buffer is also the name of a node core module.
  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 punycode@2.1.1 punycode is also the name of a node core module.
  npm WARN package.json querystring@0.2.0 querystring is also the name of a node core module.
  npm WARN package.json string_decoder@1.1.1 string_decoder is also the name of a node core module.
  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.4 util is also the name of a node core module.
  npm WARN package.json vue-template-es2015-compiler@1.6.0 No repository field.
EXEC : npm ERR! error : Method Not Allowed [D:\home\site\repository\projectx.csproj]
  npm ERR!     at errorResponse (D:\Program Files (x86)\npm\1.4.28\node_modules\npm\lib\cache\add-named.js:260:10)
  npm ERR!     at D:\Program Files (x86)\npm\1.4.28\node_modules\npm\lib\cache\add-named.js:203:12
  npm ERR!     at saved (D:\Program Files (x86)\npm\1.4.28\node_modules\npm\node_modules\npm-registry-client\lib\get.js:167:7)
  npm ERR!     at Object.oncomplete (fs.js:108:15)
  npm ERR! If you need help, you may report this *entire* log,
  npm ERR! including the npm and node versions, at:
  npm ERR!     <http://github.com/npm/npm/issues>

  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" "--ignore-scripts"
  npm ERR! cwd D:\home\site\repository
  npm ERR! node -v v0.10.40
  npm ERR! npm -v 1.4.28
  npm ERR! code E405
D:\home\site\repository\projectx.csproj(25,5): error MSB3073: The command "npm install --ignore-scripts" exited with code 1.
Failed exitCode=1, command=dotnet publish "D:\home\site\repository\projectx.csproj" --output "D:\local\Temp\8d65c86f4c7808a" --configuration Release
An error has occurred during web site deployment.
\r\nD:\Program Files (x86)\SiteExtensions\Kudu\79.11121.3655\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

有人有主意吗?该项目在我的计算机上运行良好.

Anybody who has a idea? The project runs fine on my computer.

推荐答案

根据您的错误信息,您的问题显然是由错误的Node版本引起的.您使用的GitHub存储库的先决条件之一是NodeJS >= 8.9.4,但是现在在您的Azure WebApp上是v0.10.40.如您所说,已添加了WEBSITE_NODE_DEFAULT_VERSION设置,但似乎不起作用.

According to your error information, your issue was caused by the incorrect Node version obviously. The one of the prerequisites of GitHub repo you used is NodeJS >= 8.9.4, but now it's v0.10.40 on your Azure WebApp. As you said, the WEBSITE_NODE_DEFAULT_VERSION setting has beed added, but it seems not work.

我遵循了

I followed the document to add the same setting and click Save on Azure portal as the figure below, then immediately my kudu console restarted and check my node & npm version which be correct.

所以我的建议是:

  1. 请检查您的WEBSITE_NODE_DEFAULT_VERSION设置是否添加到正确的字段中.
  2. 您可以尝试手动重新启动Azure WebApp,以使更改生效.
  1. Please check your WEBSITE_NODE_DEFAULT_VERSION setting whether be added in the correct field.
  2. You can try to restart your Azure WebApp manually to make the change works.

这篇关于Kudu npm安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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