나는 두 명령을 확인했다 npm start
및 npm run start
모두 완벽하게 작동합니다. 나는 create-react-app을 사용했습니다. 그러나 CSS 모듈에서 구성을 변경하기 위해 실행 npm eject
하지만 오류가 발생합니다.
하지만 npm run eject
작동 했나요? 왜 npm eject
작동하지 않았 는지 혼란 스럽습니다 . 이것을 구성 할 수 있습니까?
아래는 내 package.json
:
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
답변
npm test
, npm start
, npm restart
,과 npm stop
에 대한 모든 별명은npm run xxx.
다른 모든 scripts
정의에는 npm run xxx
구문 을 사용해야 합니다.
자세한 내용은 https://docs.npmjs.com/cli/run-script 의 문서를 참조 하십시오.
답변
npm start
의 약식입니다 npm run start
. 그래서, 그것의 하나와 같은 것.