FAQ

Q:

  1. usr/local/lib/node_modules/docsite/lib/generateHTMLFile.js:24
  2. defaultLanguage: siteConfig.defaultLanguage,
  3. ^
  4. TypeError: Cannot read property 'defaultLanguage' of undefined
  5. at generateHTMLFile (/usr/local/lib/node_modules/docsite/lib/generateHTMLFile.js:24:32)
  6. at start (/usr/local/lib/node_modules/docsite/lib/start.js:58:2)
  7. at Object.<anonymous> (/usr/local/lib/node_modules/docsite/bin/docsite.js:22:5)
  8. at Module._compile (module.js:652:30)
  9. at Object.Module._extensions..js (module.js:663:10)
  10. at Module.load (module.js:565:32)
  11. at tryModuleLoad (module.js:505:12)
  12. at Function.Module._load (module.js:497:3)
  13. at Function.Module.runMain (module.js:693:10)
  14. at startup (bootstrap_node.js:191:16)
  1. /usr/local/lib/node_modules/docsite/lib/generateHTMLFile.js:19
  2. window.rootPath = siteConfig.rootPath;
  3. ^
  4. TypeError: Cannot read property 'rootPath' of undefined
  5. at generateHTMLFile (/usr/local/lib/node_modules/docsite/lib/generateHTMLFile.js:19:32)
  6. at build (/usr/local/lib/node_modules/docsite/lib/build.js:27:3)
  7. at Object.<anonymous> (/usr/local/lib/node_modules/docsite/bin/docsite.js:25:5)
  8. at Module._compile (module.js:652:30)
  9. at Object.Module._extensions..js (module.js:663:10)
  10. at Module.load (module.js:565:32)
  11. at tryModuleLoad (module.js:505:12)
  12. at Function.Module._load (module.js:497:3)
  13. at Function.Module.runMain (module.js:693:10)
  14. at startup (bootstrap_node.js:191:16)

A:

  • 确保site_config/site.js(x)文件存在
  • 如果该文件存在且采用了jsx语法,确保该文件中引入了react(import React from 'react';)

Q:

  1. Error: listen EADDRINUSE 127.0.0.1:8080
  2. at Object._errnoException (util.js:992:11)
  3. at _exceptionWithHostPort (util.js:1014:20)
  4. at Server.setupListenHandle [as _listen2] (net.js:1355:14)
  5. at listenInCluster (net.js:1396:12)
  6. at doListen (net.js:1505:7)
  7. at _combinedTickCallback (internal/process/next_tick.js:141:11)
  8. at process._tickCallback (internal/process/next_tick.js:180:9)
  9. at Function.Module.runMain (module.js:695:11)
  10. at startup (bootstrap_node.js:191:16)
  11. at bootstrap_node.js:612:3
  12. npm ERR! code ELIFECYCLE
  13. npm ERR! errno 1
  14. npm ERR! site@0.0.1 start: `gulp`
  15. npm ERR! Exit status 1
  16. npm ERR!
  17. npm ERR! Failed at the site@0.0.1 start script.
  18. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

A:

开发端口被占用,请修改site_config/site.js文件中的port字段。