Получение сообщения "Permission Denied" при попытке установить node.js canvas на Heroku - PullRequest
1 голос
/ 06 августа 2020

я использую пакет холста для node.js

он отлично работает на моем p c, но всякий раз, когда я развертываю его на heroku, я всегда получаю сообщение об ошибке, вот что я получаю

remote: -----> Installing dependencies
remote:        Prebuild detected (node_modules already exists)
remote:        Rebuilding any native modules
remote:
remote:        > canvas@2.6.1 install /tmp/build_f373ac33/node_modules/canvas
remote:        > node-pre-gyp install --fallback-to-build
remote:
remote:        sh: 1: node-pre-gyp: Permission denied
remote:        npm ERR! code ELIFECYCLE
remote:        npm ERR! errno 126
remote:        npm ERR! canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
remote:        npm ERR! Exit status 126
remote:        npm ERR!
remote:        npm ERR! Failed at the canvas@2.6.1 install script.
remote:        npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote:        npm ERR! A complete log of this run can be found in:
remote:        npm ERR!     /tmp/npmcache.bcUNy/_logs/2020-08-06T17_57_03_074Z-debug.log
remote:
remote: -----> Build failed

Я пробовал это руководство, но оно не сработало https://github.com/Automattic/node-canvas/wiki/Installation%3A-Heroku

вот мой пакет. json

  "name": "asta-bot",
  "version": "1.0.0",
  "description": "a discord bot",
  "main": "index.js",
  "scripts": {
    "start": "node index.js"
  },
  "keywords": [
    "hello"
  ],
  "engines": {
    "node": "13.3.x",
    "npm": "*"
  },
  "author": "reuben chagas fernandes",
  "license": "ISC",
  "dependencies": {
    "cleverbot-node": "^0.3.11",
    "decode-encode-binary": "^1.4.9",
    "didyoumean": "^1.2.1",
    "discord.js": "^12.2.0",
    "express": "^4.17.1",
    "ffmpeg": "^0.0.4",
    "google-tts-api": "0.0.4",
    "mal-scraper": "^2.7.1",
    "moment": "^2.24.0",
    "moment-timezone": "^0.5.31",
    "nodemon": "^2.0.2",
    "opusscript": "^0.0.7",
    "pg": "^8.0.2",
    "request": "^2.88.2",
    "simple-youtube-api": "^5.2.1",
    "translate": "^1.1.2",
    "trivia-api": "^1.0.1",
    "urban-dictionary": "^2.2.1",
    "weather-js": "^2.0.0",
    "wikifakt": "^1.0.3",
    "wikijs": "^6.0.1",
    "youtube-search": "^1.1.4",
    "ytdl-core": "^2.0.1"
  }
}```

Ответы [ 2 ]

0 голосов
/ 06 сентября 2020

ну, некоторые версии node-canvas не работают на heroku, используемая им версия холста - 2.6.1, а версия узла - 13.3.0

сборка не выполняется на другой версии node, она отлично работает на 13.3.0

0 голосов
/ 07 августа 2020

Попробуйте это.

npm config set user 0
npm config set unsafe-perm true
...