Hey folks, I’m having trouble with my Laravel project on a remote host. When I try to build it, I get an error saying it can’t find the manifest.json file. I thought running npm run build
via SSH might fix it, but that’s giving me a different error:
Error: Unexpected token '||='
at Loader.moduleStrategy (internal/modules/esm/translators.js:145:18)
UnhandledPromiseRejectionWarning: Unhandled promise rejection
I’m not sure what’s causing this or how to fix it. Has anyone run into something similar? What steps should I take to get my build working properly on the remote server? Any help would be really appreciated!
I encountered a similar issue recently. It’s likely related to Node.js version incompatibility. First, check the Node version on your remote server with node -v
. If it’s outdated, you’ll need to upgrade. Consider using a version manager like nvm for easier Node.js version management. Also, ensure your package.json specifies the correct Node version in the ‘engines’ field. If the problem persists, review your build scripts and dependencies for any syntax incompatibilities. Sometimes, updating packages or adjusting build configurations can resolve these issues. Don’t forget to clear npm cache and reinstall node_modules after making changes.
I’ve dealt with this headache before. It’s most likely a Node.js version mismatch between your local and remote environments. First, check your local Node version with node -v
, then compare it to the remote server. If they’re different, that’s your culprit.
To fix it, you’ve got a couple options. You could update Node on the remote server, but that might affect other projects. Instead, I’d recommend using nvm (Node Version Manager) on the remote. It lets you switch between Node versions easily.
Here’s what worked for me:
- Install nvm on the remote server
- Use nvm to install the same Node version as your local
- Set that version as default with
nvm alias default x.x.x
- Run
npm install
again
- Try your build command
If you’re still hitting issues, double-check your package.json for any version-specific dependencies. Sometimes updating those can solve weird build errors too.
Hope this helps get your project up and running!
sounds like a node version issue. older versions dont support ‘||=’ operator. try updating node on ur remote server. might need to use nvm to manage versions. also check if package.json has right engine specs. gl mate!