# TypeError [ERR_INVALID_ARG_TYPE] when trying to build project using Yarn

**URL:** https://discourse.roots.io/t/typeerror-err-invalid-arg-type-when-trying-to-build-project-using-yarn/22649
**Category:** sage
**Tags:** sage10
**Created:** 2022-03-21T10:45:27Z
**Posts:** 26

## Post 1 by @Mathias — 2022-03-21T10:45:28Z

Hi there.

I run into an issue when trying to compile my project using Yarn.

I have followed the instructions as seen here: ([GitHub - roots/sage: WordPress starter theme with Laravel Blade components and templates, Tailwind CSS, and a modern development workflow](https://github.com/roots/sage))

```
PS C:\Users\super\Local Sites\hjallerup-marked\app\public\wp-content\themes\hjallerup> yarn build
yarn run v1.22.5
$ bud build
node:internal/errors:464
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
    at readFile (node:fs:393:10)
    at go$readFile (C:\Users\super\Local Sites\hjallerup-marked\app\public\wp-content\themes\hjallerup\node_modules\@roots\bud-support\lib\cjs\index.js:28298:14)
    at readFile (C:\Users\super\Local Sites\hjallerup-marked\app\public\wp-content\themes\hjallerup\node_modules\@roots\bud-support\lib\cjs\index.js:28295:12)
    at C:\Users\super\Local Sites\hjallerup-marked\app\public\wp-content\themes\hjallerup\node_modules\@roots\bud-support\lib\cjs\index.js:116224:12
    at new Promise (<anonymous>)
    at readFile (C:\Users\super\Local Sites\hjallerup-marked\app\public\wp-content\themes\hjallerup\node_modules\@roots\bud-support\lib\cjs\index.js:116223:14)
    at Object._readFile (C:\Users\super\Local Sites\hjallerup-marked\app\public\wp-content\themes\hjallerup\node_modules\@roots\bud-support\lib\cjs\index.js:83424:58)      
    at Object._readFile (C:\Users\super\Local Sites\hjallerup-marked\app\public\wp-content\themes\hjallerup\node_modules\@roots\bud-support\lib\cjs\index.js:116237:45)     
    at Manifest.read (C:\Users\super\Local Sites\hjallerup-marked\app\public\wp-content\themes\hjallerup\node_modules\@roots\bud\lib\cjs\context\manifest.js:10:33)
    at makeContext (C:\Users\super\Local Sites\hjallerup-marked\app\public\wp-content\themes\hjallerup\node_modules\@roots\bud\lib\cjs\context\index.js:31:58) {
  code: 'ERR_INVALID_ARG_TYPE'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```

I have edited my bud.config.js with my local project url

```
/**
     * Target URL to be proxied by the dev server.
     *
     * This is your local dev server.
     */
    .proxy('http://hjallerup-marked.test')

    /**
     * Development URL
     */
    .serve('http://localhost:3000');
```

I’m at kinda stuck right now. Maybe someone can help me here.

Thanks.

---

## Post 2 by @Jacek — 2022-03-21T10:55:28Z

what is your node version? and php selected for wordpress instalation in Local?

```
node -v
```

---

## Post 3 by @Mathias — 2022-03-22T09:22:18Z

I’m using node version v16.13.1. I tried different version still nothing.

My local is using PHP version 8.0.0 - Also tried both 7.4.1 7.3.5

---

## Post 4 by @Jacek — 2022-03-22T09:25:09Z

Hey @Mathias do you have Acorn installed?

> **[Sage 10.x: Installation | Roots Documentation](https://docs.roots.io/sage/10.x/installation/#installing-acorn)**
>
> Install Sage 10, a WordPress starter theme, by running `composer create-project roots/sage`.

---

## Post 5 by @Mathias — 2022-03-22T09:35:06Z

I installed acorn in my theme. Should it be installed somewhere else?

---

## Post 6 by @Jacek — 2022-03-22T09:38:32Z

Add it as plugin to your wordpress

Download .zip as your current php version then install in your wp and **activate**

> **[Release v2.0.3 · roots/acorn](https://github.com/roots/acorn/releases/tag/v2.0.3)**
>
> 🌱 Join us on Roots Discourse to discuss the Acorn v2.0.3 release
> What's Changed
> 
> 🩹 avoid passing second parameter to class_exists by @mikeyzm in #201
> 🐛 fix PackageManifest / package:discover by @QW...

---

## Post 7 by @Mathias — 2022-03-22T09:53:52Z

Downgraded to PHP 7.4.1 and installed Acorn as plugin. Still getting the same error.

---

## Post 8 by @Jacek — 2022-03-22T09:55:19Z

What kind of bud version have you installed?

---

## Post 9 by @Mathias — 2022-03-22T09:59:49Z

I used ‘yarn add @roots/bud’ so i have the latest version 5.6.2

---

## Post 10 by @Jacek — 2022-03-22T10:00:28Z

Could you show your .package.json file?

---

## Post 11 by @Mathias — 2022-03-22T10:01:02Z

Yes here it is

```
{
  "name": "sage",
  "private": true,
  "browserslist": [
    "extends @wordpress/browserslist-config"
  ],
  "engines": {
    "node": ">=16.0.0"
  },
  "scripts": {
    "dev": "bud dev",
    "build": "bud build",
    "translate": "npm run translate:pot && npm run translate:js",
    "translate:pot": "wp i18n make-pot . ./resources/lang/sage.pot --ignore-domain --include=\"app,resources\"",
    "translate:js": "wp i18n make-json ./resources/lang --pretty-print"
  },
  "devDependencies": {
    "@roots/bud": "^5.6.2",
    "@roots/bud-tailwindcss": "5.6.2",
    "@roots/sage": "5.6.2"
  }
}
```

---

## Post 12 by @Jacek — 2022-03-22T10:03:14Z

Change

```
"@roots/bud": "^5.6.2",
```

to

```
"@roots/bud": "5.6.2",
```

then yarn && yarn build

---

## Post 13 by @Mathias — 2022-03-22T10:04:53Z

Did both. Still getting the same error.

Edit: Tried doing a fresh install doing all the steps mentioned and running yarn bud build.  
Still getting the same error

---

## Post 14 by @Jacek — 2022-03-22T10:13:23Z

If you use Local, your proxy url shouldn’t be [http://hjallerup-marked.local](http://hjallerup-marked.local) ?

.proxy(‘[http://hjallerup-marked.local](http://hjallerup-marked.local)’)

---

## Post 15 by @Mathias — 2022-03-22T10:14:33Z

All my projects is using test as end  
 ![image](https://discourse.roots.io/uploads/default/original/2X/2/22954cb5c389b6421782b2f6bd74796f93feac77.png)

---

## Post 16 by @Jacek — 2022-03-22T10:20:23Z

Ok so it’s strange it looks you have everything properly configure

---

## Post 17 by @Mathias — 2022-03-22T10:23:48Z

Yeah i’m at a complete loss. The error seems to be connected to bud.  
I’m not sure though.

---

## Post 18 by @Jacek — 2022-03-22T10:27:15Z

Last thing, in this above screenshot this some other domain not this current which you have on proxy.

```
hjallerup.test
```

.proxy(‘[http://hjallerup-marked.test](http://hjallerup-marked.test)’)

---

## Post 19 by @Mathias — 2022-03-22T10:31:36Z

Still getting the same error.

I’m now sure it’s Bud. Every command i do from bud is giving me the same error.

yarn bud build  
yarn bud -h  
yarn bud doctor  
yarn bud clean  
etc.

---

## Post 20 by @alwaysblank — 2022-03-22T13:40:33Z

Are you using WSL? That’s the only officially supported method for using Sage stuff in Windows.

---

## Post 21 by @Mathias — 2022-03-22T14:02:13Z

I was just playing with that.

Though it’s new to me, and i’m not sure how to use WSL to work with sage stuff.

Is there a guide anywhere? Or is it like working with powershell/cmd?

Sidenote, i accidently closed the WSL terminal and now i have no idea where to login, if it’s even necessary.

---

## Post 22 by @alwaysblank — 2022-03-22T14:06:56Z

MS has some pretty good documentation on setting up and using WSL: [Windows Subsystem for Linux Documentation | Microsoft Docs](https://docs.microsoft.com/en-us/windows/wsl/) (you want WSL 2)

It’s basically just Linux, so just follow the Linux instructions. One thing to keep in mind is you usually want your stuff in the WSL file system or you might see weird permissions errors.

---

## Post 23 by @Mathias — 2022-03-22T14:20:32Z

Great, i will play with that. Thanks.

This might be a stupid question, but are you going to update documentation to mention and guide that WSL is necessary?

Right now it’s almost just the same as before.

Edit: Local does not allow making new sites in \wsl.localhost\Ubuntu\root folder - What then

---

## Post 24 by @ben — 2022-03-22T14:41:29Z

Sorry about that. The docs have been updated now. [Sage 10.x: Installation | Roots Documentation](https://docs.roots.io/sage/10.x/installation/)

---

## Post 25 by @paul_in — 2022-04-14T14:37:09Z

Hello, I have the same problem. Did installing WLS solve the problem? I am not at all familiar with this environment and before going too far in the installations I would like to make sure that it serves a purpose. Thanks for your feedback

---

## Post 26 by @ben — 2022-04-14T14:41:00Z

You will **need** to use WSL in order to use Sage/Bud
