I have a firebase/react program that I am sharing with some friends via github for a project. All of their devices do not have the same issue that I am experiencing.
In the scripts portion of my package.json, i have the line
"start": "node ./src/server.js" which is very standard. However, running this line gives me a very strange error:
RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: "length" is outside of buffer bounds at proto.utf8Write (node:internal/buffer:1066:13)
followed by many other lines. I have learned from my research that this often comes with issues regarding node/npm installations.
Here is the strange part. When I put "node ./src/server.js" alone in the terminal, the program starts fine! Only when i try to do npm start does the program fail, even though the start script is identical.
The steps I have taken in an attempt to fix this problem are as follows:
- Messed with nvm to match the node version my friends were using to no avail
- Updated npm
- Deleted and recloned the repo several times
- Deleted and reinstalled node.js several times after deleting nvm
- Performed many deletions of node_modules and package-lock.json
The only step that yielded results was the repo deletion, but it only prolonged the error to display at a later time.
npmcommand might be using a differentnodeexecutablenvm use {version}and then check usingwhich nodeto verify