[vue.js] 각종 에러 해결법 (npm ERR! code 1[node-sass])
#
npm i ol 를 진행
npm ERR! code 1
npm ERR! path D:\2024\프론트엔드 프레임워크\project\frontend\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
#
위와 같이 에러가 나온다.
npm update --force 를 cmd 창에서 해본다.
해주면 아래와 같이 노드 버전에 맞는게 필요하다라는 문구로 바뀐다.
#
D:\2024\프론트엔드 프레임워크\project\frontend>npm install --save-dev node-sass sass-loader@^10
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@achrinza/node-ipc@9.2.2',
npm WARN EBADENGINE required: { node: '8 || 10 || 12 || 14 || 16 || 17' },
npm WARN EBADENGINE current: { node: 'v20.11.1', npm: '10.5.0' }
npm WARN EBADENGINE }
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
#
nvm으로 노드 버전을 다운그레이드를 쉽게 할 수 있다고 한다.
그래서 처음에 nvm을 다운받았다.
그리고 버전 변경 리스트를 보니 18~20버전 뿐이었다.
그래서 그냥 node.js를 제어판에서 삭제했다.
그 후에 node 16버전 설치
#
npm i ol
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN cli npm v10.5.0 does not support Node.js v16.16.0. This version of npm supports the following node versions: `^18.17.0 || >=20.5.0`. You can find the latest version at https://nodejs.org/.
가 나왔다. 혹시나 그전에 있던 node_modules가 문제지 않을까? 싶어서 삭제 했다.
up to date, audited 1598 packages in 6s
141 packages are looking for funding
run `npm fund` for details
72 vulnerabilities (1 low, 50 moderate, 16 high, 5 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
정상적으로 설치 됐다.
나머지도 해줄려고
npm update --force
npm install -g --save-dev node-sass sass-loader@^10
npm i -g ol 하니 정상적으로 설치 됨.