节点部署失败:新Azure站点

时间:2016-01-09 05:13:35

标签: node.js azure deployment azure-web-sites

我正在尝试将一个应用程序部署到Azure,它在本地工作正常,而且我很难弄清楚出了什么问题。

有人可能帮助破译这意味着什么>以下是Azure的部署日志:

Command: deploy.cmd
Handling node.js deployment.
KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
Copying file: 'package.json'
Using start-up script server.js from package.json.
Generated web.config.
Node.js versions available on the platform are: 0.6.20, 0.8.2, 0.8.19, 0.8.26, 0.8.27, 0.8.28, 0.10.5, 0.10.18, 0.10.21, 0.10.24, 0.10.26, 0.10.28, 0.10.29, 0.10.31, 0.10.32, 0.10.40, 0.12.0, 0.12.2, 0.12.3, 0.12.6, 4.0.0, 4.1.0, 4.1.2, 4.2.1, 4.2.2, 4.2.3, 4.2.4, 5.0.0, 5.1.1, 5.3.0.
Selected node.js version 5.3.0. Use package.json file to choose a different version.
Updating iisnode.yml at D:\home\site\wwwroot\iisnode.yml
npm WARN deprecated lodash@0.9.2: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0
npm WARN deprecated npmconf@2.1.1: this package has been reintegrated into npm and is now out of date with respect to npm
meanjs@0.4.2 D:\home\site\wwwroot
├─┬ acl@0.4.9 
│ ├─┬ mongodb@2.1.3 
│ │ ├── es6-promise@3.0.2 
│ │ ├── UNMET PEER DEPENDENCY kerberos@~0.0
│ │ ├─┬ mongodb-core@1.2.31 
│ │ │ └── bson@0.4.20 
│ │ └─┬ readable-stream@1.0.31 
│ │   ├── core-util-is@1.0.2 
│ │   └── string_decoder@0.10.31 
│ └─┬ redis@2.4.2 
│   ├── double-ended-queue@2.1.0-0 
│   └── redis-commands@1.0.2 
├── ansi-regex@2.0.0 
├── async@1.5.2 
├─┬ body-parser@1.14.2 
│ ├── bytes@2.2.0 
│ ├── content-type@1.0.1 
│ ├── debug@2.2.0 
│ ├── depd@1.1.0 
│ ├─┬ http-errors@1.3.1 
│ │ └── statuses@1.2.1 
│ ├── iconv-lite@0.4.13 
│ ├─┬ on-finished@2.3.0 
│ │ └── ee-first@1.1.1 
│ ├── qs@5.2.0 
│ ├─┬ raw-body@2.1.5 
│ │ └── unpipe@1.0.0 
│ └─┬ type-is@1.6.10 
│   ├── media-typer@0.3.0 
│   └── mime-types@2.1.9 
├─┬ cfenv@1.0.3 
│ ├─┬ js-yaml@3.4.6 
│ │ ├─┬ argparse@1.0.3 
│ │ │ └── sprintf-js@1.0.3 
│ │ ├── esprima@2.7.1 
│ │ └── inherit@2.2.2 
│ ├── ports@1.1.0 
│ └── underscore@1.8.3 
├─┬ chalk@1.1.1 
│ ├── escape-string-regexp@1.0.4 
│ ├── has-ansi@2.0.0 
│ ├── strip-ansi@3.0.0 
│ └── supports-color@2.0.0 
├─┬ compression@1.6.0 
│ ├─┬ accepts@1.3.0 
│ │ └── negotiator@0.6.0 
│ ├── bytes@2.1.0 
│ ├─┬ compressible@2.0.6 
│ │ └── mime-db@1.21.0 
│ ├── on-headers@1.0.1 
│ └── vary@1.1.0 
├── connect-flash@0.1.1 
├─┬ connect-mongo@0.8.2 
│ └─┬ mongodb@2.0.55 
│   ├── es6-promise@2.1.1 
│   └── UNMET PEER DEPENDENCY kerberos@~0.0
├── consolidate@0.13.1 
├─┬ cookie-parser@1.4.0 
│ ├── cookie@0.2.2 
│ └── cookie-signature@1.0.6 
├── crypto@0.0.3 
├─┬ express@4.13.3 
│ ├─┬ accepts@1.2.13 
│ │ └── negotiator@0.5.3 
│ ├── content-disposition@0.5.0 
│ ├── cookie@0.1.3 
│ ├── depd@1.0.1 
│ ├── escape-html@1.0.2 
│ ├── etag@1.7.0 
│ ├── finalhandler@0.4.0 
│ ├── fresh@0.3.0 
│ ├── merge-descriptors@1.0.0 
│ ├── methods@1.1.1 
│ ├── parseurl@1.3.0 
│ ├── path-to-regexp@0.1.7 
│ ├─┬ proxy-addr@1.0.10 
│ │ ├── forwarded@0.1.0 
│ │ └── ipaddr.js@1.0.5 
│ ├── qs@4.0.0 
│ ├── range-parser@1.0.3 
│ ├─┬ send@0.13.0 
│ │ ├── depd@1.0.1 
│ │ ├── destroy@1.0.3 
│ │ └── mime@1.3.4 
│ ├── serve-static@1.10.0 
│ ├── utils-merge@1.0.0 
│ └── vary@1.0.1 
├─┬ express-session@1.12.1 
│ ├── cookie@0.2.3 
│ ├── crc@3.3.0 
│ └── uid-safe@2.0.0 
├─┬ file-stream-rotator@0.0.6 
│ └── moment@2.3.1 
├─┬ forever@0.14.2 
│ ├─┬ cliff@0.1.10 
│ │ ├── colors@1.0.3 
│ │ └── eyes@0.1.8 
│ ├── colors@0.6.2 
│ ├─┬ flatiron@0.4.3 
│ │ ├─┬ broadway@0.3.6 
│ │ │ ├── cliff@0.1.9 
│ │ │ └─┬ winston@0.8.0 
│ │ │   └── async@0.2.10 
│ │ ├── director@1.2.7 
│ │ ├── optimist@0.6.0 
│ │ └─┬ prompt@0.2.14 
│ │   ├─┬ read@1.0.7 
│ │   │ └── mute-stream@0.0.5 
│ │   └── revalidator@0.1.8 
│ ├─┬ forever-monitor@1.5.2 
│ │ ├── minimatch@1.0.0 
│ │ ├─┬ ps-tree@0.0.3 
│ │ │ └─┬ event-stream@0.5.3 
│ │ │   └── optimist@0.2.8 
│ │ └─┬ watch@0.13.0 
│ │   └── minimist@1.2.0 
│ ├─┬ nconf@0.6.9 
│ │ ├── async@0.2.9 
│ │ ├── ini@1.3.4 
│ │ └── optimist@0.6.0 
│ ├─┬ nssocket@0.5.3 
│ │ └── lazy@1.0.11 
│ ├─┬ optimist@0.6.1 
│ │ ├── minimist@0.0.10 
│ │ └── wordwrap@0.0.3 
│ ├── timespan@2.3.0 
│ ├─┬ utile@0.2.1 
│ │ ├── async@0.2.10 
│ │ ├── deep-equal@1.0.1 
│ │ ├── i@0.3.3 
│ │ ├── ncp@0.4.2 
│ │ └─┬ rimraf@2.5.0 
│ │   └── glob@6.0.4 
│ └─┬ winston@0.8.3 
│   ├── async@0.2.10 
│   ├── cycle@1.0.3 
│   ├── isstream@0.1.2 
│   └── stack-trace@0.0.9 
├── generate-password@1.1.1 
├─┬ glob@5.0.15 
│ ├─┬ inflight@1.0.4 
│ │ └── wrappy@1.0.1 
│ ├── inherits@2.0.1 
│ ├─┬ minimatch@3.0.0 
│ │ └─┬ brace-expansion@1.1.2 
│ │   └── concat-map@0.0.1 
│ ├── once@1.3.3 
│ └── path-is-absolute@1.0.0 
├─┬ grunt@0.4.5 
│ ├── async@0.1.22 
│ ├── coffee-script@1.3.3 
│ ├── dateformat@1.0.2-1.2.3 
│ ├── eventemitter2@0.4.14 
│ ├── exit@0.1.2 
│ ├─┬ findup-sync@0.1.3 
│ │ ├─┬ glob@3.2.11 
│ │ │ └── minimatch@0.3.0 
│ │ └── lodash@2.4.2 
│ ├── getobject@0.1.0 
│ ├─┬ glob@3.1.21 
│ │ ├── graceful-fs@1.2.3 
│ │ └── inherits@1.0.2 
│ ├─┬ grunt-legacy-log@0.1.3 
│ │ ├─┬ grunt-legacy-log-utils@0.1.1 
│ │ │ ├── lodash@2.4.2 
│ │ │ └── underscore.string@2.3.3 
│ │ ├── lodash@2.4.2 
│ │ └── underscore.string@2.3.3 
│ ├─┬ grunt-legacy-util@0.2.0 
│ │ ├── async@0.1.22 
│ │ └── lodash@0.9.2 
│ ├── hooker@0.2.3 
│ ├── iconv-lite@0.2.11 
│ ├─┬ js-yaml@2.0.5 
│ │ ├─┬ argparse@0.1.16 
│ │ │ ├── underscore@1.7.0 
│ │ │ └── underscore.string@2.4.0 
│ │ └── esprima@1.0.4 
│ ├── lodash@0.9.2 
│ ├─┬ minimatch@0.2.14 
│ │ ├── lru-cache@2.7.3 
│ │ └── sigmund@1.0.1 
│ ├── nopt@1.0.10 
│ ├── rimraf@2.2.8 
│ ├── underscore.string@2.2.1 
│ └── which@1.0.9 
├─┬ grunt-cli@0.1.13 
│ └─�� resolve@0.3.1 
├─┬ helmet@0.9.1 
│ ├─┬ connect@3.3.5 
│ │ ├─┬ debug@2.1.3 
│ │ │ └── ms@0.7.0 
│ │ └─┬ finalhandler@0.3.4 
│ │   ├── escape-html@1.0.1 
│ │   └─┬ on-finished@2.2.1 
│ │     └── ee-first@1.1.0 
│ ├── depd@1.0.1 
│ ├── dont-sniff-mimetype@0.1.0 
│ ├─┬ frameguard@0.2.2 
│ │ └── lodash.isstring@3.0.1 
│ ├── helmet-crossdomain@0.1.0 
│ ├─┬ helmet-csp@0.2.3 
│ │ ├── camelize@1.0.0 
│ │ ├── core-util-is@1.0.1 
│ │ └── platform@1.3.0 
│ ├── hide-powered-by@0.1.0 
│ ├── hpkp@0.1.0 
│ ├─┬ hsts@0.1.3 
│ │ └── core-util-is@1.0.1 
│ ├── ienoopen@0.1.0 
│ ├── nocache@0.3.0 
│ └── x-xss-protection@0.1.2 
├── jasmine-core@2.4.1 
├── lodash@3.10.1 
├─┬ method-override@2.3.5 
│ └── vary@1.0.1 
├─┬ mocha@1.20.1 
│ ├── commander@2.0.0 
│ ├── diff@1.0.7 
│ ├─┬ glob@3.2.3 
│ │ ├── graceful-fs@2.0.3 
│ │ └── minimatch@0.2.14 
│ ├── growl@1.7.0 
│ ├─┬ jade@0.26.3 
│ │ ├── commander@0.6.1 
│ │ └── mkdirp@0.3.0 
│ └── mkdirp@0.3.5 
├─┬ mongoose@4.2.10 
│ ├── async@0.9.0 
│ ├── bson@0.4.19 
│ ├── hooks-fixed@1.1.0 
│ ├── kareem@1.0.1 
│ ├─┬ mongodb@2.0.49 
│ │ ├── es6-promise@2.1.1 
│ │ ├── UNMET PEER DEPENDENCY kerberos@~0.0
│ │ └── mongodb-core@1.2.24 
│ ├── mpath@0.1.1 
│ ├── mpromise@0.5.4 
│ ├─┬ mquery@1.6.3 
│ │ └── bluebird@2.9.26 
│ ├── ms@0.7.1 
│ ├── muri@1.0.0 
│ ├── regexp-clone@0.0.1 
│ └── sliced@0.0.5 
├─┬ morgan@1.6.1 
│ └── depd@1.0.1 
├─┬ multer@1.0.6 
│ ├─┬ busboy@0.2.12 
│ │ ├─┬ dicer@0.2.5 
│ │ │ ├── readable-stream@1.1.13 
│ │ │ └── streamsearch@0.1.2 
│ │ └── readable-stream@1.1.13 
│ ├─┬ concat-stream@1.5.1 
│ │ ├─┬ readable-stream@2.0.5 
│ │ │ ├── process-nextick-args@1.0.6 
│ │ │ └── util-deprecate@1.0.2 
│ │ └── typedarray@0.0.6 
│ ├─┬ mkdirp@0.5.1 
│ │ └── minimist@0.0.8 
│ ├── object-assign@3.0.0 
│ └── xtend@4.0.1 
├─┬ nodemailer@1.11.0 
│ ├─┬ libmime@1.2.0 
│ │ ├── libbase64@0.1.0 
│ │ └── libqp@1.1.0 
│ ├─┬ mailcomposer@2.1.0 
│ │ └─┬ buildmail@2.0.0 
│ │   └── needle@0.10.0 
│ ├── needle@0.11.0 
│ ├─┬ nodemailer-direct-transport@1.1.0 
│ │ └── smtp-connection@1.3.8 
│ └─┬ nodemailer-smtp-transport@1.1.0 
│   ├── clone@1.0.2 
│   └── nodemailer-wellknown@0.1.7 
├── owasp-password-strength-test@1.3.0 
├─┬ passport@0.2.2 
│ ├── passport-strategy@1.0.0 
│ └── pause@0.0.1 
├─┬ passport-facebook@2.0.0 
│ └─┬ passport-oauth2@1.1.2 
│   ├── oauth@0.9.14 
npm WARN mongodb-core@1.2.24 requires a peer of kerberos@~0.0 but none was installed.
│   └── uid2@0.0.3 
npm WARN mongodb-core@1.2.31 requires a peer of kerberos@~0.0 but none was installed.
├─┬ passport-github@0.1.5 
npm ERR! Windows_NT 6.2.9200
│ ├─┬ passport-oauth@0.1.15 
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\5.3.0\\node.exe" "D:\\Program Files (x86)\\npm\\3.5.1\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
│ │ ├── passport@0.1.18 
npm ERR! node v5.3.0
│ │ └── pkginfo@0.2.3 
npm ERR! npm  v3.5.1
│ └── pkginfo@0.2.3 
npm ERR! path D:\home\site\wwwroot\node_modules\.staging\wrappy-e5193d35318260dc6219dca3e7bd3562
├─┬ passport-google-oauth@0.2.0 
│ ├── passport-oauth@1.0.0 
npm ERR! code ENOENT
│ └── pkginfo@0.3.1 
npm ERR! errno -4058
├─┬ passport-linkedin@0.1.3 
npm ERR! syscall rename
│ └── pkginfo@0.2.3 
 ├── passport-local@1.0.0 
npm ERR! enoent ENOENT: no such file or directory, rename 'D:\home\site\wwwroot\node_modules\.staging\wrappy-e5193d35318260dc6219dca3e7bd3562' -> 'D:\home\site\wwwroot\node_modules\bower\node_modules\update-notifier\node_modules\latest-version\node_modules\package-json\node_modules\got\node_modules\duplexify\node_modules\end-of-stream\node_modules\once\node_modules\wrappy'
├─┬ passport-paypal-openidconnect@0.1.1 
npm ERR! enoent ENOENT: no such file or directory, rename 'D:\home\site\wwwroot\node_modules\.staging\wrappy-e5193d35318260dc6219dca3e7bd3562' -> 'D:\home\site\wwwroot\node_modules\bower\node_modules\update-notifier\node_modules\latest-version\node_modules\package-json\node_modules\got\node_modules\duplexify\node_modules\end-of-stream\node_modules\once\node_modules\wrappy'
│ ├─┬ passport-openidconnect@0.0.1 
npm ERR! enoent This is most likely not a problem with npm itself
│ │ ├── passport@0.1.18 
npm ERR! enoent and is related to npm not being able to find a file.
│ │ └── pkginfo@0.2.3 
npm ERR! enoent 
│ └── pkginfo@0.2.3 
├─┬ passport-twitter@1.0.3 
│ ├── passport-oauth1@1.0.1 
│ └─┬ xtraverse@0.1.0 
│   └── xmldom@0.1.19 
 ├─┬ phantomjs@1.9.19 
npm ERR! Please include the following file with any support request:
│ ├─┬ fs-extra@0.23.1 
npm ERR!     D:\home\site\wwwroot\npm-debug.log
│ │ ├── graceful-fs@4.1.2 
│ │ └── jsonfile@2.2.3 
│ ├── kew@0.4.0 
│ ├─┬ md5@2.0.0 
│ │ ├── charenc@0.0.1 
│ │ ├── crypt@0.0.1 
│ │ └── is-buffer@1.0.2 
│ ├─┬ npmconf@2.1.1 
│ │ ├─┬ config-chain@1.1.9 
│ │ │ └── proto-list@1.2.4 
│ │ ├── nopt@3.0.6 
│ │ ├─┬ osenv@0.1.3 
│ │ │ ├── os-homedir@1.0.1 
│ │ │ └── os-tmpdir@1.0.1 
│ │ ├── semver@4.3.6 
│ │ └── uid-number@0.0.5 
│ ├── progress@1.1.8 
│ ├─┬ request@2.42.0 
│ │ ├── bl@0.9.4 
│ │ ├── caseless@0.6.0 
│ │ ├── forever-agent@0.5.2 
│ │ ├─┬ form-data@0.1.4 
│ │ │ ├── async@0.9.2 
│ │ │ ├─┬ combined-stream@0.0.7 
│ │ │ │ └── delayed-stream@0.0.5 
│ │ │ └── mime@1.2.11 
│ │ ├─┬ hawk@1.1.1 
│ │ │ ├── boom@0.4.2 
│ │ │ ├── cryptiles@0.2.2 
│ │ │ ├── hoek@0.9.1 
│ │ │ └── sntp@0.2.4 
│ │ ├─┬ http-signature@0.10.1 
│ │ │ └── ctype@0.5.3 
│ │ ├── json-stringify-safe@5.0.1 
│ │ ├── mime-types@1.0.2 
│ │ ├─�� node-uuid@1.4.7 
│ │ ├── oauth-sign@0.4.0 
│ │ ├── qs@1.2.2 
│ │ ├── stringstream@0.0.5 
│ │ ├── tough-cookie@2.2.1 
│ │ └── tunnel-agent@0.4.2 
│ └─┬ request-progress@0.3.1 
│   └── throttleit@0.0.2 
├── semver-utils@1.1.1  extraneous
├── serve-favicon@2.3.0 
├─┬ socket.io@1.4.3 
│ ├─┬ engine.io@1.6.6 
│ │ ├─┬ accepts@1.1.4 
│ │ │ ├─┬ mime-types@2.0.14 
│ │ │ │ └── mime-db@1.12.0 
│ │ │ └── negotiator@0.4.9 
│ │ ├─┬ engine.io-parser@1.2.4 
│ │ │ ├── has-binary@0.1.6 
│ │ │ └── utf8@2.1.0 
│ │ └─┬ ws@1.0.1 
│ │   ├── options@0.0.6 
│ │   └── ultron@1.0.2 
│ ├─┬ has-binary@0.1.7 
│ │ └── isarray@0.0.1 
│ ├─┬ socket.io-adapter@0.4.0 
│ │ └─┬ socket.io-parser@2.2.2 
│ │   ├── debug@0.7.4 
│ │   └── json3@3.2.6 
│ ├─┬ socket.io-client@1.4.3 
│ �� ├── component-bind@1.0.0 
│ │ ├── component-emitter@1.2.0 
│ │ ├─┬ engine.io-client@1.6.6 
│ │ │ ├── component-inherit@0.0.3 
│ │ │ ├── has-cors@1.1.0 
│ │ │ ├── parsejson@0.0.1 
│ │ │ ├── parseqs@0.0.2 
│ │ │ ├── xmlhttprequest-ssl@1.5.1 
│ │ │ └── yeast@0.1.2 
│ │ ├── indexof@0.0.1 
│ │ ├── object-component@0.0.3 
│ │ ├─┬ parseuri@0.0.4 
│ │ │ └─┬ better-assert@1.0.2 
│ │ │   └── callsite@1.0.0 
│ │ ├─┬ socket.io-parser@2.2.5 
│ │ │ ├── component-emitter@1.1.2 
│ │ │ └── json3@3.3.2 
│ │ └── to-array@0.1.3 
│ └─┬ socket.io-parser@2.2.6 
│   ├── component-emitter@1.1.2 
│   └── json3@3.3.2 
├─┬ swig@1.4.2 
│ └─┬ uglify-js@2.4.24 
│   ├── async@0.2.10 
│   ├── source-map@0.1.34 
│   ├── uglify-to-browserify@1.0.2 
│   └─┬ yargs@3.5.4 
│     ├── camelcase@1.2.1 
│     ├── decamelize@1.1.2 
│     ├── window-size@0.1.0 
│     └── wordwrap@0.0.2 
└── validator@3.43.0 
 Failed exitCode=-4058, command="D:\Program Files (x86)\nodejs\5.3.0\node.exe" "D:\Program Files (x86)\npm\3.5.1\node_modules\npm\bin\npm-cli.js" install --production
An error has occurred during web site deployment.

我没有更改任何内容,因此这是Azure的默认deploy.cmd,但是如果它很重要,则在下面:

@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.6
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
goto Deployment

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

:Deployment
echo Handling node.js deployment.

:: 1. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Select node version
call :SelectNodeVersion

:: 3. Install npm packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd !NPM_CMD! install --production
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
IF !ERRORLEVEL! NEQ 0 goto error

goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

感谢您的帮助!我一直在努力调试最后2小时没有进展:-P。

Per Request当前的package.json:

{
  "name": "TallyCTF",
  "description": "CTF Scoreboard & Event Management Tool.",
  "author" : "Cyber Ninjas",
  "version": "0.4.2",
  "meanjs-version": "0.4.2",
  "private": false,
  "license": "Apache-2.0",
  "repository": {
    "type": "git",
    "url": "https://github.com/CyberNinjas/TallyCTF.git"
  },
  "engines": {
    "node": "5.3.0",
    "npm": "3.5.1"
  },
  "scripts": {
    "start": "node server.js",
    "test": "grunt test",
    "postinstall": "bower install --config.interactive=false"
  },
  "dependencies": {
    "acl": "~0.4.4",
    "async": "^1.3.0",
    "body-parser": "^1.13.1",
    "bower": "^1.4.1",
    "cfenv": "~1.0.0",
    "chalk": "^1.1.0",
    "compression": "^1.5.0",
    "connect-flash": "~0.1.1",
    "connect-mongo": "~0.8.1",
    "consolidate": "~0.13.1",
    "cookie-parser": "^1.3.2",
    "crypto": "0.0.3",
    "express": "^4.13.1",
    "express-session": "^1.11.3",
    "file-stream-rotator": "~0.0.6",
    "forever": "~0.14.2",
    "generate-password": "^1.1.1",
    "glob": "^5.0.13",
    "grunt": "0.4.5",
    "grunt-cli": "~0.1.13",
    "helmet": "~0.9.1",
    "jasmine-core": "^2.3.4",
    "lodash": "^3.10.0",
    "method-override": "^2.3.3",
    "mocha": "~1.20.0",
    "mongoose": "~4.2.3",
    "morgan": "^1.6.1",
    "multer": "~1.0.5",
    "nodemailer": "^1.4.0",
    "owasp-password-strength-test": "^1.3.0",
    "passport": "~0.2.2",
    "passport-facebook": "^2.0.0",
    "passport-github": "~0.1.5",
    "passport-google-oauth": "~0.2.0",
    "passport-linkedin": "~0.1.3",
    "passport-local": "^1.0.0",
    "passport-paypal-openidconnect": "^0.1.1",
    "passport-twitter": "^1.0.2",
    "phantomjs": ">=1.9.0",
    "serve-favicon": "^2.3.0",
    "socket.io": "^1.3.7",
    "swig": "^1.4.2",
    "validator": "^3.41.2"
  },
  "devDependencies": {
    "coveralls": "^2.11.4",
    "gulp": "^3.9.0",
    "gulp-angular-templatecache": "^1.7.0",
    "gulp-autoprefixer": "^2.3.1",
    "gulp-concat": "^2.6.0",
    "gulp-csslint": "~0.1.5",
    "gulp-cssmin": "~0.1.7",
    "gulp-eslint": "~1.0.0",
    "gulp-jshint": "^1.11.2",
    "gulp-less": "^3.0.3",
    "gulp-livereload": "^3.8.0",
    "gulp-load-plugins": "^1.0.0-rc.1",
    "gulp-mocha": "^2.1.2",
    "gulp-ng-annotate": "^1.0.0",
    "gulp-nodemon": "^2.0.3",
    "gulp-protractor": "^1.0.0",
    "gulp-rename": "^1.2.2",
    "gulp-sass": "^2.0.3",
    "gulp-uglify": "^1.2.0",
    "gulp-util": "^3.0.6",
    "istanbul": "~0.4.1",
    "karma": "~0.13.15",
    "karma-chrome-launcher": "~0.2.0",
    "karma-coverage": "~0.4.2",
    "karma-firefox-launcher": "~0.1.6",
    "karma-jasmine": "~0.3.6",
    "karma-ng-html2js-preprocessor": "^0.1.2",
    "karma-phantomjs-launcher": "~0.2.0",
    "load-grunt-tasks": "^3.2.0",
    "mock-fs": "~3.4.0",
    "run-sequence": "^1.1.1",
    "should": "^7.0.1",
    "supertest": "^1.0.1"
  }
}

2 个答案:

答案 0 :(得分:2)

好吧,它花了很多时间,一些预测和一些测试,但我终于有了这个工作。这个错误根本不直观。

我采取了哪些措施进行问题排查:

  1. 下载默认的MEANJS应用并尝试运行它。即使我的应用程序似乎没有node-sass的问题,但这种部署还是出于某种原因。
  2. 研究了node-sass,发现它与特定版本的C ++ Runtime存在问题。结果我想,&#34;嘿,也许C ++ Runtime是不匹配的?&#34;
  3. 在Kudo上找到Azure文档,讨论如何设置环境并提及变量MSBUILD_PATH(https://github.com/projectkudu/kudu/wiki/Deployment-hooks)。
  4. 用Google搜索MSBUILD_PATH并遇到一堆与各种Azure网站设置相关的错误。这引出了一个线程(https://github.com/projectkudu/kudu/issues/1659)。
  5. 在&#34;配置&#34;我在admin.windowsazure.com中的应用程序选项卡我将环境变量MSBUILD_PATH设置为: %ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe
  6. 来自&#34;部署&#34;选项卡我重新同步我的应用程序以触发重新部署。
  7. 因为缺少Kerberos而出现了关于失败的新错误,添加了此依赖项并重新同步。

    npm install kerberos -save

  8. 我的应用已成功部署。

  9. 以下线程也很有用,因为它们与节点有关,特别是节点上的MEANJS部署:

    https://groups.google.com/forum/#!topic/meanjs/LrHmE43RSvA http://shellmonger.com/2015/08/29/continuous-deployment-nodejs-and-microsoft-azure/

答案 1 :(得分:1)

我的猜测与nodejs版本有关。从日志中粘贴它是使用节点5.3.0

npm ERR! argv "D:\\Program Files (x86)\\nodejs\\5.3.0\\node.exe" "D:\\Program Files (x86)\\npm\\3.5.1\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"

您可以在本地检查您的计算机上的节点版本吗?

如果版本不同。您可以通过在package.json文件中定义“engine”属性来定位到特定节点版本,也可以通过Azure门户(https://portal.azure.com)定义应用程序设置,您的站点 - &gt;所有设置 - &gt;应用程序设置 - &gt;应用设置

键:WEBSITE_NODE_DEFAULT_VERSION,值:{version}

更新2016-01-09:

我觉得这两个文件夹可能是问题的原因

d:\家\站点\ wwwroot的\ node_modules.staging \ wrappy-e5193d35318260dc6219dca3e7bd3562

d:\家\网站\ wwwroot的\ node_modules \凉亭\ node_modules \更新通知程序\ node_modules \最新版本\ node_modules \包JSON \ node_modules \拿到\ node_modules \ duplexify \ node_modules \结束流\ node_modules \一旦\ node_modules \ wrappy

可以检查它们是否包含文件路径最大长度大于256的文件吗?如果是这样,它就会遇到Widows File API最大长度问题。

走动:尝试使用较新版本的passportjs,希望它不会有那么多嵌套依赖,否则,没有出路:( (既然你提到你的应用程序之前运行正常,请尝试回到任何一个旧部署,从日志中你应该看到你在那里使用的版本并尝试为所有软件包设置相同的版本)