I have a discord bot, that recently is throwing a continuous error that paths are not found for modules along the lines of:
/app/node_modules/.bin/node: 8: /app/node_modules/.bin/node: /app/node_modules/.bin/…/…/…/rbd/pnpm-volume/a215dda2-cb02-491e-a421-2dfe55178574/node_modules/node/bin/node: not found
This started occurring 2 days ago and it appears to be attempting to install node with pnpm, but failing every time. I do notice the node version is updated compared to the original version I had created the bot with.
Could I get the command to fix this path not found? I tried remixing the project and rolling it back, but have been able to resolve this error.
On a side note, curious why it’s re-installing node. Does glitch automatically update the node version or is this from a command I have set in the bot?
I’m pretty sure what you’re seeing is because you have Node listed in your package.json dependencies. If you want to control the version of Node your project uses you should instead use the engines option in your package.json file:
"engines": {
"node": "12.x"
}
and remove node from your dependencies.
Can you give that a try and let us know how you get on?
Thank you for the welcome! I removed the node dependency from package.json and still receive the same error:
/app/node_modules/.bin/node: 8: /app/node_modules/.bin/node: /app/node_modules/.bin/…/…/…/rbd/pnpm-volume/a215dda2-cb02-491e-a421-2dfe55178574/node_modules/node/bin/node: not found
I also tried adding the node version under an engines option. This did change the error to say the specific version was not found and it will be using version 10 instead. Before the same error appeared again.
Hey @Tsuora when I added that engines block of json to a package.json file in a Remix of your project everything started just fine, but I see that it’s not in your current package.json file. I also see that you have your debugger on.
Can you try:
turning off the debugger using the Stoplight / Ladybug button in your project’s logs pane?
re-adding the engines block. Make sure you add the leading or trailing comma to make sure your package.json file is correctly formatted