Did you mean "@babel/env"?
Opened this issue · 0 comments
Problem
This is an error related to the Babel compiler (Did you mean "@babel/env"?) found in the Address Book challenge documentation as written for the cohorts of April 2019 and June 2019. It appears during the webkit and babel installation, near the end of the scaffolding process with Yarn.
Background
This issue has been seen in various forms at CraftOverflow previously:
#33
#38
Implementation code
During the scaffolding procedure as discussed in the course material as of June 2019, the installation of webkit and babel is recommended as follows,
yarn add webpack webpack-cli babel-loader babel-preset-es2015 babel-polyfill babel-register --dev
which results in an eventual error from the yarn run build
command,
With the help of Faraz, we settled on the solution of,
- running
yarn add webpack webpack-cli babel-loader babel-preset-env babel-polyfill babel-register --dev
- Replacing in the
webpack.config.js
file,presets: ["es2015"]
withpresets: ["env"]
. - deleting the
yarn.lock
file. - Modifying the
package.json
file as follows,
{
"name": "challengeRockPaperScissor",
"version": "1.0.0",
"main": "index.js",
"repository": "https://github.com/CA-ma/RPS_challenge.git",
"author": "Max Aubain <max.aubain@gmail.com>",
"license": "MIT",
"scripts": {
"build": "webpack --progress --p --mode=production",
"watch": "webpack --progress --watch --mode=development",
"cucumber": "superstatic -p 3000 2> /dev/null & cucumber-js; lsof -ti tcp:3000 | xargs kill"
},
"devDependencies": {
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-register": "^6.26.0",
"chai": "^4.2.0",
"cucumber": "^5.1.0",
"mocha": "^6.1.4",
"puppeteer": "^1.17.0",
"superstatic": "^6.0.4",
"webpack": "^4.34.0",
"webpack-cli": "^3.3.4"
},
"dependencies": {
"@babel/core": "^7.4.5",
"babel-core": "6",
"babel-loader": "7",
"babel-preset-env": "^1.7.0"
}
}
- running
yarn add babel-preset-env
. - And finally running
yarn run build
successfully.
Markdown guide