节点js部署“SyntaxError:Unexpected token ...” [英] Node js deployment "SyntaxError: Unexpected token ..."

查看:304
本文介绍了节点js部署“SyntaxError:Unexpected token ...”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我按照本指南https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-nodejs-develop-deploy-app创建了一个有效的网络应用程序我的资源组。


我也可以将我的VSTS git连接到这个Web应用程序以进行持续集成。


在我的本地IIS中,我能够运行nodejs app没有问题,安装了iisnode。我在Azure上设置的CI在Azure上部署完全相同的文件。


部署后,我从ftp://< app> / LogFiles / Application / logging-获取此信息errors.txt


 SyntaxError:意外的令牌... 
at exports.runInThisContext(vm.js: 53:16)
在Module._compile(module.js:373:25)
在Object.Module._extensions..js(module.js:416:10)
在Module。 load(module.js:343:32)
在Function.Module._load(module.js:300:12)
在Module.require(module.js:353:17)
at require(internal / module.js:12:17)
at Object。< anonymous> (D:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ._extensions..js(module.js:416:10)

唯一的区别是本地我运行节点9.2,那个Azure只安装了8.3。


任何想法?

解决方案

由于没有确切的错误消息,因此很难调试这里出了什么问题。


我建议你参考

在Azure云服务中启用Azure诊断


使用持续交付发布到Azure时启用远程调试

用于解决此问题的根本原因。


------------------------------------------- -------------------------------------------------- -

点击帮助您的帖子上的"标记为答案"和"投票为有用",这对其他社区成员有益。


So I followed this guide https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-nodejs-develop-deploy-app and created a working web app in my resource group.

I am also able to hook up my VSTS git to this Web app for continuous integration.

In my local IIS, I am able to run nodejs app no issue, with iisnode installed. The CI I have setup on azure deploys exactly the same files on Azure.

After deploying, I am getting this from the ftp://<app>/LogFiles/Application/logging-errors.txt

SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (D:\home\site\wwwroot\build\mphwebserver.js:6:25)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

The only difference is that locally I run node 9.2, and that Azure only has 8.3 installed.

Any ideas?

解决方案

Since there is no exact error message, it is difficult to debug what went wrong here.

I would suggest you refer Enabling Azure Diagnostics in Azure Cloud Services and Enable remote debugging when using continuous delivery to publish to Azure for getting to the root cause of this issue.

-----------------------------------------------------------------------------------------------
Do click on "Mark as Answer" and "Vote as Helpful" on the post that helps you, this can be beneficial to other community members.


这篇关于节点js部署“SyntaxError:Unexpected token ...”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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