在本地iis上运行kudu的gulp构建

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

我正在kudu的本地版本上运行一些测试,并试图了解如何在kudu将输出的构建同步到wwwroot文件夹之前运行gulp构建过程。
我的web项目的结构如下:

-bower_components/
-node_modules/
-source/
.bowerrc
.gitignore
bower.json
gulpfile.js
package.json

运行gulp会在项目根目录的生成文件夹中生成生成。设置此设置的原因是为了确保在运行部署或ftp上载时,任何git节点或预编译的源文件都不会暴露在web上。
我不知道如何让kudu先运行gulp构建任务,然后将构建输出的内容同步到wwwroot
我得到以下npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ 'c:\\Program Files (x86)\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install' ]
2 info using npm@2.15.1
3 info using node@v4.4.4
4 verbose stack Error: EPERM: operation not permitted, mkdir 'C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm'
4 verbose stack     at Error (native)
5 verbose cwd C:\kudu\apps\devsite\site\wwwroot
6 error Windows_NT 6.3.9600
7 error argv "c:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
8 error node v4.4.4
9 error npm  v2.15.1
10 error path C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm
11 error code EPERM
12 error errno -4048
13 error syscall mkdir
14 error Error: EPERM: operation not permitted, mkdir 'C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm'
14 error     at Error (native)
14 error  { [Error: EPERM: operation not permitted, mkdir 'C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm']
14 error   errno: -4048,
14 error   code: 'EPERM',
14 error   syscall: 'mkdir',
14 error   path: 'C:\\WINDOWS\\system32\\config\\systemprofile\\AppData\\Roaming\\npm' }
15 error Please try running this command again as root/Administrator.
16 verbose exit [ -4048, true ]

从部署日志

Updating branch 'master'.,cffcb371-6058-4ec3-aa69-a979ef8976a4,0
Updating submodules.,500605d6-55df-418c-bae1-1eb6ec24ec10,0
Preparing deployment for commit id '872c8ef074'.,936863bc-e83f-49ed-950a-cfb67aaaf10f,0
Generating deployment script.,2e77d73d-517a-47e6-b7da-b46ee6b0a34f,0
Using the following command to generate deployment script: 'azure site deploymentscript -y --no-dot-deployment -r "C:\kudu\apps\devsite\site\repository" -o "C:\kudu\apps\devsite\site\deployments\tools" --node --sitePath "C:\kudu\apps\devsite\site\repository"'.,,0
Generating deployment script for node.js Web Site,,0
Generated deployment script files,,0
Running deployment command...,f5250b3f-afeb-455e-bc2e-68f01a7200a0,0
Command: "C:\kudu\apps\devsite\site\deployments\tools\deploy.cmd",,0
Handling node.js deployment.,,0
KuduSync.NET from: 'C:\kudu\apps\devsite\site\repository' to: 'C:\kudu\apps\devsite\site\wwwroot',,0
Deleting file: 'hostingstart.html',,0
Copying file: '.bowerrc',,0
Copying file: '.gitignore',,0
Copying file: 'bower.json',,0
Copying file: 'gulpfile.js',,0
Copying file: 'package.json',,0
Copying file: 'README.md',,0
Copying file: 'source\.htaccess',,0
Copying file: 'source\.htpasswd',,0
Copying file: 'source\hero-banners.html',,0
Copying file: 'source\index.html',,0
Omitting next output lines...,,0
Invalid start-up command "npm install && bower install" in package.json. Please use the format "node <script relative path>".,,1
Looking for app.js/server.js under site root.,,0
Missing server.js/app.js files&comma; web.config is not generated,,1
The package.json file does not specify node.js engine version constraints.,,0
The node.js application will run with the default node.js version 4.4.4.,,0
One or more of the selected node/npm paths do not exist.,,0
Error: EPERM: operation not permitted&comma; mkdir 'C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm',,1
at Error (native),,1
,,1
Finished successfully.,,0
Deployment successful.,30b733dd-4038-4dbb-b103-b7852c2586c1,0

我假设其中一些错误是权限错误,我相信可以在iis中更正。
任何方向正确的帮助都将不胜感激

9rnv2umw

9rnv2umw1#

我发现了eperm的问题。在iis应用程序池中,需要将标识设置为本地系统

相关问题