2

I am using a template, Vue cli3 application and it stopped working and I don't recall why. The error I am receiving is when I try to start the application I get this error.

yarn run serve
yarn run v1.16.0
error An unexpected error occurred: "The \"path\" argument must be of type string. Received type object".
info If you think this is a bug, please open a bug report with the information provided in "C:\\node\\TradeTriggers\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I can delete the node_modules and package.json.lock

I cannot do anything with yarn. No yarn install, yarn run serve, nothing and npm doesn't seem to want to run the application. I'm sorry there are a lot of tools to know in the JS world!

The machine is a windows10 machine and I cannot find yarn in my env variables, so the issue may lie there. I even tried installing the Yarn MSI but my version is still the one I installed through npm a while ago, still nothing.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
illcrx
  • 774
  • 1
  • 12
  • 32

2 Answers2

0

I had problem that was caused by yarn looking at first the global settings file, ie global registry. It might be similar. On Windows, first check your yarn config path:

yarn config bin

Windows shows the path. Then in that folder, check whether you have a "rc" file, ie that is yarn configuration. Try move this file out of the folder, for test. Have it as a copy somewhere else, where you can restore it if this does not help. Then, once file is out, run your yarn commands again like you used to.

Sideline: on Linux, I had to remove a leftover buggy .yarnrc file in /usr/local/share/.yarnrc to get similar things working again. It was not a Vue app, but similar kind of error.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Jukka Paulin
  • 11
  • 1
  • 4
0

This error can occur when you are using Yarn Workspaces and have incompatible directories in the packages/ directory.

In my scenario, I used git subtrees to pull another repo into my project's packages/ directory. This directory had a package.json file, but it did not have compatible values for the fields required by Yarn Workspaces.

Moving the problematic package out of packages/ should fix this issue.

Trent
  • 4,208
  • 5
  • 24
  • 46