# 把hexo移到了mac上 URL: https://chengjinfang.com/posts/2017/install-machexo/ Author: 程锦方 Date: 2017-11-14 Tags: #install Summary: 把 Hexo 博客迁移到 Mac,记录 Node.js、Homebrew 的安装和遇到的编译错误。 ------------------------------------------------------------------------ ## 安装 下载node https://nodejs.org/en/ 下载 homebrew http://brew.sh/index_zh-cn.html 下载HEXO https://hexo.io/zh-cn/docs/ ## 错误 遇到一个因为没有翻墙而发生的错误 ``` ../src/sass_context_wrapper.h:8:10: fatal error: 'sass/context.h' file not found #include ^~~~~~~~~~~~~~~~ 1 error generated. make: *** [Release/obj.target/binding/src/binding.o] Error 1 gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/Users/jin/Dropbox/blog/node_modules/node-gyp/lib/build.js:258:23) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Darwin 17.2.0 gyp ERR! command "/usr/local/bin/node" "/Users/jin/Dropbox/blog/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd /Users/jin/Dropbox/blog/node_modules/node-sass gyp ERR! node -v v8.9.1 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok Build failed with error code: 1 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-sass@4.6.1 postinstall: `node scripts/build.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-sass@4.6.1 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/jin/.npm/_logs/2017-11-15T15_43_47_806Z-debug.log ··· 解决方法 https://github.com/lmk123/blog/issues/28 还出现一个错误 ``` { Error: Cannot find module './build/Release/DTraceProviderBindings' at Function.Module._resolveFilename (module.js:470:15) at Function.Module._load (module.js:418:25) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object. (/xxxx/xx/xx/xx/xx/xx/xx/node_modules/dtrace-provider/dtrace-provider.js:17:23) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) code: 'MODULE_NOT_FOUND' } ``` 解决方法 ``` npm install dtrace-provider --save ``` ------------------------------------------------------------------------ Site: https://chengjinfang.com/ · All Index: https://chengjinfang.com/all/ · RSS: https://chengjinfang.com/rss.xml