개발햄비

Cannot find module 'semver' 해결 본문

개발/버그 해결 기록

Cannot find module 'semver' 해결

개발햄 2019. 10. 9. 22:15

아래와 같은 오류 발생 

internal/modules/cjs/loader.js:615
    throw err;
    ^

Error: Cannot find module 'semver'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:613:15)
    at Function.Module._load (internal/modules/cjs/loader.js:539:25)
    at Module.require (internal/modules/cjs/loader.js:667:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/ihanbi/Desktop/vue_SpringBoot/frontend/build/check-versions.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:738:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10)
    at Module.load (internal/modules/cjs/loader.js:630:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
    at Function.Module._load (internal/modules/cjs/loader.js:562:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue_springboot@1.0.0 build: `node build/build.js`

해결책

$ sudo rm -rf /usr/local/lib/node_modules
$ sudo rm -rf ~/.npm
$ brew uninstall --force node
$ brew install node