未定义Azure返回系统中的Angular 2 Web应用程序错误 [英] Angular 2 web app in Azure returning system is not defined error

查看:78
本文介绍了未定义Azure返回系统中的Angular 2 Web应用程序错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Angular2的新手,刚刚向Azure Web应用发布了一个非常基本的应用.我在发布此问题之前进行了搜索,发现了一些参考文献

I am new to Angular2 and just published a very basic app to Azure web app. I searched before posting this question and found couple of references

http://abusanad.net/2016/07/24/publish-angular-2-app-from-visual-studio-to-azure/ 将Angular 2应用程序部署到Azure

按照这些文章中的步骤操作后,我访问了WebApp,并在浏览器控制台中看到带有404找不到文件的错误.

After following the steps in these articles, I accessed my WebApp and I see errors in browser console with 404 not found files.

System.import('main.js').catch(function(err){ console.error(err); });

此处附有异常详细信息的图片

我还检查了npm(3.10.8)&的版本.我的Web应用程序中的nodejs(v6.9.1).好像很好.

I also checked the versions of npm(3.10.8) & nodejs(v6.9.1) in my webapp. Seems like its good.

感谢您的帮助!谢谢.

推荐答案

在将引擎版本添加到package.json之后,该问题已得到解决:)

After adding the engines version to package.json, the issue got fixed :)

引擎":{节点":6.9.1}(在我的情况下,这是版本)

"engines":{"node":6.9.1} (In my case, this is the version)

有关如何指定引擎版本的参考链接: https://docs.microsoft.com/zh-cn/azure/nodejs-specify-node-version-azure-apps

Link for reference on how to specify the engines version: https://docs.microsoft.com/en-us/azure/nodejs-specify-node-version-azure-apps

这篇关于未定义Azure返回系统中的Angular 2 Web应用程序错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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