The error message "Killed" and "npm verb exit 137" indicate that the process was terminated due to running out of memory. To fix this issue, you can try increasing the memory limit for the Node process.
One possible solution is to add the --max-old-space-size flag to the NODE_OPTIONS environment variable in your npm run dev script. However, it seems that you have already tried this approach without success.
Another option is to increase the memory limit directly in your Laravel Forge server configuration. Here's how you can do it:
- Log in to your Laravel Forge account and navigate to your server.
- Go to the "Web Server" tab and click on the "Edit Environment" button.
- In the "Environment Variables" section, add a new variable with the following details:
- Variable:
NODE_OPTIONS - Value:
--max-old-space-size=1536
- Variable:
- Save the changes and redeploy your application.
If increasing the memory limit still doesn't solve the issue, you may need to further investigate the cause of the memory consumption. It's possible that there are other factors contributing to the high memory usage, such as inefficient code or large dependencies.
Additionally, you can try running the npm run dev command directly on the server via SSH to see if you get more detailed error messages. This can help identify the specific cause of the memory issue.
ssh forge@your-server-ip
cd /path/to/your/project
npm run dev
If you're still experiencing issues, it may be helpful to provide more information about your project setup, such as the Laravel and Node versions, and any other relevant details.