0
votes

I am following this guide. Having problem deploying to azure.

https://docs.microsoft.com/en-us/azure/app-service-web/app-service-web-nodejs-sails#step-3-configure-and-deploy-your-sailsjs-app

Full Error

remote: Failed exitCode=-4071, command="D:\Program Files (x86)\nodejs\6.9.1\node.exe" "D:\Program Files (x86)\npm\3.10.8\node_modules\npm\bin\npm-cli.js" install --production

also

remote: npm ERR! EINVAL: invalid argument, rename 'D:\home\site\wwwroot\node_modules\.staging\spdx-license-ids-3f30671f' -> 'D:\home\site\wwwroot\node_modules\sails-hook-grunt\node_modules\grunt-contrib-cssmin\node_modules\maxmin\node_modules\pretty-bytes\node_modules\meow\node_modules\normalize-package-data\node_modules\validate-npm-package-license\node_modules\spdx-correct\node_modules\spdx-license-ids'

Thanks

1
It's most likely due to the path length of the destination path, which is over 255 characters (Windows' typical path length restriction). This is actually why npm v3.x switched their nesting algorithm to pull nested dependencies into parent directories -- to avoid path length issues.mscdex
are you saying my npm is not 3.x? i need to update it?Logan_B
I'm using npm v4.1.2Logan_B
Do you have any update about this thread? If it is useful, please mark it that will help more communities.Tom Sun - MSFT

1 Answers

0
votes

I do a demo following the tutorials that you mentioned. It works correctly on my side. I used node.js v7.9 locally. If it is possible, please have a try to update the node.js version to latest locally. The following is my details steps.

enter image description here

1.Following the document to install Sails and create a demo project

$npm install sails -g

$sails new test-sails-project

enter image description here

2.go to localhost:1337 to see your brand new homepage

$ cd test-sails-project
$ sails lift
  1. We can check that it works correctly in the local

enter image description here

4.Following the document step by step

a.Add iisnode.yml file with the following code in the root directory

 loggingEnabled: true
 logDirectory: iisnode

b.set port and hookTimeout in the config/env/production.js

    module.exports = {

     // Use process.env.port to handle web requests to the default HTTP port
     port: process.env.port,
     // Increase hooks timout to 30 seconds
     // This avoids the Sails.js error documented at https://github.com/balderdashy/sails/issues/2691
     hookTimeout: 30000,

     ...
 };

c.hardcode the Node.js version you want to use. In package.json

     "engines": {
     "node": "6.9.1"
 },

5.Create a Azure WebApp on the Azure portal and get the profile.

enter image description here

6.Push the code to the Git remote and check from the Azure portal.

enter image description here

enter image description here