79533798

Date: 2025-03-25 13:22:32
Score: 1
Natty:
Report link

It looks like the issue is caused by the --harmony-proxies flag in your test script. This flag was used to enable experimental features in older versions of Node.js, but it's no longer necessary in modern Node versions.

Steps to Fix the Issue:

  1. Check Your Node.js Version

You’re using Node.js v7.1.0, which is outdated. The latest stable LTS version is recommended (e.g., Node.js 18 or 20).

Upgrade Node.js via nvm:

nvm install --lts nvm use --lts Alternatively, download the latest version from nodejs.org.

  1. Modify the Test Script

Open your package.json file and locate the test script.

Remove --harmony-proxies from the command:

"test": "cross-env NODE_ENV=test PORT=8080 MONGO_URL=mongodb://localhost:27017/mern-test node_modules/.bin/nyc node node_modules/.bin/ava"

  1. Reinstall Dependencies

After upgrading Node.js, remove and reinstall dependencies:

rm -rf node_modules package-lock.json npm install

  1. Run Tests Again

Execute:

npm run test If errors persist, check the ava and nyc versions in package.json and update them.

If you're still facing issues, you might consider switching to a more actively maintained starter template or configuring a fresh MERN setup from scratch.

Need Help with MERN Stack Development? At GraffersID, we provide expert MERN Stack developers to help you build, optimize, and scale your applications seamlessly. Hire pre-vetted remote developers to accelerate your project today! 🚀

Explore MERN Developers Now

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: GraffersID - IT Company