0

I tried to enter yarn run build in boilerplate. but it shows warning/error

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value.
Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/

ERROR in main
Module not found: Error: Can't resolve './src' in 'C:\Users\0110\Documents\boilerplate-mern-stack-master'
resolve './src' in 'C:\Users\0110\Documents\boilerplate-mern-stack-master'
  using description file: C:\Users\0110\Documents\boilerplate-mern-stack-master\package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    using description file: C:\Users\0110\Documents\boilerplate-mern-stack-master\package.json (relative path: ./src)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\0110\Documents\boilerplate-mern-stack-master\src doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\0110\Documents\boilerplate-mern-stack-master\src.js doesn't exist
      .json
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\0110\Documents\boilerplate-mern-stack-master\src.json doesn't exist
      .wasm
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\0110\Documents\boilerplate-mern-stack-master\src.wasm doesn't exist
      as directory
        C:\Users\0110\Documents\boilerplate-mern-stack-master\src doesn't exist

webpack 5.74.0 compiled with 1 error and 1 warning in 494 ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

There is an error in ./src, but I don't know what this means.

This is my package.json

{
  "name": "react-boiler-plate",
  "version": "1.0.0",
  "description": "react boiler plate",
  "main": "index.js",
  "engine": {
    "node": "10.16.0",
    "npm": "6.9.0"
  },
  "scripts": {
    "start": "node server/index.js",
    "build": "webpack",
    "backend": "nodemon server/index.js",
    "frontend": "npm run start --prefix client",
    "dev": "concurrently \"npm run backend\" \"npm run start --prefix client\"",
    "predeploy": "yarn build",
    "deploy": "gh-pages -d build"
  },
  "dependencies": {
    "async": "^3.2.0",
    "bcrypt": "^5.0.1",
    "body-parser": "^1.18.3",
    "cookie-parser": "^1.4.3",
    "cors": "^2.8.5",
    "debug": "^4.1.1",
    "express": "^4.17.1",
    "jsonwebtoken": "^8.5.1",
    "moment": "^2.24.0",
    "mongoose": "^5.4.20",
    "multer": "^1.4.2",
    "react-redux": "^5.0.7",
    "saslprep": "^1.0.3",
    "supports-color": "^7.1.0",
    "webpack": "^5.74.0"
  },
  "devDependencies": {
    "concurrently": "^4.1.0",
    "gh-pages": "^4.0.0",
    "nodemon": "^1.19.1",
    "webpack-cli": "^4.10.0"
  }
}

I used both yarn and npm but it still didn't work I don't know why I can't run build only for this project. This is my first time using boilerplate.

Penguin
  • 1
  • 1

0 Answers0