在当地的iis上运行gup build in kudu

时间:2016-05-16 15:13:53

标签: node.js git gulp kudu

我在本地版本的Kudu上运行了一些测试,并尝试了解如何在将输出的构建同步到wwwroot文件夹之前运行gulp构建过程。

我的网络项目结构如下:

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

运行gulp会在项目根目录的build文件夹中生成构建。 这样设置的原因是为了确保在运行部署或ftp上载时,不会在Web上公开任何git节点或预先编译的源文件。

我无法弄清楚如何让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中纠正。

非常感谢任何正确方向的帮助

1 个答案:

答案 0 :(得分:1)

我发现了EPERM问题。 在IIS应用程序池中,需要将身份设置为本地系统