2

I'm trying to push to heroku, but I'm getting an error on the command git push heroku master:

remote: ---> Running in 7c242433acde
remote: /root/.nvm/versions/node/v12.18.1/bin/karma -> /root/.nvm/versions/node/v12.18.1/lib/node_modules/karma/bin/karma
remote:
remote: > core-js-pure@3.6.5 postinstall /root/.nvm/versions/node/v12.18.1/lib/node_modules/karma/node_modules/core-js-pure
remote: > node -e "try{require('./postinstall')}catch(e){}"
remote:
remote: sh: 1: node: Permission denied
remote: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/karma/node_modules/chokidar/node_modules/fsevents):
remote: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
remote:
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! syscall spawn
remote: npm ERR! file sh
remote: npm ERR! errno ENOENT
remote: npm ERR! core-js-pure@3.6.5 postinstall: node -e "try{require('./postinstall')}catch(e){}"
remote: npm ERR! spawn ENOENT
remote: npm ERR!
remote: npm ERR! Failed at the core-js-pure@3.6.5 postinstall 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! /root/.npm/_logs/2020-07-03T17_00_20_442Z-debug.log
remote: The command '/bin/sh -c cd /myapp/ && npm i -g karma && npm i -g karma-cljs-test && npm i -g karma-chrome-launcher && npm i && lein uberjar' returned a non-zero code: 1
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to myapp.
remote:
To https://git.heroku.com/myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myapp.git'

Seems like an issue with installing node modules. How to fix this?

zendevil.eth
  • 974
  • 2
  • 9
  • 28

1 Answers1

0

I solved the same issue locally by using sudo and --unsafe-perm for npm install:

sudo npm install --unsafe-perm

Not sure how to apply this to Heroku though.

thisismydesign
  • 21,553
  • 9
  • 123
  • 126