I’m working on a TypeScript project using Next.js, and I’ve encountered an issue where the project automatically adds itself as a local dependency in the package.json file. Below is an example of my package.json
{
"name": "my-project",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --port 3000",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
// other dependencies
"next": "^13.4.13",
"my-project": "file:" // This part gets added automatically
},
"devDependencies": {
// dev dependencies
}
}
The problem is that the project name "my-project"
is being added as a local dependency ("my-project": "file:"
). I haven’t manually added this entry, and I’m not sure why it’s happening. This issue seems to occur whenever I run or build the project.
This also happens with Nodejs and Express project.
I’ve tried running npm unlink ozura
, which temporarily removes the self-referencing dependency, but it gets added back again. I also tried clearing the cache with npm cache clean --force
, deleting node_modules
, and removing package-lock.json
, followed by a fresh install. Unfortunately, the issue persists.
Has anyone encountered this issue before? What might be causing this behaviour, and how can I stop the project from automatically adding itself as a dependency?