Path must be a string. Received undefined

Hi Everyone,

I know this error is old and I have checked the forum posts around this as well as all the closed issues on github.
The problem started occurring when I cloned my repo to a Mac. I’m mostly working on Windows 10 for ionic projects but I have to sort out a very specific problem that suddenly reared its head on iOS 11… So Mac we go!

Anyways, I cloned the repo, npm installed everything, and then tried to do ionic cordova build ios, ionic cordove emulate ios, ionic cordova prepare ios and they all fail with the same error message : “Path must be a string. Received undefined”

Below are a few screenshots for additional information regarding the environment I’m working in, hopefully someone out there could help :slight_smile:

ionic info

ionic cordova build ios

Thanks in advance to anyone that answers !

Just a side-note, I also tried removing the current ionic and installing ionic@canary via npm, which gave me the same error message anyways :frowning:

Run the same command with --verbose.
Run the same command without ionic but --debugadded at the end.
Show us the output.

Here you go @Sujan12

Is the ionic info output identical on your Windows machine?

The ionic info command on my windows pc looks like this :


Very different cordova-ios version. Try to install the same one on your mac, maybe this solves the problem.

I downgraded to ios 4.4.0 on the Mac and the exact same problem happens.
I want to add that the same error message appeared when installing ios 4.4.0 as well, this was the output of the terminal :


Create a new project with ionic start please. Does it happen there as well? Can you build the project?
If not, the problem is with your project.
Maybe as a first step add your plugins to that new project and see if this causes the problem. Which one? The “istablet” one shown in your last command line output?

ok thanks, good idea. I will test it out !

Ok so that worked, a new ionic start can build fine on the mac, I will now go and add the istablet plugin to check if it is that one… I hope.

1 Like

Nope not that one, I guess I’ll have to add them one by one

So i figured it out.
Ons the Mac the cordova version was 7.1.0, downgrading to cordova 6.5.0 made the problem go away…
Thanks for the help anyways !

That’s not really a solution, but a temporary workaround. New versions aren’t released for fun, but because the fix bugs and problems in old versions. But great it works for you now .

You reply does make some sense, but we had similar problems with android builds on cordova 7.1.0 on windows as well and decided to downgrade.
Whether the problem will re-occur later if/when we upgrade remains to be seen, perhaps we will be better skilled to solve the problem by then.
But thank you again for the assistance !