본문 바로가기
Front-End (web)

[Vue.js] node-sass, fsevents Error

by 햄과함께 2019. 8. 30.
320x100

Problem

33 warnings and 15 errors generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/*****/node_modules/npm/node_modules/node-gyp/lib/build.js:196:23)
gyp ERR! stack     at ChildProcess.emit (events.js:209:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 17.4.0
gyp ERR! command "/*****/Cellar/node/12.9.1/bin/node" "/*****/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/*****/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node" "--module_name=fse" "--module_path=/*****/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64"
gyp ERR! cwd /*****/node_modules/fsevents
gyp ERR! node -v v12.9.1
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
33 warnings and 15 errors generated.
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/*****/Cellar/node/12.9.1/bin/node /*****/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/*****/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/*****/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/*****/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:209:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
node-pre-gyp ERR! System Darwin 17.4.0
node-pre-gyp ERR! command "/*****/Cellar/node/12.9.1/bin/node" "/*****/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /*****/node_modules/fsevents
node-pre-gyp ERR! node -v v12.9.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/*****/Cellar/node/12.9.1/bin/node /*****/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/*****/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/*****/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64' (1)
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/*****/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:196:23)
gyp ERR! stack     at ChildProcess.emit (events.js:209:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 17.4.0
gyp ERR! command "/*****/Cellar/node/12.9.1/bin/node" "/*****/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/*****/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node" "--module_name=fse" "--module_path=/*****/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64"
gyp ERR! cwd /*****/node_modules/fsevents
gyp ERR! node -v v12.9.1
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok

> node-sass@4.12.0 install /*****/node_modules/node-sass
> node scripts/install.js

Cached binary found at /*****/.npm/node-sass/4.12.0/darwin-x64-72_binding.node

> uglifyjs-webpack-plugin@0.4.6 postinstall /*****/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> node-sass@4.12.0 postinstall /*****/node_modules/node-sass
> node scripts/build.js

Binary found at /*****/node_modules/node-sass/vendor/darwin-x64-72/binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

added 1103 packages from 641 contributors in 32.08s

node 버전 업을 하니까 위와 같이 node-sass, fsevents가 에러가 발생했다.

Solve

먼저 node-sass 버전을 4.5.3 -> 4.12.0 로 업그레이드 했다.

그래도 fsevents에 문제가 계속 발생하여

$ env TOUCH=/usr/bin/touch npm install fsevents

위 명령어를 실행해서 해결했다.

추가 문제 & 해결

위 명령어를 실행하면 fsevents 의존성이 package.json에 추가되는데 linux 환경에 배포하니까 os가 안맞는다고 에러가 발생했다.
실제로 fsevents 의존성이 필요한건 아니라서 package.json에서 삭제하면 해결할 수 있다.

node-sass ENOENT: no such file or directory,

node-sass 버전업하면서 로컬에서는 잘되는데 서버 배포시 위와 같은 에러가 발생했다.

$ npm rebuild node-sass

위 명령어로 리빌드 해줘서 해결했다.
빌드 서버 들어가서 해도 되는데 서버 접속하기 싫어서 젠킨스 빌드 스크립트에 npm install 다음에 추가해서 한 번 실행시킨뒤에 잘 되는 것을 확인하고 추가한 리빌드 스크립트를 삭제했다.


참고

[Unsupported] Installing node-sass 4.5.3 on Node 10
Unable to install fsevents - node-pre-gyp install --fallback-to-build
/node-sass/vendor no such file or directory in node-sass@3.13.0

320x100

댓글