Ember部署脚本在特定的npm软件包上失败

时间:2019-05-16 16:42:47

标签: ember.js ember-data ember-cli npm-install

我正在尝试使用ember deploy部署到我的登台环境中,并继续出现此错误,从而破坏了构建

An error occurred in the constructor for ember-cli-htmlbars-inline-precompile

我通过猜测并检查到特定的车把模板来跟踪问题,一旦注释掉,问题就解决了,并允许我完成脚本。不幸的是,我再次遇到同样的问题。当我在本地构建或运行应用程序时,不会发生此错误。

是我的package.json 我正在使用节点6.15.1 我已经尝试了v0.3.0,v0.4.0,v1.0.0和v2.0.0     ember-cli-htmlbars-inline-precompile无济于事。 我再次假设我的问题出在某些把手模板中,但是不幸的是,没有本地错误,我无法推断出位置。

  "name": "~~~",
  "description": "Small description for ~~~~ goes here",
  "private": true,
  "directories": {
    "doc": "doc",
    "test": "tests"
  },
  "scripts": {
    "start": "ember server",
    "build": "ember build",
    "test": "ember test",
    "lint": "eslint .",
    "postinstall": "./node_modules/bower/bin/bower install --allow-root"
  },
  "repository": "",
  "engines": {
    "node": "6.15.1"
  },
  "author": "",
  "license": "MIT",
  "devDependencies": {},
  "dependencies": {
    "@babel/core": "^7.4.4",
    "@newrelic/publish-sourcemap": "4.4.0",
    "active-model-adapter": "^2.2.0",
    "babel-eslint": "^7.0.0",
    "bower": "^1.8.2",
    "broccoli-asset-rev": "2.2.0",
    "broccoli-stew": "^2.1.0",
    "ember-ajax": "^3.0.0",
    "ember-cli": "~2.15.1",
    "ember-cli-app-version": "^3.0.0",
    "ember-cli-babel": "^6.7.1",
    "ember-cli-bootstrap-sass": "git+https://github.com/~~~/ember-cli-bootstrap-sass.git",
    "ember-cli-content-security-policy": "0.4.0",
    "ember-cli-dependency-checker": "^2.0.0",
    "ember-cli-deploy": "^1.0.2",
    "ember-cli-deploy-build": "^1.1.1",
    "ember-cli-deploy-change-log": "git+https://github.com/~~~~/ember-cli-deploy-change-log.git",
    "ember-cli-deploy-display-revisions": "^1.0.1",
    "ember-cli-deploy-gzip": "^1.0.1",
    "ember-cli-deploy-revision-data": "git+https://github.com/ember-cli-deploy/ember-cli-deploy-revision-data.git",
    "ember-cli-deploy-s3": "git+https://github.com/~~~/ember-cli-deploy-s3.git",
    "ember-cli-deploy-s3-index": "git+https://github.com/~~~/ember-cli-deploy-s3-index.git",
    "ember-cli-deploy-slack": "^1.0.1",
    "ember-cli-eslint": "^4.0.0",
    "ember-cli-flash": "^1.7.1",
    "ember-cli-htmlbars": "^2.0.1",
    "ember-cli-htmlbars-inline-precompile": "^2.0.0",
    "ember-cli-inject-live-reload": "^1.10.2",
    "ember-cli-inline-content": "^0.4.0",
    "ember-cli-loading-slider": "^2.0.0",
    "ember-cli-moment-shim": "^3.7.1",
    "ember-cli-phone-number": "^0.1.4",
    "ember-cli-pretender": "0.5.0",
    "ember-cli-qunit": "^4.0.0",
    "ember-cli-release": "0.2.9",
    "ember-cli-sass": "^10.0.0",
    "ember-cli-shims": "^1.1.0",
    "ember-cli-sri": "^2.1.0",
    "ember-cli-test-loader": "^2.2.0",
    "ember-cli-uglify": "^1.2.0",
    "ember-cli-velocity": "^0.4.0",
    "ember-cli-version-checker": "^2.1.2",
    "ember-click-outside": "0.1.12",
    "ember-composable-helpers": "2.1.0",
    "ember-data": "~2.16.3",
    "ember-decorators": "^2.5.2",
    "ember-export-application-global": "^2.0.0",
    "ember-faker": "1.1.0",
    "ember-inflector": "^2.3.0",
    "ember-link-action": "^0.1.3",
    "ember-load-initializers": "^1.0.0",
    "ember-moment": "^7.8.1",
    "ember-new-relic": "0.6.1",
    "ember-resolver": "^4.0.0",
    "ember-simple-auth": "^1.8.2",
    "ember-source": "^2.15.3",
    "ember-welcome-page": "^3.0.0",
    "eslint": "~2.2.0",
    "eslint-config-google": "^0.4.0",
    "eslint-config-xo": "^0.10.1",
    "eslint-plugin-babel": "^3.1.0",
    "express": "^4.16.4",
    "font-awesome": "^4.7.0",
    "glob": "^7.1.4",
    "jquery": "~2.2.4",
    "loader.js": "^4.7.0",
    "phantomjs-prebuilt": "^2.1.16",
    "rsvp": "^4.8.4",
    "sass": "^1.20.1",
    "velocity-animate": "^1.5.2"
  }
}```

1 个答案:

答案 0 :(得分:0)

通过使用GitHub中的url提取npm软件包,您将从GitHub中获取了这些软件包的最新代码。该代码不一定可以与您的其他依赖项一起使用,并且与自述文件中的内容相比,API可能会发生重大变化。

如果您从npm使用这些软件包的特定版本,我认为您的问题可能会消失。如果您要使用内部分叉,请考虑以最近的稳定版本为基础,而不要以这些软件包的master为基础。

部署可能不是真正的问题。如果您执行ember serve --production,该应用程序是否运行?生产标志将确保您的应用经历与deploy相同的所有编译和缩小。如果无法使用prod运行,则意味着您的应用中除那些GitHub url之外,还有其他问题。

我还建议使用这些依赖项创建一个新的2.15应用程序,以查看会发生什么情况。