Heroku错误:找不到带有nodejs deploy的模块“ knex”

时间:2019-10-25 00:19:39

标签: node.js heroku knex.js

我正打算部署Node.js应用程序,但出现错误Error: Cannot find module 'knex'。在Heroku bash中,node_modules中没有knex文件夹。我在Heroku bash中通过npm安装了knex,但是没有成功。我像this question中所述更改了package.json,但错误仍然相同。 这是我的package.json:

{
  "name": "control",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start":"node index.js"
  },
  "license": "ISC",
  "dependencies": {
    "bcrypt-nodejs": "0.0.3",
    "body-parser": "1.18.3",
    "consign": "0.1.6",
    "cors": "2.8.4",
    "express": "4.16.3",
    "jwt-simple": "^0.5.6",
    "knex": "0.19.5",
    "moment": "2.22.2",
    "mysql": "^2.17.1",
    "passport": "0.4.0",
    "passport-jwt": "4.0.0",
    "pg": "7.4.3",
    "pm2": "3.0.4"
  },
  "devDependencies": {
    "moment": "^2.20.1",
    "nodemon": "1.18.4"
  },
   "engines" : { 
     "node" : "10.16.3",
     "npm": "6.9.0"
     } 
}

0 个答案:

没有答案