javascript – Problema com Yarn ao iniciar projeto em ES6: Error: Cannot find module ‘@babel/preset/env’ from ‘raiz_do_projeto’

Problema com YARN ao tentar iniciar um projeto em ES6:

Estou tentando iniciar um projeto em ES6 e ao rodar o “yarn dev”, com o seguinte comando no package.json: “dev”: “babel ./main.js -o ./bundle.js” , aparece o erro do código abaixo.

OBS: Já dei o yarn init e dei o add no @babel/preset-env e no @babel/core

yarn run v1.22.4
warning ../../package.json: No license field
$ babel ./main.js -o ./bundle.js
Error: Cannot find module ‘@babel/preset/env’ from ‘/Users/fernandomoreira/Desktop/curso-es6’
at Function.resolveSync (as sync) (/Users/fernandomoreira/Desktop/curso-es6/node_modules/resolve/lib/sync.js:90:15)
at resolveStandardizedName (/Users/fernandomoreira/Desktop/curso-es6/node_modules/@babel/core/lib/config/files/plugins.js:101:31)
at resolvePreset (/Users/fernandomoreira/Desktop/curso-es6/node_modules/@babel/core/lib/config/files/plugins.js:58:10)
at loadPreset (/Users/fernandomoreira/Desktop/curso-es6/node_modules/@babel/core/lib/config/files/plugins.js:77:20)
at createDescriptor (/Users/fernandomoreira/Desktop/curso-es6/node_modules/@babel/core/lib/config/config-descriptors.js:154:9)
at /Users/fernandomoreira/Desktop/curso-es6/node_modules/@babel/core/lib/config/config-descriptors.js:109:50
at Array.map ()
at createDescriptors (/Users/fernandomoreira/Desktop/curso-es6/node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
at createPresetDescriptors (/Users/fernandomoreira/Desktop/curso-es6/node_modules/@babel/core/lib/config/config-descriptors.js:101:10)
at presets (/Users/fernandomoreira/Desktop/curso-es6/node_modules/@babel/core/lib/config/config-descriptors.js:47:19) {
code: ‘MODULE_NOT_FOUND’
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.