Build failed at preinstall script

This is for my Node app
Error : Exited with status 1 while building your code.

Two questions :

  1. A complete log of this run can be found in: /opt/render/.cache/_logs/2023-07-17T06_51_08_090Z-debug.log . How do I access this log so I can see the problem in detail? Am I supposed to CD into this link or do I try to access this link via the browser? (Neither of them seemed to work)

  2. My guess is this is failing due to Build Command not being set correctly or npm install not executing correctly . My current Build Command is npm run build and start command is npm start. Not sure if it helps but my package.json is as follows :

    “prebuild”: “npm install --global @babel/cli @babel/core”,
    “dev”: “nodemon --exec babel-node src/server --delay 2”,
    “migrate”: “npx prisma migrate dev --preview-feature”,
    “studio”: “npx prisma studio”,
    “build”: “babel src --out-dir build”,
    “start”: “node build/server”

Upgrade to Node 16 or higher, or pin Prisma to a release less than 5. See Specifying a Node Version | Render on how to choose a version of Node.

The issue is the use of attempting to install packages --globally. The system user within containers does not have elevated permissions, sudo will not work, and the user cannot write into system locations. You will be unable to install node_modules globally.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.