Gatsby로 기술블로그 쓰려고 node을 조금 만졌는데.. 중간에 다양한 에러가 발생해서 나중을 위해 기록한다.
나도 이 이슈와 같은 문제를 겪었다. 🥲
$ node -v를 통해 노드 버전을 확인하고 latest 버전이랑 너무 멀면 아래 명령어로 업데이트 하자. 참고
sudo npm install n -g
sudo n stable처음에는 이렇게 emotions/react 관련 not found 에러만 뜨길레 해당 부분만 설치했는데. 나중에는 다른 것(react, styled)도 뜸.
stackoverflow에서 어느 분이 all stop solution을 공유해주셨는데 그냥 이거 쓰면 될 것 같다.
npm install @mui/material @emotion/react @emotion/styled잦은 변경이 발생하는 환경에서는 로컬 CPU의 부하를 줄 수 있기 때문에 꼭 필요할 때 사용하자.
- nodemon, kill-port 설치
npm install nodemon kill-port --save-dev(*옵션) --watch, --exec 커맨드를 통해 지켜보고 있을 파일을 선택할 수 있다.
nodemon --exec "your command here" --watch "filename 1" --watch "filename n" --watch "directory name"(*옵션) 실행하려는 명령에 대해 kill-port를 사용해서 기존 프로세스의 port 점유를 막는다.
kill-port --port 8000- 해당 옵션들을 적절히 활용하여 커맨드를 만들고
package.json/script에 추가합니다.
"scripts": {
"dev-auto-restart": "nodemon --exec 'kill-port --port 8000 && gatsby develop' --watch gatsby-node.js --watch package.json --watch gatsby-config.js"
}- 추가한 script/명령어로 실행합니다.
npm run dev-auto-restartgyp gypERR! ERR!find Python **********************************************************
find Pythongyp - "python2" is not in PATH or produced an error
gypERR! ERR!find Python You need to install the latest version of Python.
gypfind Python checking if "python3" can be used
ERR!gyp find PythonERR! Node-gyp should be able to find and use Python. If not,
gyp find PythonERR! - "python3" is not in PATH or produced an error
gypfind Python you can try one of the following options:
gypERR! ERR!find Python checking if the py launcher can be used to find Python 2
find Pythongyp - Use the switch --python="C:\Path\To\python.exe"
ERR!gyp find Python - "py.exe" is not in PATH or produced an error
ERR!gyp ERR!find Python (accepted by both node-gyp and npm)
find Python checking if Python is C:\Python27\python.exe
gyp gypERR! ERR! find Pythonfind Python - Set the environment variable PYTHON
- "C:\Python27\python.exe" could not be run
gypgyp ERR!ERR! find Pythonfind Python - Set the npm configuration variable python:
checking if Python is C:\Python37\python.exe
gyp gypERR! find PythonERR! npm config set python "C:\Path\To\python.exe"
gypfind Python - "C:\Python37\python.exe" could not be run
gypERR! find PythonERR! For more information consult the documentation at:
find Pythongypnode_modules 를 install 하는데 도대체 왜 python 에러가 뜨는걸까..

