Installing/running foundation 6.6.3 giving "primordials is not defined" error

I am trying to get foundation installed. I was using bootstrap until now but I want to try foundation. I installed with npm, it seemed ok but i got some errorlines starting with:

npm WARN saveError ENOENT: no such file or directory, open ‘I:\foundation\package.json’

i tried it in different ways: directly from github, or from the unzipped package locally. I still got the error.
installing foundation-cli seemed to be ok.
But after that I am stuck. All there is in the main directory is the node_modules subdirectory with just foundation.
I installed jquery and what-input because they seem necessary.

When i installed bootstrap the same way i did foundation, i got lots and lots of other things, everything needed for bootstrap was installed.

But with foundation that does not happen. I looked at the install videos, searched this forum and the docs, but i have no idea how to proceed.

Where can i find the information to get it working?
I am using bootstrap for more then a year so i know how to deal with scss files and gulpfiles and such. But here i am stuck.

Thanks for helping.

It looks like it is an issue with your terminal which tries to save to the drive I and a folder foundation.

The Foundation CLI is just for installing the templates which also bring the foundation dependency and the other dependencies.

Please provide a full reproducible example and the exact steps that you have tried (the commands in your terminal) and the exact errors that you got (screenshot or dump of the logfile).

Hello Daniel, thanks for the reply. I have screenshots and logfiles. But i can only upload pictures, not textfiles, how do i do that? There will be way to many pics if i have to take screenshots of those logfiles.

For what i see inside the files, it looks like it is trying to save to package.json in the maindirectory, but there is none. Only inside /node_files/foundation-sites itself.
How do i upload those logfiles so you can see what i mean?
Thanks for helping.

I’m not sure which exact steps you followed (the commands). Foundation Sites is either installed with npm i foundation-sites or using the CLI ( by creating a separate folder and goinf into it.

Alright, i tried again, this is what i did.

-renamed the old foundation directory to foundation1
-created a new directory: i://foundation
-went into it with the commandprompt of windows 10
-gave the command “npm install foundation-cli --global” from the link you gave me. Result: no errors, just 2 warnings.
-then i did “foundation new --framework sites --template zurb” as the next step from your link.
-that resulted in errors. I did not install foundation-sites as that was not mentioned at “using the cli”.
-the directory i newly created was still empty.

The screenshot is from everything i did inside the commandwindow.

That error about primordials is the same i got yesterday with the other tests.

Ah the primordials issue, please use nvm oder n to switch to Node 10 or Node 8 as this is a bug with the outdated gulp version.

For n:

For nvm-windows:

See also Nodejs 12 LTS issue with Foundation CLI and

I am using node: 14.1.0 and gulp: 4.0.2

But the funny thing is:
yesterday when i installed with “npm install foundation-cli --global”, there were no errors, just 2 warnings. But when i looked inside the node_modules directory, only foundation-sites was there as a subdirectory. Nothing else from inside the package.json file on github was there. So nothing from the “devDependencies” section from that package.json was installed in node_modules. Only foundation-sites itself.
Why were all others not installed? Is that also caused by this bug?

I rather not downgrade anything, that might get me into trouble with using bootstrap.
The issue dated way back november 2019. More people might run into this. Is there no way it can be fixed?
I changed the title of this issue so other people can better find it.

nvm and n do not upgrade, they manage multiple node versions.

I will try those, but it might take a while because of other things. I also want to try something else. I
I will let you know the results ok?

Hello Daniel,

Finally managed to get something working, but certainly NOT as it is supposed to be working.

First I tried your suggestions about n and nvm.
Trying to install n, I got an unsupported platform error.
So i tried nvm (nvm-windows) But that said i should uninstall all versions of node.js.

Certainly did not want to do that. I have a working environment for Bootstrap5 and i dont want to mess with that and have to figure out later how to get that working again.

So I thought some more about what i really needed to get Foundation working. All I wanted was to be able to compile the Foundation scss files and use the compiled css and the javascript files needed.

So what i did was make a separate directory underneath my working Bootstrap 5 environment, because the whole compile environment there was working for Bootstrap5.
Then I copied the whole Foundation directory from a directory where I had installed Foundation in earlier attempts to get it working.

I redesigned my gulpfile.js to point to the files i needed. And see if it would compile the necessary scss files into a css file i could use.
I kept getting an empty css file and a filled .map file. Took me a long time searching, until I ran into issue 11808 about Foundation-sites on github, that helped me to solve the problem.
So I finally managed to get a non-empty css file and a map file.

I am fully aware that this is not the way to go, and I know that when i want to use extra examples or kits or whatever, I will have to manually download and connect them somehow to the foundation-sites files. But we’ll figure that out when the time comes.

I really hope that very soon there will be a better solution to install Foundation just out of the box as it should.
But for now I can continue to see if Foundation is better suited for what i want then Bootstrap5.

Do you have any idea how long it might take until this original problem is solved and we can install Foundation as it is ment to?

Thanks for your help and suggestions.

We just have to update the dependencies and gulpfile for Node 12+ support when we find some time, well at least me.

Uninstalling the installed node version should not be an issue as there should not be any critical globally installed packages. And in most cases you can reinstall it (or make a backup of the existing ones and copy them afterwards).

No ETA from my side, I have not so much free time to work on this alone, paid work is more important at the moment. So far switching Node versions is the recommended way.

@Mother10 and @DanielRuf, this has been a few months but …

I went almost completely crazy trying to sort out npm/node issues. I can confirm it can become quite a complicated thing. I tried a lot of things before I landed on what worked. It never hurts to strip things down to the bare bones and start over, and start over by today’s standards. A long time ago, without even looking into it, I installed nmp using homebrew (one may end up in the same boat by using chocolatey on windows, idk). Apparently this is a big no-no. npm is just not installed properly using homebrew. I wish it had never been added to the package list. (side note: I love homebrew. If I can’t find something there I may not even look elsewhere. I like the management it provides)

Long story short, along came nvm to save the day. And I stumbled upon Paige Niedringhaus’ article NVM, the Easiest Way to Switch Node.js Environments on Your Machine in a Flash and it all just clicked.

Good luck with your node management!