我正在运行一个设置,它使用Azure Web Apps中的Github部署选项从Github自动部署我的应用程序。但是,我刚刚创建了一个新的Azure Web应用程序,并使用常用方法将我的应用程序部署到它,但是这次我的gulpfile.js中的Gulp函数无法运行。
查看我的日志后,我发现错误说明以下内容:
[17:12:08] Local gulp not found in D:\home\site\repository\src\Hood
[17:12:08] Try running: npm install gulp
所以我尝试直接在kudu控制台上运行npm install gulp
命令。我收到以下错误......
D:\home\site\repository>npm install gulp
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: 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
这里是我的scripts
文件的project.json
部分,应该(我认为)安装gulp(如果需要),然后运行名为publish
的gulp函数...总是在......之前工作。
"scripts": {
"prepublish": [ "npm install", "bower install", "npm install gulp", "gulp publish" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
有什么想法吗?
答案 0 :(得分:3)
这很可能是Windows路径长度问题。尝试使用npm 3.x,因为它解决了很多这些问题。尝试在Azure应用设置中将WEBSITE_NODE_DEFAULT_VERSION
设置为6.9.1
,这将为您提供更新的节点和更新的npm。