hexo: hexo can't install on macbook

Environment Info

version

v3.10.9

system osx EI 10.11.6

question

  1. i have trynpm install npm install -g hexo-cli;

the result

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
/usr/local/lib
├─┬ hexo-cli@1.0.2 
│ ├── abbrev@1.0.9 
│ ├── bluebird@3.4.6 
│ ├─┬ chalk@1.1.3 
│ │ ├── ansi-styles@2.2.1 
│ │ ├── escape-string-regexp@1.0.5 
│ │ ├─┬ has-ansi@2.0.0 
│ │ │ └── ansi-regex@2.0.0 
│ │ ├── strip-ansi@3.0.1 
│ │ └── supports-color@2.0.0 
│ ├─┬ hexo-fs@0.1.6 
│ │ ├─┬ chokidar@1.6.1 
│ │ │ ├─┬ anymatch@1.3.0 
│ │ │ │ ├── arrify@1.0.1 
│ │ │ │ └─┬ micromatch@2.3.11 
│ │ │ │   ├─┬ arr-diff@2.0.0 
│ │ │ │   │ └── arr-flatten@1.0.1 
│ │ │ │   ├── array-unique@0.2.1 
│ │ │ │   ├─┬ braces@1.8.5 
│ │ │ │   │ ├─┬ expand-range@1.8.2 
│ │ │ │   │ │ └─┬ fill-range@2.2.3 
│ │ │ │   │ │   ├── is-number@2.1.0 
│ │ │ │   │ │   ├── isobject@2.1.0 
│ │ │ │   │ │   ├── randomatic@1.1.5 
│ │ │ │   │ │   └── repeat-string@1.6.1 
│ │ │ │   │ ├── preserve@0.2.0 
│ │ │ │   │ └── repeat-element@1.1.2 
│ │ │ │   ├─┬ expand-brackets@0.1.5 
│ │ │ │   │ └── is-posix-bracket@0.1.1 
│ │ │ │   ├── extglob@0.3.2 
│ │ │ │   ├── filename-regex@2.0.0 
│ │ │ │   ├─┬ kind-of@3.0.4 
│ │ │ │   │ └── is-buffer@1.1.4 
│ │ │ │   ├── normalize-path@2.0.1 
│ │ │ │   ├─┬ object.omit@2.0.1 
│ │ │ │   │ ├─┬ for-own@0.1.4 
│ │ │ │   │ │ └── for-in@0.1.6 
│ │ │ │   │ └── is-extendable@0.1.1 
│ │ │ │   ├─┬ parse-glob@3.0.4 
│ │ │ │   │ ├── glob-base@0.3.0 
│ │ │ │   │ └── is-dotfile@1.0.2 
│ │ │ │   └─┬ regex-cache@0.4.3 
│ │ │ │     ├── is-equal-shallow@0.1.3 
│ │ │ │     └── is-primitive@2.0.0 
│ │ │ ├── async-each@1.0.1 
│ │ │ ├─┬ fsevents@1.0.15 
│ │ │ │ ├── nan@2.4.0 
│ │ │ │ └─┬ node-pre-gyp@0.6.29 
│ │ │ │   ├─┬ mkdirp@0.5.1 
│ │ │ │   │ └── minimist@0.0.8 
│ │ │ │   ├─┬ nopt@3.0.6 
│ │ │ │   │ └── abbrev@1.0.9 
│ │ │ │   ├─┬ npmlog@3.1.2 
│ │ │ │   │ ├─┬ are-we-there-yet@1.1.2 
│ │ │ │   │ │ └── delegates@1.0.0 
│ │ │ │   │ ├── console-control-strings@1.1.0 
│ │ │ │   │ ├─┬ gauge@2.6.0 
│ │ │ │   │ │ ├── aproba@1.0.4 
│ │ │ │   │ │ ├── has-color@0.1.7 
│ │ │ │   │ │ ├── has-unicode@2.0.1 
│ │ │ │   │ │ ├── object-assign@4.1.0 
│ │ │ │   │ │ ├── signal-exit@3.0.0 
│ │ │ │   │ │ ├─┬ string-width@1.0.1 
│ │ │ │   │ │ │ ├─┬ code-point-at@1.0.0 
│ │ │ │   │ │ │ │ └── number-is-nan@1.0.0 
│ │ │ │   │ │ │ └── is-fullwidth-code-point@1.0.0 
│ │ │ │   │ │ ├─┬ strip-ansi@3.0.1 
│ │ │ │   │ │ │ └── ansi-regex@2.0.0 
│ │ │ │   │ │ └── wide-align@1.1.0 
│ │ │ │   │ └── set-blocking@2.0.0 
│ │ │ │   ├─┬ rc@1.1.6 
│ │ │ │   │ ├── deep-extend@0.4.1 
│ │ │ │   │ ├── ini@1.3.4 
│ │ │ │   │ ├── minimist@1.2.0 
│ │ │ │   │ └── strip-json-comments@1.0.4 
│ │ │ │   ├─┬ request@2.73.0 
│ │ │ │   │ ├── aws-sign2@0.6.0 
│ │ │ │   │ ├── aws4@1.4.1 
│ │ │ │   │ ├─┬ bl@1.1.2 
│ │ │ │   │ │ └── readable-stream@2.0.6 
│ │ │ │   │ ├── caseless@0.11.0 
│ │ │ │   │ ├─┬ combined-stream@1.0.5 
│ │ │ │   │ │ └── delayed-stream@1.0.0 
│ │ │ │   │ ├── extend@3.0.0 
│ │ │ │   │ ├── forever-agent@0.6.1 
│ │ │ │   │ ├─┬ form-data@1.0.0-rc4 
│ │ │ │   │ │ └── async@1.5.2 
│ │ │ │   │ ├─┬ har-validator@2.0.6 
│ │ │ │   │ │ ├─┬ chalk@1.1.3 
│ │ │ │   │ │ │ ├── ansi-styles@2.2.1 
│ │ │ │   │ │ │ ├── escape-string-regexp@1.0.5 
│ │ │ │   │ │ │ ├── has-ansi@2.0.0 
│ │ │ │   │ │ │ └── supports-color@2.0.0 
│ │ │ │   │ │ ├─┬ commander@2.9.0 
│ │ │ │   │ │ │ └── graceful-readlink@1.0.1 
│ │ │ │   │ │ ├─┬ is-my-json-valid@2.13.1 
│ │ │ │   │ │ │ ├── generate-function@2.0.0 
│ │ │ │   │ │ │ ├─┬ generate-object-property@1.2.0 
│ │ │ │   │ │ │ │ └── is-property@1.0.2 
│ │ │ │   │ │ │ ├── jsonpointer@2.0.0 
│ │ │ │   │ │ │ └── xtend@4.0.1 
│ │ │ │   │ │ └─┬ pinkie-promise@2.0.1 
│ │ │ │   │ │   └── pinkie@2.0.4 
│ │ │ │   │ ├─┬ hawk@3.1.3 
│ │ │ │   │ │ ├── boom@2.10.1 
│ │ │ │   │ │ ├── cryptiles@2.0.5 
│ │ │ │   │ │ ├── hoek@2.16.3 
│ │ │ │   │ │ └── sntp@1.0.9 
│ │ │ │   │ ├─┬ http-signature@1.1.1 
│ │ │ │   │ │ ├── assert-plus@0.2.0 
│ │ │ │   │ │ ├─┬ jsprim@1.3.0 
│ │ │ │   │ │ │ ├── extsprintf@1.0.2 
│ │ │ │   │ │ │ ├── json-schema@0.2.2 
│ │ │ │   │ │ │ └── verror@1.3.6 
│ │ │ │   │ │ └─┬ sshpk@1.8.3 
│ │ │ │   │ │   ├── asn1@0.2.3 
│ │ │ │   │ │   ├── assert-plus@1.0.0 
│ │ │ │   │ │   ├─┬ dashdash@1.14.0 
│ │ │ │   │ │   │ └── assert-plus@1.0.0 
│ │ │ │   │ │   ├── ecc-jsbn@0.1.1 
│ │ │ │   │ │   ├─┬ getpass@0.1.6 
│ │ │ │   │ │   │ └── assert-plus@1.0.0 
│ │ │ │   │ │   ├── jodid25519@1.0.2 
│ │ │ │   │ │   ├── jsbn@0.1.0 
│ │ │ │   │ │   └── tweetnacl@0.13.3 
│ │ │ │   │ ├── is-typedarray@1.0.0 
│ │ │ │   │ ├── isstream@0.1.2 
│ │ │ │   │ ├── json-stringify-safe@5.0.1 
│ │ │ │   │ ├─┬ mime-types@2.1.11 
│ │ │ │   │ │ └── mime-db@1.23.0 
│ │ │ │   │ ├── node-uuid@1.4.7 
│ │ │ │   │ ├── oauth-sign@0.8.2 
│ │ │ │   │ ├── qs@6.2.0 
│ │ │ │   │ ├── stringstream@0.0.5 
│ │ │ │   │ ├── tough-cookie@2.2.2 
│ │ │ │   │ └── tunnel-agent@0.4.3 
│ │ │ │   ├─┬ rimraf@2.5.3 
│ │ │ │   │ └─┬ glob@7.0.5 
│ │ │ │   │   ├── fs.realpath@1.0.0 
│ │ │ │   │   ├── inflight@1.0.5 
│ │ │ │   │   ├─┬ minimatch@3.0.2 
│ │ │ │   │   │ └─┬ brace-expansion@1.1.5 
│ │ │ │   │   │   ├── balanced-match@0.4.2 
│ │ │ │   │   │   └── concat-map@0.0.1 
│ │ │ │   │   └── path-is-absolute@1.0.0 
│ │ │ │   ├── semver@5.2.0 
│ │ │ │   ├─┬ tar@2.2.1 
│ │ │ │   │ ├── block-stream@0.0.9 
│ │ │ │   │ ├─┬ fstream@1.0.10 
│ │ │ │   │ │ └── graceful-fs@4.1.4 
│ │ │ │   │ └── inherits@2.0.1 
│ │ │ │   └─┬ tar-pack@3.1.4 
│ │ │ │     ├─┬ debug@2.2.0 
│ │ │ │     │ └── ms@0.7.1 
│ │ │ │     ├── fstream-ignore@1.0.5 
│ │ │ │     ├─┬ once@1.3.3 
│ │ │ │     │ └── wrappy@1.0.2 
│ │ │ │     ├─┬ readable-stream@2.1.4 
│ │ │ │     │ ├── buffer-shims@1.0.0 
│ │ │ │     │ ├── core-util-is@1.0.2 
│ │ │ │     │ ├── isarray@1.0.0 
│ │ │ │     │ ├── process-nextick-args@1.0.7 
│ │ │ │     │ ├── string_decoder@0.10.31 
│ │ │ │     │ └── util-deprecate@1.0.2 
│ │ │ │     └── uid-number@0.0.6 
│ │ │ ├── glob-parent@2.0.0 
│ │ │ ├── inherits@2.0.3 
│ │ │ ├─┬ is-binary-path@1.0.1 
│ │ │ │ └── binary-extensions@1.7.0 
│ │ │ ├─┬ is-glob@2.0.1 
│ │ │ │ └── is-extglob@1.0.0 
│ │ │ ├── path-is-absolute@1.0.1 
│ │ │ └─┬ readdirp@2.1.0 
│ │ │   ├─┬ minimatch@3.0.3 
│ │ │   │ └─┬ brace-expansion@1.1.6 
│ │ │   │   ├── balanced-match@0.4.2 
│ │ │   │   └── concat-map@0.0.1 
│ │ │   ├─┬ readable-stream@2.2.1 
│ │ │   │ ├── buffer-shims@1.0.0 
│ │ │   │ ├── core-util-is@1.0.2 
│ │ │   │ ├── isarray@1.0.0 
│ │ │   │ ├── process-nextick-args@1.0.7 
│ │ │   │ ├── string_decoder@0.10.31 
│ │ │   │ └── util-deprecate@1.0.2 
│ │ │   └── set-immediate-shim@1.0.1 
│ │ └── graceful-fs@4.1.10 
│ ├─┬ hexo-log@0.1.2 
│ │ └─┬ bunyan@1.8.4 
│ │   ├── dtrace-provider@0.7.1 
│ │   ├── moment@2.16.0 
│ │   ├─┬ mv@2.1.1 
│ │   │ ├─┬ mkdirp@0.5.1 
│ │   │ │ └── minimist@0.0.8 
│ │   │ ├── ncp@2.0.0 
│ │   │ └─┬ rimraf@2.4.5 
│ │   │   └─┬ glob@6.0.4 
│ │   │     ├─┬ inflight@1.0.6 
│ │   │     │ └── wrappy@1.0.2 
│ │   │     └── once@1.4.0 
│ │   └── safe-json-stringify@1.0.3 
│ ├─┬ hexo-util@0.6.0 
│ │ ├─┬ camel-case@3.0.0 
│ │ │ ├─┬ no-case@2.3.0 
│ │ │ │ └── lower-case@1.1.3 
│ │ │ └── upper-case@1.1.3 
│ │ ├─┬ cross-spawn@4.0.2 
│ │ │ ├─┬ lru-cache@4.0.1 
│ │ │ │ ├── pseudomap@1.0.2 
│ │ │ │ └── yallist@2.0.0 
│ │ │ └─┬ which@1.2.12 
│ │ │   └── isexe@1.1.2 
│ │ ├── highlight.js@9.8.0 
│ │ ├── html-entities@1.2.0 
│ │ └── striptags@2.1.1 
│ ├── minimist@1.2.0 
│ ├── object-assign@4.1.0 
│ └─┬ tildify@1.2.0 
│   └── os-homedir@1.0.2 
├── install@0.8.2 
└── npm@3.10.9 

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "npm" "install" "-g" "hexo-cli"
npm ERR! node v7.1.0
npm ERR! npm  v3.10.9
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm'
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm'
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules/npm' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/NBR-hugh/npm-debug.log
  1. then, sudo npm install -g hexo-cli

the result:

/usr/local/bin/hexo -> /usr/local/lib/node_modules/hexo-cli/bin/hexo

> dtrace-provider@0.7.1 install /usr/local/lib/node_modules/hexo-cli/node_modules/dtrace-provider
> node scripts/install.js

it stop on node scripts/install.js,and i want to know if it is success, so input$ hexo init <folder> it return:

---------------
Building dtrace-provider failed with exit code 1 and signal 0
re-run install with environment variable V set to see the build output
---------------

> fsevents@1.0.15 install /usr/local/lib/node_modules/hexo-cli/node_modules/fsevents
> node-pre-gyp install --fallback-to-build

[fsevents] Success: "/usr/local/lib/node_modules/hexo-cli/node_modules/fsevents/lib/binding/Release/node-v51-darwin-x64/fse.node" is installed via remote

> hexo-util@0.6.0 postinstall /usr/local/lib/node_modules/hexo-cli/node_modules/hexo-util
> npm run build:highlight


> hexo-util@0.6.0 build:highlight /usr/local/lib/node_modules/hexo-cli/node_modules/hexo-util
> node scripts/build_highlight_alias.js > highlight_alias.json

/usr/local/lib
└─┬ hexo-cli@1.0.2 
  ├── abbrev@1.0.9 
  ├── bluebird@3.4.6 
  ├─┬ chalk@1.1.3 
  │ ├── ansi-styles@2.2.1 
  │ ├── escape-string-regexp@1.0.5 
  │ ├─┬ has-ansi@2.0.0 
  │ │ └── ansi-regex@2.0.0 
  │ ├── strip-ansi@3.0.1 
  │ └── supports-color@2.0.0 
  ├─┬ hexo-fs@0.1.6 
  │ ├─┬ chokidar@1.6.1 
  │ │ ├─┬ anymatch@1.3.0 
  │ │ │ ├── arrify@1.0.1 
  │ │ │ └─┬ micromatch@2.3.11 
  │ │ │   ├─┬ arr-diff@2.0.0 
  │ │ │   │ └── arr-flatten@1.0.1 
  │ │ │   ├── array-unique@0.2.1 
  │ │ │   ├─┬ braces@1.8.5 
  │ │ │   │ ├─┬ expand-range@1.8.2 
  │ │ │   │ │ └─┬ fill-range@2.2.3 
  │ │ │   │ │   ├── is-number@2.1.0 
  │ │ │   │ │   ├── isobject@2.1.0 
  │ │ │   │ │   ├── randomatic@1.1.5 
  │ │ │   │ │   └── repeat-string@1.6.1 
  │ │ │   │ ├── preserve@0.2.0 
  │ │ │   │ └── repeat-element@1.1.2 
  │ │ │   ├─┬ expand-brackets@0.1.5 
  │ │ │   │ └── is-posix-bracket@0.1.1 
  │ │ │   ├── extglob@0.3.2 
  │ │ │   ├── filename-regex@2.0.0 
  │ │ │   ├─┬ kind-of@3.0.4 
  │ │ │   │ └── is-buffer@1.1.4 
  │ │ │   ├── normalize-path@2.0.1 
  │ │ │   ├─┬ object.omit@2.0.1 
  │ │ │   │ ├─┬ for-own@0.1.4 
  │ │ │   │ │ └── for-in@0.1.6 
  │ │ │   │ └── is-extendable@0.1.1 
  │ │ │   ├─┬ parse-glob@3.0.4 
  │ │ │   │ ├── glob-base@0.3.0 
  │ │ │   │ └── is-dotfile@1.0.2 
  │ │ │   └─┬ regex-cache@0.4.3 
  │ │ │     ├── is-equal-shallow@0.1.3 
  │ │ │     └── is-primitive@2.0.0 
  │ │ ├── async-each@1.0.1 
  │ │ ├─┬ fsevents@1.0.15 
  │ │ │ ├── nan@2.4.0 
  │ │ │ └─┬ node-pre-gyp@0.6.29 
  │ │ │   ├─┬ mkdirp@0.5.1 
  │ │ │   │ └── minimist@0.0.8 
  │ │ │   ├─┬ nopt@3.0.6 
  │ │ │   │ └── abbrev@1.0.9 
  │ │ │   ├─┬ npmlog@3.1.2 
  │ │ │   │ ├─┬ are-we-there-yet@1.1.2 
  │ │ │   │ │ └── delegates@1.0.0 
  │ │ │   │ ├── console-control-strings@1.1.0 
  │ │ │   │ ├─┬ gauge@2.6.0 
  │ │ │   │ │ ├── aproba@1.0.4 
  │ │ │   │ │ ├── has-color@0.1.7 
  │ │ │   │ │ ├── has-unicode@2.0.1 
  │ │ │   │ │ ├── object-assign@4.1.0 
  │ │ │   │ │ ├── signal-exit@3.0.0 
  │ │ │   │ │ ├─┬ string-width@1.0.1 
  │ │ │   │ │ │ ├─┬ code-point-at@1.0.0 
  │ │ │   │ │ │ │ └── number-is-nan@1.0.0 
  │ │ │   │ │ │ └── is-fullwidth-code-point@1.0.0 
  │ │ │   │ │ ├─┬ strip-ansi@3.0.1 
  │ │ │   │ │ │ └── ansi-regex@2.0.0 
  │ │ │   │ │ └── wide-align@1.1.0 
  │ │ │   │ └── set-blocking@2.0.0 
  │ │ │   ├─┬ rc@1.1.6 
  │ │ │   │ ├── deep-extend@0.4.1 
  │ │ │   │ ├── ini@1.3.4 
  │ │ │   │ ├── minimist@1.2.0 
  │ │ │   │ └── strip-json-comments@1.0.4 
  │ │ │   ├─┬ request@2.73.0 
  │ │ │   │ ├── aws-sign2@0.6.0 
  │ │ │   │ ├── aws4@1.4.1 
  │ │ │   │ ├─┬ bl@1.1.2 
  │ │ │   │ │ └── readable-stream@2.0.6 
  │ │ │   │ ├── caseless@0.11.0 
  │ │ │   │ ├─┬ combined-stream@1.0.5 
  │ │ │   │ │ └── delayed-stream@1.0.0 
  │ │ │   │ ├── extend@3.0.0 
  │ │ │   │ ├── forever-agent@0.6.1 
  │ │ │   │ ├─┬ form-data@1.0.0-rc4 
  │ │ │   │ │ └── async@1.5.2 
  │ │ │   │ ├─┬ har-validator@2.0.6 
  │ │ │   │ │ ├─┬ chalk@1.1.3 
  │ │ │   │ │ │ ├── ansi-styles@2.2.1 
  │ │ │   │ │ │ ├── escape-string-regexp@1.0.5 
  │ │ │   │ │ │ ├── has-ansi@2.0.0 
  │ │ │   │ │ │ └── supports-color@2.0.0 
  │ │ │   │ │ ├─┬ commander@2.9.0 
  │ │ │   │ │ │ └── graceful-readlink@1.0.1 
  │ │ │   │ │ ├─┬ is-my-json-valid@2.13.1 
  │ │ │   │ │ │ ├── generate-function@2.0.0 
  │ │ │   │ │ │ ├─┬ generate-object-property@1.2.0 
  │ │ │   │ │ │ │ └── is-property@1.0.2 
  │ │ │   │ │ │ ├── jsonpointer@2.0.0 
  │ │ │   │ │ │ └── xtend@4.0.1 
  │ │ │   │ │ └─┬ pinkie-promise@2.0.1 
  │ │ │   │ │   └── pinkie@2.0.4 
  │ │ │   │ ├─┬ hawk@3.1.3 
  │ │ │   │ │ ├── boom@2.10.1 
  │ │ │   │ │ ├── cryptiles@2.0.5 
  │ │ │   │ │ ├── hoek@2.16.3 
  │ │ │   │ │ └── sntp@1.0.9 
  │ │ │   │ ├─┬ http-signature@1.1.1 
  │ │ │   │ │ ├── assert-plus@0.2.0 
  │ │ │   │ │ ├─┬ jsprim@1.3.0 
  │ │ │   │ │ │ ├── extsprintf@1.0.2 
  │ │ │   │ │ │ ├── json-schema@0.2.2 
  │ │ │   │ │ │ └── verror@1.3.6 
  │ │ │   │ │ └─┬ sshpk@1.8.3 
  │ │ │   │ │   ├── asn1@0.2.3 
  │ │ │   │ │   ├── assert-plus@1.0.0 
  │ │ │   │ │   ├─┬ dashdash@1.14.0 
  │ │ │   │ │   │ └── assert-plus@1.0.0 
  │ │ │   │ │   ├── ecc-jsbn@0.1.1 
  │ │ │   │ │   ├─┬ getpass@0.1.6 
  │ │ │   │ │   │ └── assert-plus@1.0.0 
  │ │ │   │ │   ├── jodid25519@1.0.2 
  │ │ │   │ │   ├── jsbn@0.1.0 
  │ │ │   │ │   └── tweetnacl@0.13.3 
  │ │ │   │ ├── is-typedarray@1.0.0 
  │ │ │   │ ├── isstream@0.1.2 
  │ │ │   │ ├── json-stringify-safe@5.0.1 
  │ │ │   │ ├─┬ mime-types@2.1.11 
  │ │ │   │ │ └── mime-db@1.23.0 
  │ │ │   │ ├── node-uuid@1.4.7 
  │ │ │   │ ├── oauth-sign@0.8.2 
  │ │ │   │ ├── qs@6.2.0 
  │ │ │   │ ├── stringstream@0.0.5 
  │ │ │   │ ├── tough-cookie@2.2.2 
  │ │ │   │ └── tunnel-agent@0.4.3 
  │ │ │   ├─┬ rimraf@2.5.3 
  │ │ │   │ └─┬ glob@7.0.5 
  │ │ │   │   ├── fs.realpath@1.0.0 
  │ │ │   │   ├── inflight@1.0.5 
  │ │ │   │   ├─┬ minimatch@3.0.2 
  │ │ │   │   │ └─┬ brace-expansion@1.1.5 
  │ │ │   │   │   ├── balanced-match@0.4.2 
  │ │ │   │   │   └── concat-map@0.0.1 
  │ │ │   │   └── path-is-absolute@1.0.0 
  │ │ │   ├── semver@5.2.0 
  │ │ │   ├─┬ tar@2.2.1 
  │ │ │   │ ├── block-stream@0.0.9 
  │ │ │   │ ├─┬ fstream@1.0.10 
  │ │ │   │ │ └── graceful-fs@4.1.4 
  │ │ │   │ └── inherits@2.0.1 
  │ │ │   └─┬ tar-pack@3.1.4 
  │ │ │     ├─┬ debug@2.2.0 
  │ │ │     │ └── ms@0.7.1 
  │ │ │     ├── fstream-ignore@1.0.5 
  │ │ │     ├─┬ once@1.3.3 
  │ │ │     │ └── wrappy@1.0.2 
  │ │ │     ├─┬ readable-stream@2.1.4 
  │ │ │     │ ├── buffer-shims@1.0.0 
  │ │ │     │ ├── core-util-is@1.0.2 
  │ │ │     │ ├── isarray@1.0.0 
  │ │ │     │ ├── process-nextick-args@1.0.7 
  │ │ │     │ ├── string_decoder@0.10.31 
  │ │ │     │ └── util-deprecate@1.0.2 
  │ │ │     └── uid-number@0.0.6 
  │ │ ├── glob-parent@2.0.0 
  │ │ ├── inherits@2.0.3 
  │ │ ├─┬ is-binary-path@1.0.1 
  │ │ │ └── binary-extensions@1.7.0 
  │ │ ├─┬ is-glob@2.0.1 
  │ │ │ └── is-extglob@1.0.0 
  │ │ ├── path-is-absolute@1.0.1 
  │ │ └─┬ readdirp@2.1.0 
  │ │   ├─┬ minimatch@3.0.3 
  │ │   │ └─┬ brace-expansion@1.1.6 
  │ │   │   ├── balanced-match@0.4.2 
  │ │   │   └── concat-map@0.0.1 
  │ │   ├─┬ readable-stream@2.2.1 
  │ │   │ ├── buffer-shims@1.0.0 
  │ │   │ ├── core-util-is@1.0.2 
  │ │   │ ├── isarray@1.0.0 
  │ │   │ ├── process-nextick-args@1.0.7 
  │ │   │ ├── string_decoder@0.10.31 
  │ │   │ └── util-deprecate@1.0.2 
  │ │   └── set-immediate-shim@1.0.1 
  │ └── graceful-fs@4.1.10 
  ├─┬ hexo-log@0.1.2 
  │ └─┬ bunyan@1.8.4 
  │   ├── dtrace-provider@0.7.1 
  │   ├── moment@2.16.0 
  │   ├─┬ mv@2.1.1 
  │   │ ├─┬ mkdirp@0.5.1 
  │   │ │ └── minimist@0.0.8 
  │   │ ├── ncp@2.0.0 
  │   │ └─┬ rimraf@2.4.5 
  │   │   └─┬ glob@6.0.4 
  │   │     ├─┬ inflight@1.0.6 
  │   │     │ └── wrappy@1.0.2 
  │   │     └── once@1.4.0 
  │   └── safe-json-stringify@1.0.3 
  ├─┬ hexo-util@0.6.0 
  │ ├─┬ camel-case@3.0.0 
  │ │ ├─┬ no-case@2.3.0 
  │ │ │ └── lower-case@1.1.3 
  │ │ └── upper-case@1.1.3 
  │ ├─┬ cross-spawn@4.0.2 
  │ │ ├─┬ lru-cache@4.0.1 
  │ │ │ ├── pseudomap@1.0.2 
  │ │ │ └── yallist@2.0.0 
  │ │ └─┬ which@1.2.12 
  │ │   └── isexe@1.1.2 
  │ ├── highlight.js@9.8.0 
  │ ├── html-entities@1.2.0 
  │ └── striptags@2.1.1 
  ├── minimist@1.2.0 
  ├── object-assign@4.1.0 
  └─┬ tildify@1.2.0 
    └── os-homedir@1.0.2 


and then i test:

nibirongdeMacBook-Pro:~ NBR-hugh$ $ hexo init <folder>
-bash: syntax error near unexpected token `newline'
nibirongdeMacBook-Pro:~ NBR-hugh$ sudo npm install --unsafe-perm hexo-cli -g
Password:
/usr/local/bin/hexo -> /usr/local/lib/node_modules/hexo-cli/bin/hexo
/usr/local/lib
└── hexo-cli@1.0.2 

nibirongdeMacBook-Pro:~ NBR-hugh$ hexo init <folder>
-bash: syntax error near unexpected token `newline'
  1. $ sudo npm install -g hexo-cliagain
nibirongdeMacBook-Pro:~ NBR-hugh$ sudo npm install -g hexo-cli
Password:
/usr/local/bin/hexo -> /usr/local/lib/node_modules/hexo-cli/bin/hexo

> dtrace-provider@0.7.1 install /usr/local/lib/node_modules/hexo-cli/node_modules/dtrace-provider
> node scripts/install.js


> fsevents@1.0.15 install /usr/local/lib/node_modules/hexo-cli/node_modules/fsevents
> node-pre-gyp install --fallback-to-build

[fsevents] Success: "/usr/local/lib/node_modules/hexo-cli/node_modules/fsevents/lib/binding/Release/node-v51-darwin-x64/fse.node" is installed via remote

> hexo-util@0.6.0 postinstall /usr/local/lib/node_modules/hexo-cli/node_modules/hexo-util
> npm run build:highlight


> hexo-util@0.6.0 build:highlight /usr/local/lib/node_modules/hexo-cli/node_modules/hexo-util
> node scripts/build_highlight_alias.js > highlight_alias.json

/usr/local/lib
└─┬ hexo-cli@1.0.2 
  ├── abbrev@1.0.9 
  ├── bluebird@3.4.6 
  ├─┬ chalk@1.1.3 
  │ ├── ansi-styles@2.2.1 
  │ ├── escape-string-regexp@1.0.5 
  │ ├─┬ has-ansi@2.0.0 
  │ │ └── ansi-regex@2.0.0 
  │ ├── strip-ansi@3.0.1 
  │ └── supports-color@2.0.0 
  ├─┬ hexo-fs@0.1.6 
  │ ├─┬ chokidar@1.6.1 
  │ │ ├─┬ anymatch@1.3.0 
  │ │ │ ├── arrify@1.0.1 
  │ │ │ └─┬ micromatch@2.3.11 
  │ │ │   ├─┬ arr-diff@2.0.0 
  │ │ │   │ └── arr-flatten@1.0.1 
  │ │ │   ├── array-unique@0.2.1 
  │ │ │   ├─┬ braces@1.8.5 
  │ │ │   │ ├─┬ expand-range@1.8.2 
  │ │ │   │ │ └─┬ fill-range@2.2.3 
  │ │ │   │ │   ├── is-number@2.1.0 
  │ │ │   │ │   ├── isobject@2.1.0 
  │ │ │   │ │   ├── randomatic@1.1.5 
  │ │ │   │ │   └── repeat-string@1.6.1 
  │ │ │   │ ├── preserve@0.2.0 
  │ │ │   │ └── repeat-element@1.1.2 
  │ │ │   ├─┬ expand-brackets@0.1.5 
  │ │ │   │ └── is-posix-bracket@0.1.1 
  │ │ │   ├── extglob@0.3.2 
  │ │ │   ├── filename-regex@2.0.0 
  │ │ │   ├─┬ kind-of@3.0.4 
  │ │ │   │ └── is-buffer@1.1.4 
  │ │ │   ├── normalize-path@2.0.1 
  │ │ │   ├─┬ object.omit@2.0.1 
  │ │ │   │ ├─┬ for-own@0.1.4 
  │ │ │   │ │ └── for-in@0.1.6 
  │ │ │   │ └── is-extendable@0.1.1 
  │ │ │   ├─┬ parse-glob@3.0.4 
  │ │ │   │ ├── glob-base@0.3.0 
  │ │ │   │ └── is-dotfile@1.0.2 
  │ │ │   └─┬ regex-cache@0.4.3 
  │ │ │     ├── is-equal-shallow@0.1.3 
  │ │ │     └── is-primitive@2.0.0 
  │ │ ├── async-each@1.0.1 
  │ │ ├─┬ fsevents@1.0.15 
  │ │ │ ├── nan@2.4.0 
  │ │ │ └─┬ node-pre-gyp@0.6.29 
  │ │ │   ├─┬ mkdirp@0.5.1 
  │ │ │   │ └── minimist@0.0.8 
  │ │ │   ├─┬ nopt@3.0.6 
  │ │ │   │ └── abbrev@1.0.9 
  │ │ │   ├─┬ npmlog@3.1.2 
  │ │ │   │ ├─┬ are-we-there-yet@1.1.2 
  │ │ │   │ │ └── delegates@1.0.0 
  │ │ │   │ ├── console-control-strings@1.1.0 
  │ │ │   │ ├─┬ gauge@2.6.0 
  │ │ │   │ │ ├── aproba@1.0.4 
  │ │ │   │ │ ├── has-color@0.1.7 
  │ │ │   │ │ ├── has-unicode@2.0.1 
  │ │ │   │ │ ├── object-assign@4.1.0 
  │ │ │   │ │ ├── signal-exit@3.0.0 
  │ │ │   │ │ ├─┬ string-width@1.0.1 
  │ │ │   │ │ │ ├─┬ code-point-at@1.0.0 
  │ │ │   │ │ │ │ └── number-is-nan@1.0.0 
  │ │ │   │ │ │ └── is-fullwidth-code-point@1.0.0 
  │ │ │   │ │ ├─┬ strip-ansi@3.0.1 
  │ │ │   │ │ │ └── ansi-regex@2.0.0 
  │ │ │   │ │ └── wide-align@1.1.0 
  │ │ │   │ └── set-blocking@2.0.0 
  │ │ │   ├─┬ rc@1.1.6 
  │ │ │   │ ├── deep-extend@0.4.1 
  │ │ │   │ ├── ini@1.3.4 
  │ │ │   │ ├── minimist@1.2.0 
  │ │ │   │ └── strip-json-comments@1.0.4 
  │ │ │   ├─┬ request@2.73.0 
  │ │ │   │ ├── aws-sign2@0.6.0 
  │ │ │   │ ├── aws4@1.4.1 
  │ │ │   │ ├─┬ bl@1.1.2 
  │ │ │   │ │ └── readable-stream@2.0.6 
  │ │ │   │ ├── caseless@0.11.0 
  │ │ │   │ ├─┬ combined-stream@1.0.5 
  │ │ │   │ │ └── delayed-stream@1.0.0 
  │ │ │   │ ├── extend@3.0.0 
  │ │ │   │ ├── forever-agent@0.6.1 
  │ │ │   │ ├─┬ form-data@1.0.0-rc4 
  │ │ │   │ │ └── async@1.5.2 
  │ │ │   │ ├─┬ har-validator@2.0.6 
  │ │ │   │ │ ├─┬ chalk@1.1.3 
  │ │ │   │ │ │ ├── ansi-styles@2.2.1 
  │ │ │   │ │ │ ├── escape-string-regexp@1.0.5 
  │ │ │   │ │ │ ├── has-ansi@2.0.0 
  │ │ │   │ │ │ └── supports-color@2.0.0 
  │ │ │   │ │ ├─┬ commander@2.9.0 
  │ │ │   │ │ │ └── graceful-readlink@1.0.1 
  │ │ │   │ │ ├─┬ is-my-json-valid@2.13.1 
  │ │ │   │ │ │ ├── generate-function@2.0.0 
  │ │ │   │ │ │ ├─┬ generate-object-property@1.2.0 
  │ │ │   │ │ │ │ └── is-property@1.0.2 
  │ │ │   │ │ │ ├── jsonpointer@2.0.0 
  │ │ │   │ │ │ └── xtend@4.0.1 
  │ │ │   │ │ └─┬ pinkie-promise@2.0.1 
  │ │ │   │ │   └── pinkie@2.0.4 
  │ │ │   │ ├─┬ hawk@3.1.3 
  │ │ │   │ │ ├── boom@2.10.1 
  │ │ │   │ │ ├── cryptiles@2.0.5 
  │ │ │   │ │ ├── hoek@2.16.3 
  │ │ │   │ │ └── sntp@1.0.9 
  │ │ │   │ ├─┬ http-signature@1.1.1 
  │ │ │   │ │ ├── assert-plus@0.2.0 
  │ │ │   │ │ ├─┬ jsprim@1.3.0 
  │ │ │   │ │ │ ├── extsprintf@1.0.2 
  │ │ │   │ │ │ ├── json-schema@0.2.2 
  │ │ │   │ │ │ └── verror@1.3.6 
  │ │ │   │ │ └─┬ sshpk@1.8.3 
  │ │ │   │ │   ├── asn1@0.2.3 
  │ │ │   │ │   ├── assert-plus@1.0.0 
  │ │ │   │ │   ├─┬ dashdash@1.14.0 
  │ │ │   │ │   │ └── assert-plus@1.0.0 
  │ │ │   │ │   ├── ecc-jsbn@0.1.1 
  │ │ │   │ │   ├─┬ getpass@0.1.6 
  │ │ │   │ │   │ └── assert-plus@1.0.0 
  │ │ │   │ │   ├── jodid25519@1.0.2 
  │ │ │   │ │   ├── jsbn@0.1.0 
  │ │ │   │ │   └── tweetnacl@0.13.3 
  │ │ │   │ ├── is-typedarray@1.0.0 
  │ │ │   │ ├── isstream@0.1.2 
  │ │ │   │ ├── json-stringify-safe@5.0.1 
  │ │ │   │ ├─┬ mime-types@2.1.11 
  │ │ │   │ │ └── mime-db@1.23.0 
  │ │ │   │ ├── node-uuid@1.4.7 
  │ │ │   │ ├── oauth-sign@0.8.2 
  │ │ │   │ ├── qs@6.2.0 
  │ │ │   │ ├── stringstream@0.0.5 
  │ │ │   │ ├── tough-cookie@2.2.2 
  │ │ │   │ └── tunnel-agent@0.4.3 
  │ │ │   ├─┬ rimraf@2.5.3 
  │ │ │   │ └─┬ glob@7.0.5 
  │ │ │   │   ├── fs.realpath@1.0.0 
  │ │ │   │   ├── inflight@1.0.5 
  │ │ │   │   ├─┬ minimatch@3.0.2 
  │ │ │   │   │ └─┬ brace-expansion@1.1.5 
  │ │ │   │   │   ├── balanced-match@0.4.2 
  │ │ │   │   │   └── concat-map@0.0.1 
  │ │ │   │   └── path-is-absolute@1.0.0 
  │ │ │   ├── semver@5.2.0 
  │ │ │   ├─┬ tar@2.2.1 
  │ │ │   │ ├── block-stream@0.0.9 
  │ │ │   │ ├─┬ fstream@1.0.10 
  │ │ │   │ │ └── graceful-fs@4.1.4 
  │ │ │   │ └── inherits@2.0.1 
  │ │ │   └─┬ tar-pack@3.1.4 
  │ │ │     ├─┬ debug@2.2.0 
  │ │ │     │ └── ms@0.7.1 
  │ │ │     ├── fstream-ignore@1.0.5 
  │ │ │     ├─┬ once@1.3.3 
  │ │ │     │ └── wrappy@1.0.2 
  │ │ │     ├─┬ readable-stream@2.1.4 
  │ │ │     │ ├── buffer-shims@1.0.0 
  │ │ │     │ ├── core-util-is@1.0.2 
  │ │ │     │ ├── isarray@1.0.0 
  │ │ │     │ ├── process-nextick-args@1.0.7 
  │ │ │     │ ├── string_decoder@0.10.31 
  │ │ │     │ └── util-deprecate@1.0.2 
  │ │ │     └── uid-number@0.0.6 
  │ │ ├── glob-parent@2.0.0 
  │ │ ├── inherits@2.0.3 
  │ │ ├─┬ is-binary-path@1.0.1 
  │ │ │ └── binary-extensions@1.7.0 
  │ │ ├─┬ is-glob@2.0.1 
  │ │ │ └── is-extglob@1.0.0 
  │ │ ├── path-is-absolute@1.0.1 
  │ │ └─┬ readdirp@2.1.0 
  │ │   ├─┬ minimatch@3.0.3 
  │ │   │ └─┬ brace-expansion@1.1.6 
  │ │   │   ├── balanced-match@0.4.2 
  │ │   │   └── concat-map@0.0.1 
  │ │   ├─┬ readable-stream@2.2.1 
  │ │   │ ├── buffer-shims@1.0.0 
  │ │   │ ├── core-util-is@1.0.2 
  │ │   │ ├── isarray@1.0.0 
  │ │   │ ├── process-nextick-args@1.0.7 
  │ │   │ ├── string_decoder@0.10.31 
  │ │   │ └── util-deprecate@1.0.2 
  │ │   └── set-immediate-shim@1.0.1 
  │ └── graceful-fs@4.1.10 
  ├─┬ hexo-log@0.1.2 
  │ └─┬ bunyan@1.8.4 
  │   ├── dtrace-provider@0.7.1 
  │   ├── moment@2.16.0 
  │   ├─┬ mv@2.1.1 
  │   │ ├─┬ mkdirp@0.5.1 
  │   │ │ └── minimist@0.0.8 
  │   │ ├── ncp@2.0.0 
  │   │ └─┬ rimraf@2.4.5 
  │   │   └─┬ glob@6.0.4 
  │   │     ├─┬ inflight@1.0.6 
  │   │     │ └── wrappy@1.0.2 
  │   │     └── once@1.4.0 
  │   └── safe-json-stringify@1.0.3 
  ├─┬ hexo-util@0.6.0 
  │ ├─┬ camel-case@3.0.0 
  │ │ ├─┬ no-case@2.3.0 
  │ │ │ └── lower-case@1.1.3 
  │ │ └── upper-case@1.1.3 
  │ ├─┬ cross-spawn@4.0.2 
  │ │ ├─┬ lru-cache@4.0.1 
  │ │ │ ├── pseudomap@1.0.2 
  │ │ │ └── yallist@2.0.0 
  │ │ └─┬ which@1.2.12 
  │ │   └── isexe@1.1.2 
  │ ├── highlight.js@9.8.0 
  │ ├── html-entities@1.2.0 
  │ └── striptags@2.1.1 
  ├── minimist@1.2.0 
  ├── object-assign@4.1.0 
  └─┬ tildify@1.2.0 
    └── os-homedir@1.0.2 

nibirongdeMacBook-Pro:~ NBR-hugh$ hexo init <folder>
-bash: syntax error near unexpected token `newline'
nibirongdeMacBook-Pro:~ NBR-hugh$ npm uninstall hexo-cli
npm WARN enoent ENOENT: no such file or directory, open '/Users/NBR-hugh/package.json'
npm WARN NBR-hugh No description
npm WARN NBR-hugh No repository field.
npm WARN NBR-hugh No README data
npm WARN NBR-hugh No license field.
nibirongdeMacBook-Pro:~ NBR-hugh$ npm uninstall hexo-cli
npm WARN enoent ENOENT: no such file or directory, open '/Users/NBR-hugh/package.json'
npm WARN NBR-hugh No description
npm WARN NBR-hugh No repository field.
npm WARN NBR-hugh No README data
npm WARN NBR-hugh No license field.
nibirongdeMacBook-Pro:~ NBR-hugh$ sudo npm install -g hexo-cli
Password:
/usr/local/bin/hexo -> /usr/local/lib/node_modules/hexo-cli/bin/hexo
/usr/local/lib
└── hexo-cli@1.0.2 

nibirongdeMacBook-Pro:~ NBR-hugh$ hexo init <folder>
-bash: syntax error near unexpected token `newline'
nibirongdeMacBook-Pro:~ NBR-hugh$ npm uninstall hexo-cli
npm WARN enoent ENOENT: no such file or directory, open '/Users/NBR-hugh/package.json'
npm WARN NBR-hugh No description
npm WARN NBR-hugh No repository field.
npm WARN NBR-hugh No README data
npm WARN NBR-hugh No license field

4.try this: $ npm install hexo --no-optional

the result:

npm WARN deprecated swig@1.4.2: This package is no longer maintained

> hexo-util@0.6.0 postinstall /Users/NBR-hugh/node_modules/hexo-util
> npm run build:highlight


> hexo-util@0.6.0 build:highlight /Users/NBR-hugh/node_modules/hexo-util
> node scripts/build_highlight_alias.js > highlight_alias.json

/Users/NBR-hugh
└─┬ hexo@3.2.2 
  ├── abbrev@1.0.9 
  ├── archy@1.0.0 
  ├── bluebird@3.4.6 
  ├─┬ chalk@1.1.3 
  │ ├── ansi-styles@2.2.1 
  │ ├── escape-string-regexp@1.0.5 
  │ ├─┬ has-ansi@2.0.0 
  │ │ └── ansi-regex@2.0.0 
  │ ├── strip-ansi@3.0.1 
  │ └── supports-color@2.0.0 
  ├─┬ cheerio@0.20.0 
  │ ├─┬ css-select@1.2.0 
  │ │ ├── boolbase@1.0.0 
  │ │ ├── css-what@2.1.0 
  │ │ ├── domutils@1.5.1 
  │ │ └── nth-check@1.0.1 
  │ ├─┬ dom-serializer@0.1.0 
  │ │ └── domelementtype@1.1.3 
  │ ├── entities@1.1.1 
  │ └─┬ htmlparser2@3.8.3 
  │   ├── domelementtype@1.3.0 
  │   ├── domhandler@2.3.0 
  │   ├── entities@1.0.0 
  │   └─┬ readable-stream@1.1.14 
  │     ├── core-util-is@1.0.2 
  │     ├── isarray@0.0.1 
  │     └── string_decoder@0.10.31 
  ├─┬ hexo-cli@1.0.2 
  │ ├── minimist@1.2.0 
  │ └── object-assign@4.1.0 
  ├── hexo-front-matter@0.2.3 
  ├─┬ hexo-fs@0.1.6 
  │ ├─┬ chokidar@1.6.1 
  │ │ ├─┬ anymatch@1.3.0 
  │ │ │ ├── arrify@1.0.1 
  │ │ │ └─┬ micromatch@2.3.11 
  │ │ │   ├─┬ arr-diff@2.0.0 
  │ │ │   │ └── arr-flatten@1.0.1 
  │ │ │   ├── array-unique@0.2.1 
  │ │ │   ├─┬ braces@1.8.5 
  │ │ │   │ ├─┬ expand-range@1.8.2 
  │ │ │   │ │ └─┬ fill-range@2.2.3 
  │ │ │   │ │   ├── is-number@2.1.0 
  │ │ │   │ │   ├─┬ isobject@2.1.0 
  │ │ │   │ │   │ └── isarray@1.0.0 
  │ │ │   │ │   ├── randomatic@1.1.5 
  │ │ │   │ │   └── repeat-string@1.6.1 
  │ │ │   │ ├── preserve@0.2.0 
  │ │ │   │ └── repeat-element@1.1.2 
  │ │ │   ├─┬ expand-brackets@0.1.5 
  │ │ │   │ └── is-posix-bracket@0.1.1 
  │ │ │   ├── extglob@0.3.2 
  │ │ │   ├── filename-regex@2.0.0 
  │ │ │   ├─┬ kind-of@3.0.4 
  │ │ │   │ └── is-buffer@1.1.4 
  │ │ │   ├── normalize-path@2.0.1 
  │ │ │   ├─┬ object.omit@2.0.1 
  │ │ │   │ ├─┬ for-own@0.1.4 
  │ │ │   │ │ └── for-in@0.1.6 
  │ │ │   │ └── is-extendable@0.1.1 
  │ │ │   ├─┬ parse-glob@3.0.4 
  │ │ │   │ ├── glob-base@0.3.0 
  │ │ │   │ └── is-dotfile@1.0.2 
  │ │ │   └─┬ regex-cache@0.4.3 
  │ │ │     ├── is-equal-shallow@0.1.3 
  │ │ │     └── is-primitive@2.0.0 
  │ │ ├── async-each@1.0.1 
  │ │ ├── glob-parent@2.0.0 
  │ │ ├── inherits@2.0.3 
  │ │ ├─┬ is-binary-path@1.0.1 
  │ │ │ └── binary-extensions@1.7.0 
  │ │ ├─┬ is-glob@2.0.1 
  │ │ │ └── is-extglob@1.0.0 
  │ │ ├── path-is-absolute@1.0.1 
  │ │ └─┬ readdirp@2.1.0 
  │ │   ├─┬ readable-stream@2.2.1 
  │ │   │ ├── buffer-shims@1.0.0 
  │ │   │ ├── isarray@1.0.0 
  │ │   │ ├── process-nextick-args@1.0.7 
  │ │   │ └── util-deprecate@1.0.2 
  │ │   └── set-immediate-shim@1.0.1 
  │ └── graceful-fs@4.1.10 
  ├─┬ hexo-i18n@0.2.1 
  │ └── sprintf-js@1.0.3 
  ├─┬ hexo-log@0.1.2 
  │ └── bunyan@1.8.4 
  ├─┬ hexo-util@0.6.0 
  │ ├─┬ camel-case@3.0.0 
  │ │ ├─┬ no-case@2.3.0 
  │ │ │ └── lower-case@1.1.3 
  │ │ └── upper-case@1.1.3 
  │ ├─┬ cross-spawn@4.0.2 
  │ │ ├─┬ lru-cache@4.0.1 
  │ │ │ ├── pseudomap@1.0.2 
  │ │ │ └── yallist@2.0.0 
  │ │ └─┬ which@1.2.12 
  │ │   └── isexe@1.1.2 
  │ ├── highlight.js@9.8.0 
  │ ├── html-entities@1.2.0 
  │ └── striptags@2.1.1 
  ├─┬ js-yaml@3.7.0 
  │ ├── argparse@1.0.9 
  │ └── esprima@2.7.3 
  ├── lodash@4.16.6 
  ├─┬ minimatch@3.0.3 
  │ └─┬ brace-expansion@1.1.6 
  │   ├── balanced-match@0.4.2 
  │   └── concat-map@0.0.1 
  ├── moment@2.13.0 
  ├── moment-timezone@0.5.9 
  ├─┬ nunjucks@2.5.2 
  │ ├── asap@2.0.5 
  │ └─┬ yargs@3.32.0 
  │   ├── camelcase@2.1.1 
  │   ├─┬ cliui@3.2.0 
  │   │ └── wrap-ansi@2.0.0 
  │   ├── decamelize@1.2.0 
  │   ├─┬ os-locale@1.4.0 
  │   │ └─┬ lcid@1.0.0 
  │   │   └── invert-kv@1.0.0 
  │   ├─┬ string-width@1.0.2 
  │   │ ├── code-point-at@1.1.0 
  │   │ └─┬ is-fullwidth-code-point@1.0.0 
  │   │   └── number-is-nan@1.0.1 
  │   ├── window-size@0.1.4 
  │   └── y18n@3.2.1 
  ├── pretty-hrtime@1.0.3 
  ├─┬ strip-indent@1.0.1 
  │ └── get-stdin@4.0.1 
  ├─┬ swig@1.4.2 
  │ ├─┬ optimist@0.6.1 
  │ │ ├── minimist@0.0.10 
  │ │ └── wordwrap@0.0.3 
  │ └─┬ uglify-js@2.4.24 
  │   ├── async@0.2.10 
  │   ├─┬ source-map@0.1.34 
  │   │ └── amdefine@1.0.1 
  │   ├── uglify-to-browserify@1.0.2 
  │   └─┬ yargs@3.5.4 
  │     ├── camelcase@1.2.1 
  │     ├── window-size@0.1.0 
  │     └── wordwrap@0.0.2 
  ├─┬ swig-extras@0.0.1 
  │ └─┬ markdown@0.5.0 
  │   └── nopt@2.1.2 
  ├── text-table@0.2.0 
  ├─┬ tildify@1.2.0 
  │ └── os-homedir@1.0.2 
  ├── titlecase@1.1.2 
  └─┬ warehouse@2.2.0 
    ├─┬ cuid@1.3.8 
    │ ├── browser-fingerprint@0.0.1 
    │ ├── core-js@1.2.7 
    │ └── node-fingerprint@0.0.2 
    ├─┬ is-plain-object@2.0.1 
    │ └── isobject@1.0.2 
    └─┬ JSONStream@1.2.1 
      ├── jsonparse@1.2.0 
      └── through@2.3.8 

npm WARN enoent ENOENT: no such file or directory, open '/Users/NBR-hugh/package.json'
npm WARN NBR-hugh No description
npm WARN NBR-hugh No repository field.
npm WARN NBR-hugh No README data
npm WARN NBR-hugh No license field.
nibirongdeMacBook-Pro:~ NBR-hugh$ 
nibirongdeMacBook-Pro:~ NBR-hugh$ config.yml
-bash: config.yml: command not found

it’s also failded.help please!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (6 by maintainers)

Most upvoted comments

Hey - so I got this fixed. What I finally did was uninstalled Node.js using tonymtz’s script, with one modification which you can find in my fork at https://gist.github.com/bartread/5d8c09310156b3a37c968b2f6d3a1e79.

I then installed Node Version Manager (nvm): https://github.com/creationix/nvm, and installed node using:

nvm install node

I was then able to successfully install hexo with:

npm install -g hexo

Note that once you’re using nvm, not only can you work with multiple versions of node (which is handy), but you no longer need to sudo to install npm packages globally.

All is well, and I am very happy. Thanks for all the assistance.

Usually Hexo installation does not need sudo permission. Did you installed npm with sudo?

https://hexo.io/docs/index.html#Requirements Could you please also check:

You may encounter some problems when compiling. Please install Xcode from App Store first. After Xcode is installed, open Xcode and go to Preferences -> Download -> Command Line Tools -> Install to install command line tools.