Failed to import project [SOLVED]

Tags: #<Tag:0x00007f1ca57f7b28>


I’m starting with Particle Workbench and I want to import an existing project but all I can get from the VS Code is an error message: Failed to import project and the source is: Workbench Core (Extension).

When I check the logs messages this is the output:

Directory `./lib` exists! cannot install libraries.

Error: Directory `./lib` exists! cannot install libraries.

at throwIfTrue (C:\Users\AIOTIK-005\.vscode\extensions\particle.particle-vscode-core-1.4.4\src\cli\index.js:251:9)

at _checkCanInstallLibraries.directoryExists.then (C:\Users\AIOTIK-005\.vscode\extensions\particle.particle-vscode-core-1.4.4\src\cli\index.js:90:75)

- - - -

I also tried opening the existing project into VS Code but I am getting the same results, this is my directory:

$ ls
.vscode/  lib/  src/  target/

Is there something that I’m missing right now? Is there other procedure that I need to follow?

Any comment will be helpful, thanks!


Can you elaborate how exactly you are importing the project and from where and where to?


Well what I did was to:

  1. open VS Code without any workspace opened
  2. go to the Particle Workbench tool
  3. open the Command Palette and look for Particle: Import Project
  4. go to my project directory in this location C:\Users\user_ID\embedded_systems\particle\photon\project_directory_here
  5. Look for the project
  6. Click to open

And this is where I am getting this Failed to Import Project error.



If the directory you are importing already has a lib folder you’ll get this error. Rename the lib folder to say “lib-old” and see if it will import.

Also, make sure you are logged into your particle account.

I was experiencing this when I was setting up my Github repositories.

Might be something different though…


Hey! That was the problem!

I rename the file like you suggest and the project was able to be imported succesfully! That file was created because I cloned a repo with that file too, looks like for future usage, we should ignore the lib folder created to make easier for developers to reproduce easily a selected repository.

And yes I also verified that I was logged with my particle account. :slight_smile:


@kenco Great advise. I too observed the same “import project” error as @fabocode. In addition to temporarily renaming the existing LIB folder of the project being imported, I also had to temporally delete the library file reference in the folder of the project being imported. Now Workbench is able to import and compile the imported code.


After recently reading multiple reports of that, I think that this might be a “new” task for @m_m :wink: