Quantcast
Channel: Active questions tagged mongodb-atlas - Stack Overflow
Viewing all articles
Browse latest Browse all 271

MERN+gql project; Heroku deployment build failing at install script because "can't cd to server"

$
0
0

In the process of converting a project using a mysql db and an express server into one with the same concept (a free online game search application) but in a MERN+gql framework. After creating my gql schemas and testing them in my localhost, I attempted to push the project to Heroku in the hopes of connecting continuous deployment as I worked on the front end.

I have been unable to deploy to Heroku because each time I attempt a push to Heroku the build fails on my "install" scrip...a script that I have successfully used before in deploying MERN+gql projects on Heroku. 😵‍💫🤦‍♀️

remote: -----> Installing dependenciesremote:        Installing node modulesremote:        remote:        > game-on@1.0.0 installremote:        > cd server && npm i && cd ../client && npm iremote:        remote:        sh: 1: cd: can't cd to serverremote:        npm notice remote:        npm notice New major version of npm available! 9.9.2 -> 10.3.0remote:        npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.3.0>remote:        npm notice Run `npm install -g npm@10.3.0` to update!remote:        npm notice remote:        npm ERR! code 2remote:        npm ERR! path /tmp/build_31774fbfremote:        npm ERR! command failedremote:        npm ERR! command sh -c cd server && npm i && cd ../client && npm iremote:        remote:        npm ERR! A complete log of this run can be found in: /tmp/npmcache.j8gTf/_logs/2024-01-18T00_51_37_422Z-debug-0.logremote: remote: -----> Build failed

I have gone through the code to check for typos and inconsistancies but have found nothing. I'm really befuddled because it works as expected on my local host; it's just the deployment that's giving me trouble.

one-by-one I've...-double checked the environment variables in Heroku.
-looked carefully over my code for typos or inconsistencies.
-updated the npm v to 10.3.0 as the message from the build log suggested.-tried re-installing the dependancies manually.-tried breaking the install script in my root package.json
"install": "cd server && npm i && cd ../client && npm i"
into three separate scripts

"install": "npm run install-server && npm run install-client","install-server": "cd server && npm i","install-client": "cd client && npm i",

-banged my head against the wall
...all to receive the exact same error message. HAAAALP!


Viewing all articles
Browse latest Browse all 271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>