Jorje Redemption
Jorje Redemption

Reputation: 879

Error when running npm install gulp on kudu

I am running a setup which automatically deploys my app from Github using the Github deployment option in Azure Web Apps. However, i have just created a new Azure web app and deployed my application to it using the usual method, however this time the Gulp functions in my gulpfile.js failed to run.

After looking through my logs, i found an error stating the following:

[17:12:08] Local gulp not found in D:\home\site\repository\src\Hood
[17:12:08] Try running: npm install gulp

So i tried running the npm install gulp command on the kudu console directly. And i get the following error...

D:\home\site\repository>npm install gulp
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\4.4.7\\node.exe" "D:\\Program Files (x86)\\npm\\2.15.8\\node_modules\\npm\\bin\\npm-cli.js" "install" "gulp"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! path D:\home\site\repository\node_modules\gulp\node_modules\gulp-util\node_modules\dateformat\node_modules\meow\node_modules\normalize-package-data\node_modules\validate-npm-package-license\node_modules\spdx-correct\node_modules\spdx-license-ids\package.json.1023181798
npm ERR! code EINVAL
npm ERR! errno -4071
npm ERR! syscall rename

npm ERR! EINVAL: invalid argument, rename 'D:\home\site\repository\node_modules\gulp\node_modules\gulp-util\node_modules\dateformat\node_modules\meow\node_modules\normalize-package-data\node_modules\validate-npm-package-license\node_modules\spdx-correct\node_modules\spdx-license-ids\package.json.1023181798' -> 'D:\home\site\repository\node_modules\gulp\node_modules\gulp-util\node_modules\dateformat\node_modules\meow\node_modules\normalize-package-data\node_modules\validate-npm-package-license\node_modules\spdx-correct\node_modules\spdx-license-ids\package.json'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     D:\home\site\repository\npm-debug.log

FYI here is the scripts section of my project.json file, which should (I thought) install gulp (if needed) and then run my gulp function called publish ...which always worked before...

"scripts": {
    "prepublish": [ "npm install", "bower install", "npm install gulp", "gulp publish" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}

Any ideas?

Upvotes: 4

Views: 897

Answers (1)

David Ebbo
David Ebbo

Reputation: 43193

It's most likely a Windows path length issue. Try using npm 3.x instead, as it solves a lot of those. Try setting WEBSITE_NODE_DEFAULT_VERSION to 6.9.1 in your Azure App Setting, which will give you both the newer Node and newer npm.

Upvotes: 3

Related Questions