【发布时间】:2020-12-15 22:27:26
【问题描述】:
我一直在尝试将我的 Angular 应用程序的 docker 映像推送到 azure,但没有成功。
我按照此页面上视频中的步骤操作:https://docs.microsoft.com/en-us/azure/developer/javascript/tutorial-vscode-docker-node-01?tabs=bash,但是我得到了 :( 应用程序错误屏幕。然后我尝试在本地运行 docker 容器,这给了我以下错误:
$ docker run angdocker
> angdocker@0.0.0 start /usr/src/app
> ng serve
sh: ng: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! angdocker@0.0.0 start: `ng serve`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the angdocker@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-08-27T04_17_03_098Z-debug.log
我会指出我在 Ubuntu 20.0.4 上,这是一个简单的 Angular 应用程序,我开始使用 ng new 命令并且没有编辑。我只是使用 VS 代码生成 dockerfile 图像来创建图像并从那里开始工作。任何帮助将不胜感激,谢谢!
【问题讨论】:
-
尝试以下视频:youtube.com/watch?v=UJCpzOeMDBA 当我开始使用 docker 开发环境时,这真的很有帮助。