在kudu上运行npm install gulp时出错

2nc8po8w  于 2021-06-20  发布在  Kudu
关注(0)|答案(1)|浏览(532)

我正在运行一个安装程序,它使用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

所以我试着运行 npm install gulp 直接在kudu控制台上执行命令。我得到以下错误。。。

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(如果需要的话),然后运行我的gulp函数 publish …以前一直有效。。。

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

有什么想法吗?

ogsagwnx

ogsagwnx1#

很可能是windows路径长度问题。尝试使用npm 3.x,因为它解决了很多问题。尝试设置 WEBSITE_NODE_DEFAULT_VERSION6.9.1 在你的azure应用程序设置中,这将为你提供更新的节点和新的npm。

相关问题