Warning: Couldn't find preset "env" relative to directory
- Dominant language
- JavaScript
- Stars
- 434
- Forks
- 60
- PR merge metrics
- No merged PRs in 30d
Description
Hi Guys
I need to use babel in one project and I've installed and i get this error when running grunt (edited)
Warning: Couldn't find preset "env" relative to directory "/Users/essteffan/Sites/div//live..ro/web" Use --force to continue.
I'm using Grunt
and i have a concat before babel and after i have an uglify
My babel config is:
babel: {
options: {
sourceMap: true,
presets: ['@babel/preset-env']
},
dist: {
files: {
'../js/app.min.js': '../js/app.js'
}
}
},
If i comment this line i have no errors: '../js/app.min.js': '../js/app.js'
Somehow i thing around there is the problem.
Could you please advice how to make it work?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the Grunt build with the shown Babel configuration, including the concat, Babel, and uglify steps, and inspect how the `@babel/preset-env` dependency is resolved from the project directory. The work is done when the Babel task generates `../js/app.min.js` without the preset warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100