热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

具有angular5应用程序的Azure部署选项无法编译并构建为持续集成

如何解决《具有angular5应用程序的Azure部署选项无法编译并构建为持续集成》经验,为你挑选了1个好方法。

我正在使用Angular 5,bit-bucket,azure app服务,我已经设置了与bit-bucket和Azure部署选项的持续集成.

请找到以下详细信息

在此输入图像描述 在此输入图像描述

在此输入图像描述 在此输入图像描述

项目结构

在此输入图像描述

我的package.json

{
  "name": "vaquarkhana-poc-app",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build –prod ",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "postinstall": "npm run build"
  },
  "engines": {
    "node": ">=10.0.0",
    "npm": ">=6.0.0"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.2.10",
    "@angular/cdk": "^5.2.5",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/flex-layout": "^5.0.0-beta.14",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/material": "^5.2.5",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "core-js": "^2.4.1",
    "hammerjs": "^2.0.8",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "~1.7.4",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "angular-ide": "^0.9.41",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  }
}

问题:我不想将任何构建依赖文件夹添加到比特桶中

node_modules

DIST

由于Azure在持续集成期间构建了package.json,但是我的构建在部署期间始终失败.

日志:

'ng' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! vaquarkhan-pos-app@0.0.0 build: `ng build –prod `
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the vaquarkhan-pos-app@0.0.0 build script.
npm ERR! This is most likely a problem with the vaquarkhan-pos-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ng build –prod 
npm ERR! You can get their info via:
npm ERR!     npm owner ls vaquarkhan-pos-app
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" "run" "build"
npm ERR! cwd D:\home\site\wwwroot
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vaquarkhan-pos-app@0.0.0 postinstall: `npm run build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the vaquarkhan-pos-app@0.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\local\AppData\npm-cache\_logs\2018-07-21T05_08_50_688Z-debug.log
Failed exitCode=1, command="D:\Program Files (x86)\nodejs\10.6.0\node.exe" "D:\Program Files (x86)\npm\6.1.0\node_modules\npm\bin\npm-cli.js" install --production
An error has occurred during web site deployment.
Invalid start-up command "ng serve" in package.json. Please use the format "node ".\r\nMissing server.js/app.js files, web.config is not generated\r\nnpm WARN lifecycle The node binary used for scripts is D:\Program Files (x86)\nodejs\0.10.28\node.exe but npm is using D:\Program Files (x86)\nodejs\10.6.0\node.exe itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.\r\nnpm WARN invalid config loglevel="notice"\r\n'ng' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n\r\nnpm ERR! vaquarkhan-pos-app@0.0.0 build: `ng build ?prod `\r\nnpm ERR! Exit status 1\r\nnpm ERR! \r\nnpm ERR! Failed at the vaquarkhan-pos-app@0.0.0 build script.\r\nnpm ERR! This is most likely a problem with the vaquarkhan-pos-app package,\r\nnpm ERR! not with npm itself.\r\nnpm ERR! Tell the author that this fails on your system:\r\nnpm ERR!     ng build ?prod \r\nnpm ERR! You can get their info via:\r\nnpm ERR!     npm owner ls vaquarkhan-pos-app\r\nnpm ERR! There is likely additional logging output above.\r\nnpm ERR! System Windows_NT 6.2.9200\r\nnpm ERR! command "node" "D:\\Program Files (x86)\\npm\\1.4.28\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"\r\nnpm ERR! cwd D:\home\site\wwwroot\r\nnpm ERR! node -v v0.10.40\r\nnpm ERR! npm -v 1.4.28\r\nnpm ERR! code ELIFECYCLE\r\nnpm ERR! code ELIFECYCLE\r\nnpm ERR! errno 1\r\nnpm ERR! vaquarkhan-pos-app@0.0.0 postinstall: `npm run build`\r\nnpm ERR! Exit status 1\r\nnpm ERR! \r\nnpm ERR! Failed at the vaquarkhan-pos-app@0.0.0 postinstall script.\r\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\r\n\r\nnpm ERR! A complete log of this run can be found in:\r\nnpm ERR!     D:\local\AppData\npm-cache\_logs\2018-07-21T05_08_50_688Z-debug.log\r\nD:\Program Files (x86)\SiteExtensions\Kudu\75.10629.3460\bin\Scripts\starter.cmd deploy.cmd

我很奇怪是否有人遇到同样的问题并解决了?



1> Jerry Liu..:

拖点修复

    node -v v0.10.40在您的错误消息中看到,这是由应用程序设置中的无效节点版本引起的.设置WEBSITE_NODE_DEFAULT_VERSION10.6.0Azure上唯一符合您要求的版本.

    使用bitbucket进行部署使您的代码由Kudu构建,这需要将您的角度相关模块devDependencies安装在Kudu上,需要将它们复制到dependencies.

在此输入图像描述


推荐阅读
  • android listview OnItemClickListener失效原因
    最近在做listview时发现OnItemClickListener失效的问题,经过查找发现是因为button的原因。不仅listitem中存在button会影响OnItemClickListener事件的失效,还会导致单击后listview每个item的背景改变,使得item中的所有有关焦点的事件都失效。本文给出了一个范例来说明这种情况,并提供了解决方法。 ... [详细]
  • Iamtryingtomakeaclassthatwillreadatextfileofnamesintoanarray,thenreturnthatarra ... [详细]
  • VScode格式化文档换行或不换行的设置方法
    本文介绍了在VScode中设置格式化文档换行或不换行的方法,包括使用插件和修改settings.json文件的内容。详细步骤为:找到settings.json文件,将其中的代码替换为指定的代码。 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • sklearn数据集库中的常用数据集类型介绍
    本文介绍了sklearn数据集库中常用的数据集类型,包括玩具数据集和样本生成器。其中详细介绍了波士顿房价数据集,包含了波士顿506处房屋的13种不同特征以及房屋价格,适用于回归任务。 ... [详细]
  • [大整数乘法] java代码实现
    本文介绍了使用java代码实现大整数乘法的过程,同时也涉及到大整数加法和大整数减法的计算方法。通过分治算法来提高计算效率,并对算法的时间复杂度进行了研究。详细代码实现请参考文章链接。 ... [详细]
  • 本文介绍了Android 7的学习笔记总结,包括最新的移动架构视频、大厂安卓面试真题和项目实战源码讲义。同时还分享了开源的完整内容,并提醒读者在使用FileProvider适配时要注意不同模块的AndroidManfiest.xml中配置的xml文件名必须不同,否则会出现问题。 ... [详细]
  • Go GUIlxn/walk 学习3.菜单栏和工具栏的具体实现
    本文介绍了使用Go语言的GUI库lxn/walk实现菜单栏和工具栏的具体方法,包括消息窗口的产生、文件放置动作响应和提示框的应用。部分代码来自上一篇博客和lxn/walk官方示例。文章提供了学习GUI开发的实际案例和代码示例。 ... [详细]
  • 本文讨论了Kotlin中扩展函数的一些惯用用法以及其合理性。作者认为在某些情况下,定义扩展函数没有意义,但官方的编码约定支持这种方式。文章还介绍了在类之外定义扩展函数的具体用法,并讨论了避免使用扩展函数的边缘情况。作者提出了对于扩展函数的合理性的质疑,并给出了自己的反驳。最后,文章强调了在编写Kotlin代码时可以自由地使用扩展函数的重要性。 ... [详细]
  • 本文介绍了如何使用Express App提供静态文件,同时提到了一些不需要使用的文件,如package.json和/.ssh/known_hosts,并解释了为什么app.get('*')无法捕获所有请求以及为什么app.use(express.static(__dirname))可能会提供不需要的文件。 ... [详细]
  • Imtryingtofigureoutawaytogeneratetorrentfilesfromabucket,usingtheAWSSDKforGo.我正 ... [详细]
  • 开发笔记:加密&json&StringIO模块&BytesIO模块
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了加密&json&StringIO模块&BytesIO模块相关的知识,希望对你有一定的参考价值。一、加密加密 ... [详细]
  • 本文讨论了在Windows 8上安装gvim中插件时出现的错误加载问题。作者将EasyMotion插件放在了正确的位置,但加载时却出现了错误。作者提供了下载链接和之前放置插件的位置,并列出了出现的错误信息。 ... [详细]
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • baresip android编译、运行教程1语音通话
    本文介绍了如何在安卓平台上编译和运行baresip android,包括下载相关的sdk和ndk,修改ndk路径和输出目录,以及创建一个c++的安卓工程并将目录考到cpp下。详细步骤可参考给出的链接和文档。 ... [详细]
author-avatar
书友32976730
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有