This happened when I initialized Nuxt 3. After the initialization completed and I go into the directory project I tried to install the dependencies with yarn
. But this errors happened
After I figured out what the problem was, this happened because I’m using Yarn Berry (yarn version 3)
. And the solution for this is I should add .yarnrc.yml
in the root project directory and put nodeLinker: node-modules
in it.
Then, remove all the folders created before with rm -rf .yarn node_modules .nuxt yarn.lock
and run the installation again yarn install
. The installation should completed without any errors happen again.
I was thought this was because of the node-gyp
, because when I install the dependencies for the first time using npm
there was no error but it happen everytime I use yarn
. But, it turn out there’s no correlation between installing using yarn
and the node-gyp
error, the solution is just as I mentioned earlier.