【问题标题】:Gulp failed after push推送后 Gulp 失败
【发布时间】:2017-07-23 18:07:55
【问题描述】:

所以我完成了本教程,(使用 Node.js 的基本 Azure Cosmos DB (MongoDB))

https://docs.microsoft.com/en-us/azure/app-service-web/app-service-web-tutorial-nodejs-mongodb-app

我没有改变代码中的任何内容,只是教程所说的内容和之后 git push azure master我明白了 gulp failed(link to image)

有没有人知道这个错误是怎么来的?

编辑:deploy.sh Gulp 部分

if [ -e "$DEPLOYMENT_TARGET/gulpfile.js" ]; then
  cd "$DEPLOYMENT_TARGET"
    eval ./node_modules/.bin/gulp imagemin
   eval ./node_modules/.bin/gulp prod    <----I added this line and still fails
  exitWithMessageOnError "gulp failed"
  cd - > /dev/null
fi

package.json 仅 Gulp 部分

{
  "name": "meanjs",
  "description": "Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js.",
  "version": "0.5.0",
  "meanjs-version": "0.5.0",
  "private": false,
  "author": "https://github.com/meanjs/mean/graphs/contributors",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/meanjs/mean.git"
  },
  "engines": {
    "node": "6.9.1",
    "npm": "3.10.8"
  },
  "scripts": {
    "update": "npm update && npm prune && npm run bower",
    "clean": "rm -rf node_modules/ public/lib/",
    "reinstall": "npm cache clean && npm run clean && npm install",
    "start": "gulp",
    "start:prod": "gulp prod",
    "start:debug": "node-debug --web-host 0.0.0.0 server.js & gulp debug",
    "gulp": "gulp",
    "bower": "bower install --allow-root && bower prune --allow-root",
    "lint": "gulp lint",
    "test": "gulp test",
    "test:server": "gulp test:server",
    "test:server:watch": "gulp test:server:watch",
    "test:client": "gulp test:client",
    "test:e2e": "gulp test:e2e",
    "test:coverage": "gulp test:coverage",
    "postinstall": "npm run bower",
    "generate-ssl-certs": "scripts/generate-ssl-certs.sh"
  },
  "dependencies": {

    "passport-google-oauth": "~1.0.0",
    "passport-linkedin": "~1.0.0",
    "passport-local": "~1.0.0",
    "passport-paypal-openidconnect": "~0.1.1",
    "passport-twitter": "~1.0.4",
    "serve-favicon": "~2.4.2",
    "socket.io": "^2.0.2",
    "validator": "~7.0.0",
    "winston": "^2.3.1",
    "wiredep": "~4.0.0"
  },
  "devDependencies": {
    "gulp": "^3.9.1",
    "gulp-angular-templatecache": "~2.0.0",
    "gulp-autoprefixer": "~3.1.0",
    "gulp-concat": "~2.6.0",
    "gulp-csslint": "~1.0.0",
    "gulp-csso": "~3.0.0",
    "gulp-eslint": "~3.0.1",
    "gulp-imagemin": "~3.2.0",
    "gulp-istanbul": "~1.1.1",
    "gulp-less": "~3.3.0",
    "gulp-load-plugins": "~1.5.0",
    "gulp-mocha": "~3.0.1",
    "gulp-ng-annotate": "~2.0.0",
    "gulp-nodemon": "~2.2.1",
    "gulp-protractor": "^4.0.0",
    "gulp-refresh": "~1.1.0",
    "gulp-rename": "~1.2.2",
    "gulp-rev": "^7.1.2",
    "gulp-sass": "~3.1.0",
    "gulp-uglify": "~2.1.2",
    "gulp-util": "~3.0.7",
  }
}

我在推送日志开始时也收到此错误

remote: glob error { Error: ENOTSUP: operation not supported on socket, scandir 'D:\home\site\wwwroot\node_modules\phant
omjs-prebuilt\node_modules\request\node_modules\http-signature\node_modules\sshpk\bin\sshpk-conv'
remote:     at Error (native)

Edit2:错误发生了一些变化

remote: An error has occurred during web site deployment.
remote:     throw err;
remote: gulp failed
remote:           ^
remote: Error: Cannot find module 'readable-stream/transform'

【问题讨论】:

  • 欢迎来到 StackOverflow。您在发布问题时可能已经注意到,您会被告知您缺乏在其中发布图像的声誉。设置此上限的原因是“我们真的不希望您发布图片”,我们希望您在声望提高以允许发布图片时吸取教训。我们不想要它们的原因是因为“您的错误输出来自终端并在 text 中”。就像您编写的代码在“文本”中一样,就像问题在“文本”中措辞一样。请将错误和代码发布为“文本”仅。请不要截图。
  • 也就是说。您的屏幕截图中的具体错误似乎表明您实际上完全错过了npm install 步骤。我建议您从头开始学习您的教程,最好从一个干净的目录开始。这次按照所有说明进行操作。
  • npm install 已执行,我从 Azure 执行 npm install 的服务器部分收到此错误,而不是我
  • 另外你显然没有install gulp。该页面上有一个先决条件列表。停止并重新开始,并真正按照所有说明进行操作。
  • 如果服务器在本地运行意味着我没有安装 gulp ?我安装了它并在 51.731 秒内更新了 1 个包,所以它就在那里

标签: node.js git mongodb azure gulp


【解决方案1】:

您确实安装了gulp。确保您have installed gulp-cli。
并且,如“no command 'gulp' found - after installation”中所述

另外,node_modules/.bin/ 不在您的 %PATH% 中。
但它在运行npm 脚本时由npm 自动添加(参见this blog post for reference)。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2021-12-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多