Netlify Build Error node_modules

I am trying to deploy my react app from a subfolder of github repo. Netlify downloads node modules and then finds an error in the naming of the file. Please help me get past this issue.

Deploy did not succeed: Invalid filename 'frontend/node_modules/es5-ext/string/#/starts-with/is-implemented.js'. Deployed filenames cannot contain # or ? characters

Link to GitHub Repo: GitHub - keshav2712/Jobsgram: A web app built using MERN for listing and applying for jobs for recruiters and applicants respectively.

I just deployed your repo and it worked fine. Have you configured build as your publish path?

@hrishikesh
My publish directory is frontend/ as my base directory was frontend. I tried to make my publish directory as frontend/build but it gave me error saying frontend/build not found

When you set frontend as your base path in your Netlify UI, just adding base to the publish path would do.

Can you share a screenshot of what exactly you’ve currently set or the setup that’s giving you the error?

Sure, the following is my deploy settings screenshot

The error I get on deploying this is
Deploy did not succeed: Invalid filename 'frontend/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js'. Deployed filenames cannot contain # or ? characters

Yeah so, it doesn’t work when you set publish path to frontend/build? That’s rather strange.

@hrishikesh No, this is the error I get when I set publish path to frontend/build

I think your command is npm run build and not npm build.

Yes, @hrishikesh, that was the issue, I had changed it after seeing some tutorial but then forgot to change it back. Thanks a ton for your time.

1 Like