markusenglund / react-kanban

A Trello-like application built with React and Redux. Take a look at the live website:
https://www.reactkanban.com
MIT License
1.73k stars 245 forks source link

npm install now working. #24

Open Gouran21 opened 5 years ago

Gouran21 commented 5 years ago

Hello, can some one tell me why i have so much errors trying to install app? 2019-11-07T10_16_28_390Z-debug.log

JadeVane commented 4 years ago

In fact, the problem you need to face is far more than npm install because many dependencies have not been updated for too long, so many problems will arise, but after hard work, I have found a solution. just have a try step by step.

firstly, run

npm install

you might get tons of annoying message, and something important will be found at the end like

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-sass@4.11.0 postinstall: node scripts/build.js npm ERR! Exit status 1

npm report that there were something wrong with node-sass, so just reinstall it:

npm uninstall node-sass
npm install node-sass@latest   # you might get error again here, just go aheah
npm rebuild node-sass

try again now

npm install

those annoying error messages had disappeared, but you may get something else:

found 2549 vulnerabilities (1057 low, 15 moderate, 1477 high) run npm audit fix to fix them, or npm audit for details

don't worry, just forget it, then install the newer version of webpack-cli, for example, 3.1, or you will get lots of red message after run npm run build

npm i webpack-cli@3.1.1 -D

at the same time, babel needs to be upgraded to newer version

npm i babel-loader @babel/core @babel/runtime @babel/preset-env @babel/plugin-proposal-class-properties @babel/plugin-transform-runtime -D

the new version has different way of using, so it's necessary to make some changes to the configuration file

cp .babelrc .babelrc-bak
vim .babelrc

make the following changes

    {
-     "presets": [
-       [
-         "@babel/env",
-         {
-           "modules": false,
-           "loose": true
-         }
-       ],
-       ["@babel/preset-stage-2", { "decoratorsLegacy": true }],
-       "@babel/react"
-     ],
+     "presets": ["@babel/preset-react","@babel/preset-env"],
+     "plugins": ["@babel/plugin-transform-runtime","@babel/plugin-proposal-class-properties"],
      "env": {
        "production": {
          "plugins": [
            ["@babel/plugin-transform-runtime", { "useBuiltIns": true }],
            [
              "transform-react-remove-prop-types",
              {
                "removeImport": true
              }
            ]
          ]
        }
      }
    }

and it time to build the project:

npm run build

then open a new terminal and run

npm run serve

enjoy yourself at http://127.0.0.1:1337

melyssamariana commented 3 years ago

I am having another problem ? `Unknown argument: mode

npm ERR! Linux 4.15.0-137-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "build" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code ELIFECYCLE npm ERR! react-kanban@0.1.0 build: webpack --watch --mode development npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the react-kanban@0.1.0 build script 'webpack --watch --mode development'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the react-kanban package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! webpack --watch --mode development npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs react-kanban npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls react-kanban npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: `