Yasser Shaikh
Yasser Shaikh

Reputation: 47784

Unable to publish node js site to azure using Visual Studio 2013

I am publishing my node js site to azure using this tutorial - http://blogs.technet.com/b/sams_blog/archive/2014/11/14/azure-websites-deploy-node-js-website-using-visual-studio.aspx

I get the following error, as mentioned in one of the comments on the blog, any idea what this error is about and how do I fix this ? I am able to run my app locally no issues with that.

Error: InvalidParameter Parameter name: index

enter image description here

P.s : the site is like a very basic "Hello world" kind of site, this is the first time I am using and deploying to azure too.

Upvotes: 6

Views: 710

Answers (3)

RickWeb
RickWeb

Reputation: 2105

I had this issue with some projects but not with others, all created in a similar way. So I went thought every change and every setting I could until eventually i worked it out. I didn't want to give up and just remake them.

Basically its file paths, the first thing you notice is that it errors very quickly compared to a usual publish, the first thing that is triggered is a build but unlike heavy framework languages there not really much to actually build.

Like all builds for VS it pops out a bin folder take not of where this appears. This is the key, you want this to appear in the root of your deployment usually at the same level as the publish profile.

Before I moved my projects to VS, TFS and Azure, I used to use git and used the azure push and deployment as part of git, so I instinctively structured my folders in the similar fashion with src folder and all the extra VS baggage in the a directory higher.

This is where I noticed bin folder, so re-structured my solution and made changes to .njsproj (notepad) and moved to be inline with source code and re-added it yo my solution.

Technically speaking this a bug within VS as it allows to create the project and specify different locations which is all fine unless you want to build and publish locally.

Once you get your head around what is going on you should be able to solve this problem easily and not make the same mistake in the future. If anyone is still confused comment and ill grab some screen shots.

Upvotes: 0

Ed Harrod
Ed Harrod

Reputation: 3619

I created a new project as a "Blank Azure Node.js web application", and replaced the resulting package.json and .js files with what I had before, and it publishes fine now

Upvotes: 3

Paul Harding
Paul Harding

Reputation: 43

All was working fine for and suddenly got the error! I pretty sure it something in the project as it's now happening on vs2013 and vs2015 on different computers.

Its something to do with Templates after a lot of searching. For me Azure TFS CI got things working again if possible for you?

Upvotes: 0

Related Questions