해결된 질문
작성
·
442
0
이렇게뜨는데.. 뭐가잘못된건가요?ㅠㅠ
> concurrently "npm run backend" "npm run start --prefix client"
[0]
[0] > react-boiler-plate@1.0.0 backend
[0] > nodemon server/index.js
[0]
[1]
[1] > client@0.1.0 start
[1] > react-scripts start
[1]
[1]
[1] There might be a problem with the project dependency tree.
[1] It is likely not a bug in Create React App, but something you need to fix locally.
[1]
[1] The react-scripts package provided by Create React App requires a dependency:
[1]
[1] "babel-loader": "8.1.0"
[1]
[1] Don't try to install it manually: your package manager does it automatically.
[1] However, a different version of babel-loader was detected higher up in the tree:
[1]
[1] C:\Users\82109\node_modules\babel-loader (version: 8.2.3)
[1]
[1] Manually installing incompatible versions is known to cause hard-to-debug issues.
[1]
[1] If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
[1] That will permanently disable this message but you might encounter other issues.
[1]
[1] To fix the dependency tree, try following the steps below in the exact order:
[1]
[1] 1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
[1] 2. Delete node_modules in your project folder.
[1] 3. Remove "babel-loader" from dependencies and/or devDependencies in the package.json file in your project folder.
[1] 4. Run npm install or yarn, depending on the package manager you use.
[1]
[1] In most cases, this should be enough to fix the problem.
[1] If this has not helped, there are a few other things you can try:
[1]
[1] 5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
[1] This may help because npm has known issues with package hoisting which may get resolved in future versions.
[1]
[1] 6. Check if C:\Users\82109\node_modules\babel-loader is outside your project directory.
[1] For example, you might have accidentally installed something in your home folder.
[1]
[1] 7. Try running npm ls babel-loader in your project folder.
[1] This will tell you which other package (apart from the expected react-scripts) installed babel-loader.
[1]
[1] If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
[1] That would permanently disable this preflight check in case you want to proceed anyway.
[1]
[1] P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!
[1]
[1] npm run start --prefix client exited with code 1
[0] [nodemon] 1.19.4
[0] [nodemon] to restart at any time, enter `rs`
[0] [nodemon] watching dir(s): *.*
[0] [nodemon] watching extensions: js,mjs,json
[0] [nodemon] starting `node server/index.js`
[0] node:internal/modules/cjs/loader:936
[0] throw err;
[0] ^
[0]
[0] Error: Cannot find module 'bcrypt'
[0] Require stack:
[0] - C:\Users\82109\Downloads\boilerplate-mern-stack-master\server\models\User.js
[0] - C:\Users\82109\Downloads\boilerplate-mern-stack-master\server\routes\users.js
[0] - C:\Users\82109\Downloads\boilerplate-mern-stack-master\server\index.js
[0] at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
[0] at Function.Module._load (node:internal/modules/cjs/loader:778:27)
[0] at Module.require (node:internal/modules/cjs/loader:1005:19)
[0] at require (node:internal/modules/cjs/helpers:102:18)
[0] at Object.<anonymous> (C:\Users\82109\Downloads\boilerplate-mern-stack-master\server\models\User.js:2:16)
[0] at Module._compile (node:internal/modules/cjs/loader:1103:14)
[0] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
[0] at Module.load (node:internal/modules/cjs/loader:981:32)
[0] at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[0] at Module.require (node:internal/modules/cjs/loader:1005:19)
[0] at require (node:internal/modules/cjs/helpers:102:18)
[0] at Object.<anonymous> (C:\Users\82109\Downloads\boilerplate-mern-stack-master\server\routes\users.js:3:18)
[0] at Module._compile (node:internal/modules/cjs/loader:1103:14)
[0] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
[0] at Module.load (node:internal/modules/cjs/loader:981:32)
[0] at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
[0] code: 'MODULE_NOT_FOUND',
[0] requireStack: [
[0] 'C:\\Users\\82109\\Downloads\\boilerplate-mern-stack-master\\server\\models\\User.js',
[0] 'C:\\Users\\82109\\Downloads\\boilerplate-mern-stack-master\\server\\routes\\users.js',
[0] 'C:\\Users\\82109\\Downloads\\boilerplate-mern-stack-master\\server\\index.js'
[0] ]
[0] }
[0] [nodemon] app crashed - waiting for file changes before starting...
답변 1
0
안녕하세요
우선 .env 라는 파일을 생성하신 후에
SKIP_PREFLIGHT_CHECK=true
이 텍스트를 넣어주세요.
그리고 bcrypt 모듈 대신에 bcryptjs 모듈을 설치해주세요.
npm install bcryptjs --save 하시면 됩니다 !
감사합니다.