npm install error, looking for package.json in a nested directory

im on an ec2 ubuntu instance (24.04), with npm v9.2.0 & node v18.19.1, and i attached my git repo to my remote and pulled the code. i am getting this error though whenever i try to npm install

the project is react & vite, and when i goto my project root dir, and do npm install, i get:

`root@ip-172-31-17-191:/var/www/project# npm i
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /var/www/project/.eslint-rules/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/var/www/project/.eslint-rules/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent`

Obviously, it’s looking for a package.json inside my eslint-rules directory, but why? that isnt the root of the project. i have a package.json at my root. my eslint-rules directory has a polyfill rule for my eslint in dev.

inside my package.json i have these in my devDependencies:

"devDependencies": {
    "@rollup/plugin-replace": "^5.0.5",
    "@types/core-js": "^2.5.8",
    "@types/crypto-js": "^4.2.2",
    "@types/react": "^18.0.21",
    "@types/react-window": "^1.8.8",
    "eslint-plugin-structured-clone-import": "file:.eslint-rules",
    "rollup-plugin-visualizer": "^5.12.0"
  },

when i remove the “eslint-plugin-structured-clone-import” line it can fully install all the other packages, but when it’s there it hits the error mentioned. I’ve set this repo up on my local, AND other ubuntu VMs, so why all of a sudden is npm trying to find a package.json file inside the .eslint-rules?

I tried to npm init in the root of my project again, just to make sure it was looking at the root level package.json, but it gives the same error.

and yes, I made sure I was in the root of the project repo before using npm install.