{"action":"created","issue":{"url":"https://api.github.com/repos/hexojs/hexo/issues/1796","repository_url":"https://api.github.com/repos/hexojs/hexo","labels_url":"https://api.github.com/repos/hexojs/hexo/issues/1796/labels{/name}","comments_url":"https://api.github.com/repos/hexojs/hexo/issues/1796/comments","events_url":"https://api.github.com/repos/hexojs/hexo/issues/1796/events","html_url":"https://github.com/hexojs/hexo/issues/1796","id":137616661,"number":1796,"title":"hexo 部分参数提示未注册","user":{"login":"Arondight","id":13673702,"avatar_url":"https://avatars.githubusercontent.com/u/13673702?v=3","gravatar_id":"","url":"https://api.github.com/users/Arondight","html_url":"https://github.com/Arondight","followers_url":"https://api.github.com/users/Arondight/followers","following_url":"https://api.github.com/users/Arondight/following{/other_user}","gists_url":"https://api.github.com/users/Arondight/gists{/gist_id}","starred_url":"https://api.github.com/users/Arondight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arondight/subscriptions","organizations_url":"https://api.github.com/users/Arondight/orgs","repos_url":"https://api.github.com/users/Arondight/repos","events_url":"https://api.github.com/users/Arondight/events{/privacy}","received_events_url":"https://api.github.com/users/Arondight/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-01T16:12:49Z","updated_at":"2016-03-01T17:26:21Z","closed_at":null,"body":"一个示例输出如下：\r\n\r\n```bash\r\n$ hexo help\r\nFATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html\r\nError: Console `help` has not been registered yet!\r\n    at /home/ispeller/Repo/arondight.github.io/node_modules/hexo/lib/hexo/index.js:194:14\r\n    at Promise._execute (/home/ispeller/Repo/arondight.github.io/node_modules/hexo/node_modules/bluebird/js/release/debuggability.js:272:9)\r\n    at Promise._resolveFromExecutor (/home/ispeller/Repo/arondight.github.io/node_modules/hexo/node_modules/bluebird/js/release/promise.js:474:18)\r\n    at new Promise (/home/ispeller/Repo/arondight.github.io/node_modules/hexo/node_modules/bluebird/js/release/promise.js:77:14)\r\n    at Hexo.call (/home/ispeller/Repo/arondight.github.io/node_modules/hexo/lib/hexo/index.js:188:10)\r\n    at runHexoCommand (/usr/lib/node_modules/hexo/node_modules/hexo-cli/lib/index.js:58:17)\r\n    at tryCatcher (/home/ispeller/Repo/arondight.github.io/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)\r\n    at Promise._settlePromiseFromHandler (/home/ispeller/Repo/arondight.github.io/node_modules/hexo/node_modules/bluebird/js/release/promise.js:503:31)\r\n    at Promise._settlePromise (/home/ispeller/Repo/arondight.github.io/node_modules/hexo/node_modules/bluebird/js/release/promise.js:560:18)\r\n    at Promise._settlePromise0 (/home/ispeller/Repo/arondight.github.io/node_modules/hexo/node_modules/bluebird/js/release/promise.js:605:10)\r\n    at Promise._settlePromises (/home/ispeller/Repo/arondight.github.io/node_modules/hexo/node_modules/bluebird/js/release/promise.js:684:18)\r\n    at Async._drainQueue (/home/ispeller/Repo/arondight.github.io/node_modules/hexo/node_modules/bluebird/js/release/async.js:126:16)\r\n    at Async._drainQueues (/home/ispeller/Repo/arondight.github.io/node_modules/hexo/node_modules/bluebird/js/release/async.js:136:10)\r\n    at Immediate.Async.drainQueues [as _onImmediate] (/home/ispeller/Repo/arondight.github.io/node_modules/hexo/node_modules/bluebird/js/release/async.js:16:14)\r\n    at processImmediate [as _immediateCallback] (timers.js:383:17)\r\n```\r\n\r\n`packages.json` 如下：\r\n\r\n```json\r\n{\r\n  \"name\": \"hexo-site\",\r\n  \"version\": \"0.0.0\",\r\n  \"private\": true,\r\n  \"hexo\": {\r\n    \"version\": \"3.2.0\"\r\n  },\r\n  \"dependencies\": {\r\n    \"hexo\": \"^3.2.0\",\r\n    \"hexo-cli\": \"^1.0.1\",\r\n    \"hexo-deployer-git\": \"0.0.4\",\r\n    \"hexo-generator-archive\": \"^0.1.2\",\r\n    \"hexo-generator-baidu-sitemap\": \"^0.1.2\",\r\n    \"hexo-generator-category\": \"^0.1.2\",\r\n    \"hexo-generator-feed\": \"^1.0.3\",\r\n    \"hexo-generator-index\": \"^0.1.3\",\r\n    \"hexo-generator-sitemap\": \"^1.1.2\",\r\n    \"hexo-generator-tag\": \"^0.1.1\",\r\n    \"hexo-renderer-ejs\": \"^0.1.1\",\r\n    \"hexo-renderer-marked\": \"^0.2.10\",\r\n    \"hexo-renderer-stylus\": \"^0.3.1\",\r\n    \"hexo-server\": \"^0.1.2\"\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/hexojs/hexo/issues/comments/190823126","html_url":"https://github.com/hexojs/hexo/issues/1796#issuecomment-190823126","issue_url":"https://api.github.com/repos/hexojs/hexo/issues/1796","id":190823126,"user":{"login":"samwhelp","id":377802,"avatar_url":"https://avatars.githubusercontent.com/u/377802?v=3","gravatar_id":"","url":"https://api.github.com/users/samwhelp","html_url":"https://github.com/samwhelp","followers_url":"https://api.github.com/users/samwhelp/followers","following_url":"https://api.github.com/users/samwhelp/following{/other_user}","gists_url":"https://api.github.com/users/samwhelp/gists{/gist_id}","starred_url":"https://api.github.com/users/samwhelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samwhelp/subscriptions","organizations_url":"https://api.github.com/users/samwhelp/orgs","repos_url":"https://api.github.com/users/samwhelp/repos","events_url":"https://api.github.com/users/samwhelp/events{/privacy}","received_events_url":"https://api.github.com/users/samwhelp/received_events","type":"User","site_admin":false},"created_at":"2016-03-01T17:26:20Z","updated_at":"2016-03-01T17:26:20Z","body":"\r\n## 解決方式\r\n\r\n提供一個方向，來解決你提到的這個問題，我是這樣解決的\r\n\r\n先離開這個資料夾\r\n\r\n``` sh\r\n$ cd ../\r\n```\r\n\r\n再執行下面指令，觀察版本\r\n\r\n``` sh\r\n$ hexo -v\r\n```\r\n\r\n要正常使用「3.2.0」的話，要如下面顯示的\r\n``` \r\nhexo: 3.2.0\r\nhexo-cli: 1.0.1\r\n...略...\r\n```\r\n\r\n看您給的訊息，應該是要使用3.2.0，所以先確認「hexo-cli」的版本是「1.0.1」。\r\n\r\n「hexo-cli」若不是「1.0.1」，執行下面的指令更新\r\n\r\n\r\n``` sh\r\n$ npm install hexo-cli -g\r\n```\r\n\r\n另外「hexo-cli」應該是裝在「global」，\r\n\r\n所以你的「package.json」裡的「dependencies」應該不需要「`\"hexo-cli\": \"^1.0.1\",`」這一行\r\n\r\nhexo-cli 裝好後\r\n\r\n可以執行下面的指令產生一個專案資料夾\r\n\r\n``` sh\r\n$ hexo init blog\r\n```\r\n\r\n後續步驟可以參考「[Hexo](https://hexo.io/)」首頁，下方的指令說明。\r\n\r\n另外上面安裝的過程，在「3.2.0」我觀察到上面的步驟，應該是 clone 「[hexo-starter](https://github.com/hexojs/hexo-starter)」下來。\r\n\r\n所以也可以改用下面的方式。\r\n\r\n``` sh\r\n$ git clone https://github.com/hexojs/hexo-starter.git blog\r\n```\r\n\r\n以下後續的步驟。\r\n\r\n``` sh\r\n$ cd blog\r\n$ rm .git -rf\r\n$ npm install\r\n$ hexo server\r\n```\r\n\r\n## 額外一提\r\n\r\n以下是 手動確認 global hexo-cli 版本 的指令(在Ubuntu的環境下)\r\n\r\n``` sh\r\n$ grep version $(npm root -g)/hexo-cli/package.json\r\n```\r\n\r\n應該會看到類似下面的字樣\r\n\r\n```\r\n\"version\": \"1.0.1\"\r\n```\r\n\r\n下面的指令，則是可以知道global模組的路徑\r\n\r\n``` sh\r\n$ npm root -g\r\n```\r\n\r\n所以可以拿來應用\r\n\r\n觀看global模組資料夾\r\n\r\n``` sh\r\n$ ls $(npm root -g)\r\n```\r\n\r\n切換到global模組資料夾\r\n\r\n``` sh\r\n$ cd $(npm root -g)\r\n```\r\n\r\n"}}