推送被拒绝,无法编译Node.js应用

时间:2018-07-08 09:28:21

标签: node.js heroku webpack

我的意思是堆栈节点js应用程序,我试图将其部署到heroku,不幸的是,我收到以下消息。

remote:        Installing any new modules (package.json)
remote:        npm ERR! code EINVALIDTAGNAME
remote:        npm ERR! Invalid tag name "^6.0.0.beta.1": Tags may not have any characters that encodeURIComponent encodes.
remote:
remote:        npm ERR! A complete log of this run can be found in:
remote:        npm ERR!     /tmp/npmcache.3UQhB/_logs/2018-07-08T09_19_13_394Z-debug.log
remote:
remote: -----> Build failed
remote:
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote:        Some possible problems:
remote:
remote:        - node_modules checked into source control
remote:        https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits
remote:
remote:        - Node version not specified in package.json
remote:        https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote:        Love,
remote:        Heroku
remote:
remote:  !     Push rejected, failed to compile Node.js app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to proexebookingapp.
remote:
To https://git.heroku.com/proexebookingapp.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/proexebookingapp.git'

C:\Users\Bonge\Documents\Projects\bookinga

pp>

这是我的package.json文件

{
  "name": "movies-database",
  "version": "1.0.0",
  "description": "a simple movie database Rest API",
  "main": "index.js",
  "scripts": {
    "dev": "nodemon server.js"
  },
  "keywords": [],
  "author": "Geofrey Julius Zellah",
  "license": "ISC",
  "dependencies": {
    "body-parser": "^1.18.3",
    "bootstrap": "^3.3.7",
    "connect-flash": "^0.1.1",
    "cors": "^2.8.4",
    "express": "^4.16.3",
    "jquery": "^3.3.1",
    "mongodb": "^2.2.33",
    "mongoose": "^5.1.5",
    "node-rest-client": "^3.1.0",
    "nodemon": "^1.17.5",
    "request": "^2.87.0",
    "winston": "^3.0.0",
    "primeng": "^6.0.0.beta.1",
  "primeicons": "^1.0.0-beta.6"
  }
}

我尝试了与Google不同的方法,但没有任何帮助,也许有些人在heroku部署环境中知道了此问题,

请有人帮助我吗?任何帮助建议将不胜感激。

1 个答案:

答案 0 :(得分:0)

^6.0.0.beta.1不是有效的语义版本,这就是错误消息所说的内容。

semantic versioning spec所述,

  

预发行版本可以通过在补丁版本之后附加一个连字符和一系列由点分隔的标识符来表示。标识符只能包含ASCII字母数字和连字符[0-9A-Za-z-]。标识符不得为空。数字标识符不得包含前导零。预发行版本的优先级低于关联的普通版本。预发行版本表示该版本不稳定,可能无法满足其关联的正常版本所表示的预期兼容性要求。例如:1.0.0-alpha,1.0.0-alpha.1、1.0.0-0.3.7、1.0.0-x.7.z.92。

primeng旁已经有一个正确的Beta版本,

"primeicons": "^1.0.0-beta.6"

应该是:

"primeng": "^6.0.0-beta.1",