gpt4 book ai didi

asp.net - Azure Web应用程序Kudu配置

转载 作者:太空宇宙 更新时间:2023-11-04 02:13:15 24 4
gpt4 key购买 nike

有没有人有一个示例,可以为 asp.Net 应用程序自定义 kudu 以运行 npm、bower 和 typescript 编译 gulp/grunt 脚本作为 CI 过程的一部分?

我有一个 webslot,其中配置了我的存储库分支的部署源。推送到存储库时,网络槽会同步。我尝试自定义要运行的部署.cmd,但根据我安装的 npm/node 版本出现错误。

是否有另一种方法可以强制在 asp.net 站点的 Web 插槽中运行 npm/node 的版本?我尝试过指定这些应用程序设置,

WEBSITE_NODE_DEFAULT_VERSION = 4.4.3
WEBSITE_NPM_DEFAULT_VERSION = 3.8.9

但是运行npm -v给了我1.1.37

运行 node -v 给出 v0.10.28 和以下错误

Window title cannot be longer than 1023 characters.
At line:1 char:1
+ node -v
+ ~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : Argument

在 d:\home\site\wwwroot 中运行 npm install 也失败

PS D:\home\site\wwwroot> npm install
npm WARN package.json <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="325053414053461c5d405572031c021c02" rel="noreferrer noopener nofollow">[email protected]</a> No README.md file found!
npm http GET https://registry.npmjs.org/typings
npm http GET https://registry.npmjs.org/gulp-tslint
npm http GET https://registry.npmjs.org/gulp-bower
npm http GET https://registry.npmjs.org/gulp-debug
npm http GET https://registry.npmjs.org/gulp-sourcemaps
npm http GET https://registry.npmjs.org/gulp-rimraf
npm http GET https://registry.npmjs.org/gulp-inject
npm http GET https://registry.npmjs.org/gulp
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/gulp-typescript
npm http GET https://registry.npmjs.org/gulp-debug
npm http GET https://registry.npmjs.org/gulp-rimraf
npm http GET https://registry.npmjs.org/gulp-bower
npm http GET https://registry.npmjs.org/gulp
npm http GET https://registry.npmjs.org/gulp-inject
npm http GET https://registry.npmjs.org/gulp-sourcemaps
npm http GET https://registry.npmjs.org/gulp-tslint
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/typings
npm http GET https://registry.npmjs.org/gulp-typescript
npm http GET https://registry.npmjs.org/gulp-rimraf
npm http GET https://registry.npmjs.org/gulp-debug
npm ERR! Error: SSL Error: CERT_UNTRUSTED
npm ERR! at ClientRequest.<anonymous> (D:\Program Files (x86)\nodejs\node_modules\npm\node_modules\request\main.js:440:26)
npm ERR! at ClientRequest.g (events.js:156:14)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.parserOnIncomingClient (http.js:1256:7)
npm ERR! at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:91:29)
npm ERR! at CleartextStream.socketOnData (http.js:1288:20)
npm ERR! at CleartextStream._push (tls.js:375:27)
npm ERR! at SecurePair.cycle (tls.js:734:20)
npm ERR! at EncryptedStream.write (tls.js:130:13)
npm ERR! at Socket.ondata (stream.js:38:26)
npm ERR! [Error: SSL Error: CERT_UNTRUSTED]
npm ERR! You may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4f213f22620f28202028232a283d203a3f3c612c2022" rel="noreferrer noopener nofollow">[email protected]</a>>

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "D:\\Program Files (x86)\\nodejs\\\\node.exe" "D:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd D:\home\site\wwwroot
npm ERR! node -v v0.6.20
npm ERR! npm -v 1.1.37
npm ERR! message SSL Error: CERT_UNTRUSTED
npm http GET https://registry.npmjs.org/gulp-bower
npm http GET https://registry.npmjs.org/gulp
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/gulp-sourcemaps
npm http GET https://registry.npmjs.org/gulp-inject
npm http GET https://registry.npmjs.org/gulp-tslint
npm http GET https://registry.npmjs.org/typings
npm http GET https://registry.npmjs.org/gulp-typescript

我应该运行存储库文件夹中的所有操作命令/脚本吗?然后全部复制到wwwroot文件夹?

最佳答案

对于“CERT_UNTRUSTED”错误,您可以使用以下 cmd 绕过 https:

npm config set strict-ssl false

或者执行这个:

process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';

关于asp.net - Azure Web应用程序Kudu配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36998168/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com