簡體   English   中英

錯誤:找不到模塊“ body-Parser”部署HEROKU

[英]Error: Cannot find module 'body-Parser' deploy HEROKU

我到處搜索,找不到解決方案

出現的錯誤 在此處輸入圖片說明

的package.json

 {
  "name": "apirest",
  "version": "1.0.0",
  "description": "API para consultar rucs de Paraguay por numero o nommbre",
  "main":"index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node index.js"
  },
  "author": "Daniel Resoalbe resoalbe@gmail.com",
  "license": "ISC",
  "dependencies": {
    "bcrypt-nodejs": "0.0.3",
    "body-parser": "^1.18.3",
    "crypto": "^1.0.1",
    "express": "^4.16.3",
    "express-handlebars": "^3.0.0",
    "jwt-simple": "^0.5.1",
    "moment": "^2.22.2",
    "mongoose": "^5.2.15"
  },
  "devDependencies": {
    "nodemon": "^1.18.4"
  }
}

我在Heroku中尋找解決方案,但沒有找到

就像haraldgangurde所說的那樣,很可能是一個錯字,而且即使您甚至不需要安裝正文解析器,默認情況下它也包含在express中。 您可以使用以下內置的中間件功能:

app.use(express.json());
app.use(express.urlencoded({ extended: false }));

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM