I have a discord.js bot and it runs on Heroku.
I added canvas just now, and now the bot is failing to build.
This is the log:
-----> Installing dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
> canvas#2.6.1 install /tmp/build_c8ad4f45_/node_modules/canvas
> node-pre-gyp install --fallback-to-build
sh: 1: node-pre-gyp: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! canvas#2.6.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the canvas#2.6.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.uZg6i/_logs/2021-01-01T17_53_37_239Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- node_modules checked into source control
https://devcenter.heroku.com/articles/node-best-practices#only-git-the-important-bits
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
I already installed node-pre-gyp as the log suggested, and nothing changed.
Here is package.json:
{
"dependencies": {
"canvas": "^2.6.1",
"discord.js": "^12.4.1",
"dotenv": "^8.2.0",
"firebase": "^8.1.1",
"firebase-admin": "^9.4.1",
"node-pre-gyp": "^0.11.0"
}
}
Does anyone know a solution to this?
Related
I'm running the follow command to push my app on Heroku 'git push heroku master', but it returns:
-----> Installing binaries
engines.node (package.json): 16.13.2
engines.npm (package.json): 8.1.2
Resolving node version 16.13.2...
Downloading and installing node 16.13.2...
npm 8.1.2 already installed with node
-----> Installing dependencies
Installing node modules (package.json)
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: paper-kit-2-angular#1.4.0
npm ERR! Found: zone.js#0.11.3
npm ERR! node_modules/zone.js
npm ERR! zone.js#"0.11.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer zone.js#"~0.10.3" from #angular/core#11.0.4
npm ERR! node_modules/#angular/core
npm ERR! #angular/core#"11.0.4" from the root project
npm ERR! peer #angular/core#"11.0.4" from #angular/common#11.0.4
npm ERR! node_modules/#angular/common
npm ERR! #angular/common#"11.0.4" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /tmp/npmcache.GEG9a/eresolve-report.txt for a full report.
Can anyone help me?
Add your local "node" and "npm" version to package.json. For example I did:
"engines": {
"node": "16.15.1",
"npm": "8.5.5"
},
Apparently for me the "knex" module that I use is not compatible with newer npm (I am not sure).
im trying to push my discord app to heroku but there are some problems, can someone help me?
i think this is from my npm or something idk
Resolving node version 14.x...
Downloading and installing node 14.17.1...
Using default npm version: 6.14.13
-----> Installing dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
> #discordjs/opus#0.5.3 install /tmp/build_b5827880/node_modules/#discordjs/opus
> node-pre-gyp install --fallback-to-build
sh: 1: node-pre-gyp: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! #discordjs/opus#0.5.3 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the #discordjs/opus#0.5.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.7tseI/_logs/2021-06-16T14_44_27_673Z-debug.log
-----> Build failed
Try to remove the node_modules folder and let heroku install them, make sure you have package.json
also check node-pre-gyp: Permission denied in heroku push
I'm following this tutorial to deploy the Strapi app to Heroku.
I have set up to auto-deploy from my Github repo.
After pushing to Github, I get the notification of build failure with the following message.
build log
-----> Building on the Heroku-20 stack
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): >=10.16.0 <=14.x.x
engines.npm (package.json): >=6.0.0
Resolving node version >=10.16.0 <=14.x.x...
Downloading and installing node 14.15.4...
Bootstrapping npm >=6.0.0 (replacing 6.14.10)...
npm >=6.0.0 installed
-----> Installing dependencies
Installing node modules (package.json)
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: drkang-strapi#0.1.0
npm ERR! Found: knex#0.19.5
npm ERR! node_modules/knex
npm ERR! knex#"<0.20.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer knex#"^0.20.0" from strapi-connector-bookshelf#3.4.6
npm ERR! node_modules/strapi-connector-bookshelf
npm ERR! strapi-connector-bookshelf#"3.4.6" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /tmp/npmcache.9OnCF/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.9OnCF/_logs/2021-02-04T02_14_54_807Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- Dangerous semver range (>) in engines.node
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
What should I do here? Any help would be appreciated.
I had the same issue today. It appears to me that the problem has to do with the version of knex not being compatible with the version of nodejs. After looking into it more, Strapi isn't compatible with nodejs over v.14 or npm over v.6 (Heroku was trying to build my Strapi app with node v.15). To resolve it, I updated the package.json file to make sure that Heroku uses the versions that are compatible. Here is what I added, it worked for me and I hope it works for you.
In the package.json file, update the versions of node and npm like this:
"engines": {
"node": "<=14.x.x",
"npm": "<=6.x.x"
}
In my case .npmrc solved this,
create .npmrc in the root of the project and allow legacy peer dependencies
legacy-peer-deps=true
Jryke's way solved my problem:
I added these lines to package.json and the problem fixed:
"engines": {
"node": "16.x",
"npm": "8.5.5"
},
And again thanks to Jryke :-) yes I use "knex" module in my code and yes I use "heroku" also.
I'm very excited to learn Laravel and create a webapp based on a bootstrap template I bought (OneUI). I successfully installed Laravel (the /public route returns the default view to my browser correctly). Now i'm following the install guide of the template, and i'm experiencing problems with npm commands that return errors that I can't understand (I'm not familiar with npm).
I'd really appreciate if somebody could help me to find what's wrong so I could finally using Laravel with the Templates.
As requested in the OneUI documentation, i copy the public & resources folders, the routes/web.php file, and the webpack.mix.js file. Then, i install the npm dependencies running the following command :
npm i browser-sync browser-sync-webpack-plugin sass sass-loader bootstrap#^4.5.3 jquery#^3.5.1 jquery-scroll-lock#^3.1.3 jquery.appear#^1.0.1 js-cookie#^2.2.1 popper.js#^1.16.1 simplebar#^5.3.0 -D
This seems to run OK with a few warnings about some deprecated packages.
Then i run :
npm run dev
I get this return :
> # dev /volume1/web/dev/myproject
> npm run development
> # development /volume1/web/dev/myproject
> mix
events.js:287
throw er; // Unhandled 'error' event
^
Error: spawn npx ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn npx',
path: 'npx',
spawnargs: [
'webpack',
'--progress',
'--config=node_modules/laravel-mix/setup/webpack.config.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # development: `mix`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /var/services/homes/admin/.npm/_logs/2021-01-25T22_32_54_150Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /var/services/homes/admin/.npm/_logs/2021-01-25T22_32_54_340Z-debug.log
This is on Linux, directly on my Synology (I don't use anything like a VM/Docker).
To install Laravel, I simply did this :
Installed php7.4 + libraries
Installed composer
Went into my web folder and entered the command : composer create-project laravel/laravel myproject
Added write access to my http user on the storage folder
I tryied this already without success :
As advised on other websites:
rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install
npm run dev
I tryied to do a npm install and npm run dev on a clean Laravel Install (before the install of all the packages required by the OneUI templates) to try to see if it's related to the OneUI files or the npm dependencies I installed. I have the same errors. So I understand it's not related to the OneUI install, but an issue with npm / my Laravel files (?).
In advance, thanks a lot for your help !
When i try to run the bot in Heroku, it keeps giving me the same error and not turning the bot on. How would i go on to fix this issue? All the files and node modules are already installed in the github repository
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 12.x...
Downloading and installing node 12.19.1...
Using default npm version: 6.14.8
-----> Installing dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
> #discordjs/opus#0.3.2 install /tmp/build_8234188f_/node_modules/#discordjs/opus
> node-pre-gyp install --fallback-to-build
sh: 1: node-pre-gyp: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! #discordjs/opus#0.3.2 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the #discordjs/opus#0.3.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.tAPfy/_logs/2020-11-22T22_42_39_963Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- node_modules checked into source control
https://devcenter.heroku.com/articles/node-best-practices#only-git-the-important-bits
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed