我正在为 node.js 使用 canvas 包
它在我的电脑上运行良好,但是每当我将它部署到 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
这是我的 package.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"
}
}```