Unable to import zip file of an existing project

Issue Summary

When i am trying to import a site ( ZIP file) after a few files getting imported, I get node modules "Error: ENOENT: no such file or directory, real path error. I suppose that the import is not able to process all the npm packages

Troubleshooting Questions

  • Does this happen for all sites in Local, or just one in particular?
    I just tried this particular zip.
  • Are you able to create a new, plain WordPress site in Local and access it in a Browser?
    I was able to create a new plain wordpress site in local and access it in a browser.

System Details

  • Which version of Local is being used?
  • What Operating System (OS) and OS version is being used?
    • For example: macOS Catalina or Windows 10 Professional
  • Attach the Local Log. See this Help Doc for instructions on how to do so:
    {“stack”:“Error: ENOENT: no such file or directory, realpath ‘C:\Users\XXXXXX\AppData\Local\Temp\local-by-flywheel-4h-rSp8UHw\wp-content\themes\ProjectXXXX\node_modules\bower\node_modules\update-notifier\node_modules\latest-version\node_modules\package-json\node_modules\got\node_modules\duplexify\node_modules\end-of-stream\node_modules’”,“level”:“warn”,“message”:“Unable to import site.”,“timestamp”:“2022-06-13T15:20:30.906Z”}
    {“thread”:“main”,“reason”:{},“p”:{},“eventId”:“49d6538d35264d50b2ffe960433ef281”,“level”:“warn”,“message”:“Unhandled Rejection.”,“timestamp”:“2022-06-13T15:20:37.052Z”}

Found similar cases to this but without any answers

Hello there, @iulhaq - thank you for bringing your question to the Local Community! :wave:

That error message indicates that either a file is missing or cannot be located for some reason.

To troubleshoot - are you able to export a site from Local & import it back in without an issue?

Let’s start there!

:woman_technologist:t3: Sam

Having the same issue when importing a live/prod site on a ubuntu server (I have W10 in my local machine)
I have checked the folder which the error refers to, and it exists, with the same path inside the zip file.
Weird…
The folder have a quite long name. Could the error prompts because of the path length?

Hi @axgalache! The length can definitely be an issue as we’ve seen it come up before. I would shorten it and also make sure the name doesn’t contain any special characters like &$#!.

If this helps anyone, I was having the same issues. Deleted the node_modules folder and the sites then start importing successfully. Afterward, open up the site and run npm install again to rebuild.

1 Like