Question

Node.js web service fails deploy because node modules are not installed

It seems the deployment of my production app (with a pro instance) does not successfully complete the npm ci command, according to the following error logs :

[2022-02-09 15:17:46] => Building app
[2022-02-09 15:17:46] 
[2022-02-09 15:17:46] ---> Node.js Buildpack
[2022-02-09 15:17:46] ---> Installing toolbox
[2022-02-09 15:17:46] ---> - jq
[2022-02-09 15:17:47] ---> - yj
[2022-02-09 15:17:47] ---> Getting Node version
[2022-02-09 15:17:47] ---> Resolving Node version
[2022-02-09 15:17:50] ---> Downloading and extracting Node v16.13.2
[2022-02-09 15:18:05] ---> Parsing package.json
[2022-02-09 15:18:06] ---> No file to start server
[2022-02-09 15:18:06] ---> either use 'docker run' to start container or add index.js or server.js
[2022-02-09 15:18:06] Project contains package-lock.json, using npm
[2022-02-09 15:18:06] Using npm v8.1.2. To configure a different version of npm, set the engines.npm property in package.json.
[2022-02-09 15:18:06]   See https://do.co/apps-buildpack-node for further instructions.
[2022-02-09 15:18:06] Installing node_modules using npm (from package-lock.json)
[2022-02-09 15:18:07] Running npm ci
[2022-02-09 15:18:07] 
[2022-02-09 15:18:35] 
[2022-02-09 15:18:35] > nesspay-backend@0.1.0 postinstall
[2022-02-09 15:18:35] > patch-package
[2022-02-09 15:18:35] 
[2022-02-09 15:18:35] sh: 1: patch-package: not found
[2022-02-09 15:18:35] npm notice 
[2022-02-09 15:18:35] npm notice New minor version of npm available! 8.1.2 -> 8.4.1
[2022-02-09 15:18:35] npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.4.1>
[2022-02-09 15:18:35] npm notice Run `npm install -g npm@8.4.1` to update!
[2022-02-09 15:18:35] npm notice 
[2022-02-09 15:18:35] npm ERR! code 127
[2022-02-09 15:18:35] npm ERR! path /workspace
[2022-02-09 15:18:35] npm ERR! command failed
[2022-02-09 15:18:35] npm ERR! command sh -c patch-package
[2022-02-09 15:18:35] 
[2022-02-09 15:18:35] npm ERR! A complete log of this run can be found in:
[2022-02-09 15:18:35] npm ERR!     /home/apps/.npm/_logs/2022-02-09T15_18_35_748Z-debug.log
[2022-02-09 15:18:35] 
[2022-02-09 15:18:35] unable to invoke layer creator
[2022-02-09 15:18:35] installing node_modules: exit status 127
[2022-02-09 15:18:35] ERROR: failed to build: exit status 1

It is super weird as I have the exact same configuration except for the type of database and instance size for a testing environment, which does not have this install node modules issue.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer