{"id":39094,"date":"2020-04-18T09:09:39","date_gmt":"2020-04-18T16:09:39","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/premier-developer\/?p=39094"},"modified":"2020-04-15T09:18:09","modified_gmt":"2020-04-15T16:18:09","slug":"ghost-update-take-two-64-bit-nodejs","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/ghost-update-take-two-64-bit-nodejs\/","title":{"rendered":"Ghost Update Take Two &#8211; 64-bit NodeJS"},"content":{"rendered":"<p>App Dev Manager\u00a0<a href=\"https:\/\/www.linkedin.com\/in\/chris-tjoumas-pmp-9344558\/\" target=\"_blank\" rel=\"noopener noreferrer\">Chris Tjoumas<\/a> provides an update to his previous post on how to setup continuous deployment of a blog using Ghost, Azure Functions, and Azure App Services.<\/p>\n<hr \/>\n<p>In my <a href=\"https:\/\/devblogs.microsoft.com\/premier-developer\/creating-a-ghost-blog-on-an-azure-app-service\/\">previous<\/a> post, I explained how to deploy Ghost on Azure Web Apps; however, Ghost v2.25.5 now requires Node.JS 64-bit to support the <a href=\"https:\/\/www.npmjs.com\/package\/sharp\" target=\"_blank\" rel=\"noopener noreferrer\">sharp<\/a> package v0.22.1. If you followed my initial instructions to create the free App Service, you will notice that this build will break your post images. The <strong>sharp<\/strong> package is used to convert those posted images into optimized formats for performance. Without a functional <strong>sharp<\/strong> package, the Web App performance will be noticeably slower.<\/p>\n<p>I did a bit of research into this and posted blog listing steps needed to configure your Windows Web App Service to use 64-bit Node.js. However, it turned out that while this seemed to work, node was still running in 32-bit. You can check this by running <strong>node -p \u201cprocess.arch\u201d<\/strong> would return x32.<\/p>\n<p>While I was looking into this, <a href=\"https:\/\/jessicadeen.com\">Jessica Deen<\/a> reached out to me to ask how I was able to get this configured \u2013 of course, I had recently found out that I hadn\u2019t gotten this 100% correct. We worked together a bit to figure out how we could accomplish this and a little after we started, Jessica told me that she spoke with the product group to uncover what is needed, which isn\u2019t documented yet. While I had gone into Kudu to pull out the supported NodeJS and NPM versions (which would change over time and cause you to continue running through this exercise), you simply need to set a single environment variable, as shown below. The only pre-requisite is that you must have an app service plan SKU of Basic or higher, which supports 64-bit. Without further ado, here\u2019s what you need to do:<\/p>\n<ol>\n<li>Make sure you don\u2019t have any customizations! Delete any environment variables, custom kudu deployments (deploy.cmd), and anything in iisnode.yml<\/li>\n<li>Set the Node.JS version\n<ol style=\"list-style-type: lower-alpha;\">\n<li>Navigate to your Web App in the Azure Portal<\/li>\n<li>Click on Configuration<\/li>\n<li>Under<strong> Application settings<\/strong>, edit the WEBSITE_NODE_DEFAULT_VERSION and enter ~10 and click Save\n<img decoding=\"async\" width=\"450\" height=\"37\" class=\"wp-image-39096\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-34.png\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-34.png 450w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-34-300x25.png 300w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><\/li>\n<\/ol>\n<\/li>\n<li>Set your web app Platform to 64-Bit\n<ol style=\"list-style-type: lower-alpha;\">\n<li>Click <strong>General settings<\/strong> and change Platform to 64 Bit<\/li>\n<li><img decoding=\"async\" width=\"320\" height=\"114\" class=\"wp-image-39097\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/platform-settings-platform-bit.png\" alt=\"Platform settings Platform Bit \" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/platform-settings-platform-bit.png 320w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/platform-settings-platform-bit-300x107.png 300w\" sizes=\"(max-width: 320px) 100vw, 320px\" \/><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>As noted above, once you complete these updates, you can run the <strong>node -p \u201cprocess.arch\u201d<\/strong> command to see that it will now return x64.<\/p>\n<p><img decoding=\"async\" width=\"394\" height=\"241\" class=\"wp-image-39098\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-35.png\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-35.png 394w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-35-300x184.png 300w\" sizes=\"(max-width: 394px) 100vw, 394px\" \/><\/p>\n<p>Please give <a href=\"https:\/\/jessicadeen.com\/running-64bit-node-web-app-windows-app-service\/\">Jessica\u2019s 64-bit blog post<\/a> a read as there are a few more details there as well as instructions on how to create an ARM template which will create everything you need.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my previous post, I explained how to deploy Ghost on Azure Web App; however, Ghost v2.25.5 now requires Node.JS 64-bit to support the sharp package v0.22.1. If you followed my initial instructions to create the free App Service, you will notice that this build will break your post images. <\/p>\n","protected":false},"author":582,"featured_media":39095,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[25],"tags":[53,24,97,156,7420,3],"class_list":["post-39094","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","tag-app-services","tag-azure","tag-azure-container-registry","tag-azure-functions","tag-ghost","tag-team"],"acf":[],"blog_post_summary":"<p>In my previous post, I explained how to deploy Ghost on Azure Web App; however, Ghost v2.25.5 now requires Node.JS 64-bit to support the sharp package v0.22.1. If you followed my initial instructions to create the free App Service, you will notice that this build will break your post images. <\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/39094","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=39094"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/39094\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/39095"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=39094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=39094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=39094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}