0

We are trying to move a node.js app that requires node v0.11.x to Azure WebSites.

When trying to use azure-node-runtime-selector to install node v0.11.x, we encounted what seems a bug caused by nodist installing npm 2.0.0-alpha.

Below the output of call to nodist update:

          1 file(s) copied.
  npm http GET https://registry.npmjs.org/npm
  npm http 304 https://registry.npmjs.org/npm
  npm http GET https://registry.npmjs.org/npm/2.0.0-alpha-5
  npm http 304 https://registry.npmjs.org/npm/2.0.0-alpha-5
  D:\home\node\nodist\bin\npm -> D:\home\node\nodist\bin\node_modules\npm\bin\npm-cli.js
  npm@2.0.0-alpha-5 D:\home\node\nodist\bin\node_modules\npm
  'ode' is not recognized as an internal or external command,
          1 file(s) moved.
  operable program or batch file.
  Install dependencies...

Any ideas on how to either solve this or, alternatively, how to force nodist to keep using npm v1.4.*?

JoaoCC
  • 624
  • 6
  • 15

2 Answers2

1

If you don't mind an alternative solution, you can use this guide under the section "Using a custom version with Azure Web Sites". The only important step is to bring your own node.exe with your app, and set "nodeProcessCommandLine: " in iisnode.yml to your node.exe's path.

Edit: See github.com/mtian/custom-version for an example.

mtian
  • 131
  • 3
  • Looks like a good solution to the node part. Will test it today. What do you suggest regarding npm? Thanks – JoaoCC Aug 08 '14 at 14:41
  • Also: - is this compatible with the use of a custom deployment script? Thx – JoaoCC Aug 08 '14 at 14:50
  • Currently when you create a new site, Azure Websites uses by default npm@1.4.10. If you are going to use a custom deployment script based on the default deployment script, it will use this version of npm as well. The above method should work too because the default deployment script does not modify the nodeProcessCommandLine set by user. – mtian Aug 08 '14 at 17:34
  • Well, this leaves 2 questions: 1. how to pass a command line argument to node (having "...\node.exe --harmony" added to the path in "nodeProcessCommandLine" doesn't work; it seems to require a path) 2. the npm.cmd, grunt.cmd or bower.cmd (for instance) try to find "node.exe" in the cwd and, failing to do so, use the default node.exe (calling "node.exe" w/o path) Thanks – JoaoCC Aug 08 '14 at 18:28
  • For the 1st question, you will probably need the full path of node.exe, and have the harmony flag outside of double quotes. See https://github.com/mtian/custom-version. For the 2nd question, you can copy node.exe to %APPDATA%\Roaming\npm, and install npm, grunt-cli and bower with -g. – mtian Aug 08 '14 at 19:51
  • @mtian The iisnode.yml approach did not work for me. If you got this working, can you see my question here: http://stackoverflow.com/questions/25410810/node-0-11-x-in-azure – JohnD Aug 20 '14 at 17:21
0

Looks like there's a typo somewhere (it's failing on 'ode' which should probably be 'node'). You could try finding where that typo is coming from and fix it.

Zain Rizvi
  • 23,586
  • 22
  • 91
  • 133