인프런 커뮤니티 질문&답변

미니여나님의 프로필 이미지
미니여나

작성한 질문수

따라하며 배우는 노드, 리액트 시리즈 - 영화 사이트 만들기

무비앱 시리즈 #4 Landing Page 만들기 (1) ( 따라하며 배우는 리액트 노드 )

npm run dev 명령어 오류

작성

·

466

2

안녕하세요. 좋은 강의 감사합니다!

다름이 아니라 1분 53초 즈음에 npm run dev 명령어 실행이 되지않아서요.

명령어를 입력하면 아래와 같은 에러메세지가 나옵니다.

> react-boiler-plate@1.0.0 dev
> concurrently "npm run backend" "npm run start --prefix client"

sh: concurrently: command not found
npm ERR! code 127
npm ERR! path /Users/naeaipon/Documents/react:node.js clone coding project-1/boilerplate-mern-stack-master
npm ERR! command failed
npm ERR! command sh -c concurrently "npm run backend" "npm run start --prefix client"

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/naeaipon/.npm/_logs/2021-01-11T05_17_12_835Z-debug.log

답변 3

0

import React, { useEffect, useState } from 'react';
import { FaCode } from "react-icons/fa";
import { API_URL, API_KEY, IMAGE_BASE_URL } from '../../Config';
import MainImage from './Sections/MainImage';
// npm run dev

function LandingPage() {

const [Movies, setMovies] = useState([])
const [MainMovieImage, setMainMovieImage] = useState(null)

useEffect(() => {
const endpoint = `${API_URL}movie/popular?api_key=${API_KEY}&language=en-US&page=1`;

fetch(endpoint)
.then(response => response.json())
.then(response => {
console.log(response)

setMovies([response.results])
setMainMovieImage([response.results[0]])
})

}, [])


return (
<div style={{ width: '100%', margin: '0' }}>

{/* Main Image */}
{MainMovieImage &&
<MainImage
image={`${IMAGE_BASE_URL}w1280${MainMovieImage.backdrop_path}`}
title={MainMovieImage.original_title}
text={MainMovieImage.overview}
/>
}

<div style={{ width: '85%', margin: '1rem auto' }}>

<h2>Movies by latest</h2>
<hr />

{/* Movie Grid Cards */}

</div>

<div style={{ display: 'flex', justifyContent: 'center' }}>
<button>Load More</button>
</div>
</div>
)
}

export default LandingPage
 
 
결과 출력이 안 돼요 ㅠㅠ

0

https://js-note.tistory.com/38

npm run dev 오류 시 참고하세요.

0

미니여나님의 프로필 이미지
미니여나
질문자

그리고 로그는 이렇게 나오네요... 

0 verbose cli [
0 verbose cli   '/usr/local/Cellar/node/15.4.0/bin/node',
0 verbose cli   '/usr/local/bin/npm',
0 verbose cli   'run',
0 verbose cli   'dev'
0 verbose cli ]
1 info using npm@7.4.0
2 info using node@v15.4.0
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:/Users/naeaipon/Documents/react:node.js clone coding project-1/boilerplate-mern-stack-master/.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:/Users/naeaipon/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 7ms
19 verbose npm-session c5cfc0ec9468b546
20 timing npm:load Completed in 13ms
21 timing command:run-script Completed in 11ms
22 verbose stack Error: command failed
22 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
22 verbose stack     at ChildProcess.emit (node:events:376:20)
22 verbose stack     at maybeClose (node:internal/child_process:1063:16)
22 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:295:5)
23 verbose pkgid react-boiler-plate@1.0.0
24 verbose cwd /Users/naeaipon/Documents/react:node.js clone coding project-1/boilerplate-mern-stack-master
25 verbose Darwin 20.2.0
26 verbose argv "/usr/local/Cellar/node/15.4.0/bin/node" "/usr/local/bin/npm" "run" "dev"
27 verbose node v15.4.0
28 verbose npm  v7.4.0
29 error code 127
30 error path /Users/naeaipon/Documents/react:node.js clone coding project-1/boilerplate-mern-stack-master
31 error command failed
32 error command sh -c concurrently "npm run backend" "npm run start --prefix client"
33 verbose exit 127
미니여나님의 프로필 이미지
미니여나

작성한 질문수

질문하기