npm으로 만들었던 프로젝트인데 yarn 설치하고 yarn 한다음에 start해보니까 아래와 같이 에러..
PS C:\my\selfmemory\myreact\selfmemory-react> yarn start
yarn run v1.22.19
$ react-scripts start
internal/modules/cjs/loader.js:892
throw err;
^
Require stack:
- C:\my\selfmemory\myreact\selfmemory-react\node_modules\react-dev-utils\crossSpawn.js
- C:\my\selfmemory\myreact\selfmemory-react\node_modules\react-scripts\bin\react-scripts.js
npm start로 해도 마찬가지..
해결은 의외로 간단하게 npm install로 다시 install하니까 됐다.
원인이 뭘까 궁금해서 다시 설치해보면서 이것저것 시도해봤다.
기존에 설치한 npm 모듈들을 지우고 yarn으로 설치해서 해보니 해결됐다. npm이 설치한 모듈들을 yarn이 접근할 수 없어서 생겨서 설치를 제대로 못하고 에러가 발생해서 생긴 문제 같다.
$ yarn
yarn install v1.22.19
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files.
To clear this warning, remove package-lock.json.
yarn으로 할 때 뜨는 경고인데 혹시 몰라서 이거 삭제했다.
그리고 yarn으로 설치할 때 보니까 다음과 같은 에러 떴다.
error Could not write file "C:\\my\\selfmemory\\myreact\\selfmemory-react\\yarn-error.log": "EPERM: operation not permitted, open 'C:\\my\\selfmemory\\myreact\\selfmemory-react\\yarn-error.log'"
error An unexpected error occurred: "EPERM: operation not permitted, copyfile 'C:\\Users\\user\\AppData\\Local\\Yarn\\Cache\\v6\\npm-aria-query-4.2.2-0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b-integrity\\node_modules\\aria-query\\LICENSE' -> 'C:\\my\\selfmemory\\myreact\\selfmemory-react\\node_modules\\eslint-plugin-jsx-a11y\\node_modules\\aria-query\\LICENSE'".
npm으로 설치한 모듈파일에 대해 권한이 없는건가?
node_modules 폴더도 아예 삭제하고 다시해봤다.