Recent Posts
Recent Comments
Archives
๋ฐ˜์‘ํ˜•
250x250
ยซ   2024/05   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Today
Yesterday

Total
05-19 00:00
๊ด€๋ฆฌ ๋ฉ”๋‰ด

Hey Tech

[React] ์˜ค๋ฅ˜ ํ•ด๊ฒฐ: "sh: react-scripts: command not found" ๋ณธ๋ฌธ

SW ๊ฐœ๋ฐœ/React JS

[React] ์˜ค๋ฅ˜ ํ•ด๊ฒฐ: "sh: react-scripts: command not found"

Tony Park 2022. 6. 15. 10:15
728x90
๋ฐ˜์‘ํ˜•

๐Ÿค– ์—๋Ÿฌ ์ƒํ™ฉ

React์—์„œ ๋ฐฐํฌ ํŒŒ์ผ ์ƒ์„ฑ ์‹œ๋„ ์ค‘ ์—๋Ÿฌ๋ฅผ ๋งˆ์ฃผํ•˜์˜€์Šต๋‹ˆ๋‹ค.

npm run build

๋ฐฐํฌ ํŒŒ์ผ ์ƒ์„ฑ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ React ์„œ๋ฒ„ ์‹คํ–‰ ์‹œ๋„์—๋„ ๊ฐ™์€ ์—๋Ÿฌ๋ฅผ ๋งˆ์ฃผํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ“ ์—๋Ÿฌ ์ฝ”๋“œ

sh: react-scripts: command not found

๐Ÿ’ก ์›์ธ

package.json ๋‚ด ๋ชจ๋“  dependency๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜์ง€ ์•Š์•„์„œ package.json ๋‚ด script๋ฅผ ์ œ๋Œ€๋กœ ์ผ์–ด์˜ค์ง€ ๋ชปํ•˜์—ฌ ๋ฐœ์ƒํ•œ ์—๋Ÿฌ์ž…๋‹ˆ๋‹ค.

โœ… ํ•ด๊ฒฐ๋ฐฉ๋ฒ•

npm install ์„ ํ†ตํ•ด ๋ชจ๋“  ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•ด ์ค๋‹ˆ๋‹ค.

npm install

npm install๋กœ ํ•ด๊ฒฐ๋˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ

๋ชจ๋“  ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•˜์˜€์Œ์—๋„ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค๋ฉด, node-modules ํด๋”๋ฅผ ์‚ญ์ œํ•˜๊ณ  ๋‹ค์‹œ ๋ชจ๋“  ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•ด ๋ณด์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค.

rm -rf node_modules
npm install

ํฌ์ŠคํŒ… ๋‚ด์šฉ์— ์˜ค๋ฅ˜๊ฐ€ ์žˆ๊ฑฐ๋‚˜ ๋ณด์™„ํ•  ์‚ฌํ•ญ์ด ์žˆ๋‹ค๋ฉด ์•„๋ž˜์— ๋Œ“๊ธ€ ๋‚จ๊ฒจ์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌ๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค.

๊ทธ๋Ÿผ ์˜ค๋Š˜๋„ ์ฆ๊ฑฐ์šด ํ•˜๋ฃจ ๋ณด๋‚ด์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค :)

๊ณ ๋ง™์Šต๋‹ˆ๋‹ค๐Ÿ˜Š

728x90
๋ฐ˜์‘ํ˜•
Comments