From 08eaf298c1be7045f14589110289b2dd53c85fe1 Mon Sep 17 00:00:00 2001 From: turbodog03 <63595854+turbodog03@users.noreply.github.com> Date: Fri, 17 Sep 2021 17:07:31 +0800 Subject: [PATCH] feat: ban npm to solve potential bugs (#296) Signed-off-by: turbodog03 <63595854+turbodog03@users.noreply.github.com> --- README.md | 6 +++--- web/package.json | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3ac2132c..439ee75e 100644 --- a/README.md +++ b/README.md @@ -85,9 +85,9 @@ Casdoor provides two run modes, the difference is binary size and user prompt. Edit `conf/app.conf`, set `runmode=dev`. Firstly build front-end files: ```bash -cd web/ && npm install && npm run start +cd web/ && yarn && yarn run start ``` -*❗ A word of caution ❗: the `npm` commands above need a recommended system RAM of at least 4GB. It has a potential failure during building the files if your RAM is not sufficient.* +*❗ A word of caution ❗: Casdoor's front-end is built using yarn. You should use `yarn` instead of `npm`. It has a potential failure during building the files if you use `npm`.* Then build back-end binary file, change directory to root(Relative to casdoor): @@ -103,7 +103,7 @@ That's it! Try to visit http://127.0.0.1:7001/. :small_airplane: Edit `conf/app.conf`, set `runmode=prod`. Firstly build front-end files: ```bash -cd web/ && npm install && npm run build +cd web/ && yarn && yarn run build ``` Then build back-end binary file, change directory to root(Relative to casdoor): diff --git a/web/package.json b/web/package.json index d43d3b63..2baa5885 100644 --- a/web/package.json +++ b/web/package.json @@ -32,7 +32,8 @@ "build": "craco build", "test": "craco test", "eject": "craco eject", - "crowdin:sync": "crowdin upload && crowdin download" + "crowdin:sync": "crowdin upload && crowdin download", + "preinstall": "npx use-yarn -m 'Please use yarn!'" }, "eslintConfig": { "extends": "react-app"