Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Did you mean "@babel/env"? #44

Open
CA-ma opened this issue Jul 11, 2019 · 0 comments
Open

Did you mean "@babel/env"? #44

CA-ma opened this issue Jul 11, 2019 · 0 comments

Comments

@CA-ma
Copy link

CA-ma commented Jul 11, 2019

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,

Screenshot 2019-07-11 at 7 46 56 PM

With the help of Faraz, we settled on the solution of,

  1. running yarn add webpack webpack-cli babel-loader babel-preset-env babel-polyfill babel-register --dev
  2. Replacing in the webpack.config.js file, presets: ["es2015"] with presets: ["env"].
  3. deleting the yarn.lock file.
  4. 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 <[email protected]>",
  "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"
  }
}
  1. running yarn add babel-preset-env.
  2. And finally running yarn run build successfully.

Markdown guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant