gili
gili

Reputation: 1

Moving a project from one folder to a subfolder

I've built a react app in VsCode and after a while wanted to put it in a subfolder of the folder it's currently in, but after I've put it inside the subfolder everytime I've tried to run it I get an error 'Could not read package.json: Error: ENOENT: no such file or directory', how can I fix it?

Upvotes: 0

Views: 20

Answers (1)

iamdpastore
iamdpastore

Reputation: 21

Check that all configurations point correctly to the new paths. Check these:

  • Make sure that the package.json file is present in the new subdirectory;
  • Install the dependencies again: npm install;
  • Check for configuration files that refer to specific paths .env, webpack.config.js, tsconfig.json and make sure the paths are updated according to the new folder structure;
  • Ensure that the execution scripts in the package.json file do not contain absolute or relative paths that still point to the old folder;
  • If you still experience problems, it may be useful to clear the npm cache: npm cache clean --force.

Upvotes: 0

Related Questions