Mrminfive / hexo-theme-skapp

The hexo flat design theme(扁平化简约主题)
MIT License
480 stars 116 forks source link

I got erros when running server with skapp #68

Open rikusen0335 opened 6 years ago

rikusen0335 commented 6 years ago

First, I got this error.

Error107:07:35.202 ERROR Script load failed: themes\hexo-theme-skapp\scripts\renderer.js Error: Cannot find module 'lunr' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (E:\hexo\sites\blog\node_modules\hexo\lib\hexo\index.js:219:21) at E:\hexo\sites\blog\themes\hexo-theme-skapp\scripts\renderer.js:5:16 at fs.readFile.then.script (E:\hexo\sites\blog\node_modules\hexo\lib\hexo\index.js:232:12) at tryCatcher (E:\hexo\sites\blog\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (E:\hexo\sites\blog\node_modules\bluebird\js\release\promise.js:512:31) at Promise._settlePromise (E:\hexo\sites\blog\node_modules\bluebird\js\release\promise.js:569:18) at Promise._settlePromise0 (E:\hexo\sites\blog\node_modules\bluebird\js\release\promise.js:614:10) at Promise._settlePromises (E:\hexo\sites\blog\node_modules\bluebird\js\release\promise.js:693:18) at Promise._fulfill (E:\hexo\sites\blog\node_modules\bluebird\js\release\promise.js:638:18) at Promise._resolveCallback (E:\hexo\sites\blog\node_modules\bluebird\js\release\promise.js:432:57) at Promise._settlePromiseFromHandler (E:\hexo\sites\blog\node_modules\bluebird\js\release\promise.js:524:17) at Promise._settlePromise (E:\hexo\sites\blog\node_modules\bluebird\js\release\promise.js:569:18) at Promise._settlePromise0 (E:\hexo\sites\blog\node_modules\bluebird\js\release\promise.js:614:10) at Promise._settlePromises (E:\hexo\sites\blog\node_modules\bluebird\js\release\promise.js:693:18) at Promise._fulfill (E:\hexo\sites\blog\node_modules\bluebird\js\release\promise.js:638:18) at E:\hexo\sites\blog\node_modules\bluebird\js\release\nodeback.js:42:21 at E:\hexo\sites\blog\node_modules\graceful-fs\graceful-fs.js:78:16 at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)

Then, I did this command to install. npm install lunr

It seems like errors are fixed, but another error happened.

Error207:11:37.312 DEBUG Generator: category 07:11:37.315 FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html TypeError: searchIdx.add is not a function at E:\hexo\sites\blog\themes\hexo-theme-skapp\scripts\renderer.js:94:23 at Array.forEach () at Hexo. (E:\hexo\sites\blog\themes\hexo-theme-skapp\scripts\renderer.js:75:22) at Hexo.tryCatcher (E:\hexo\sites\blog\node_modules\bluebird\js\release\util.js:16:23) at Hexo. (E:\hexo\sites\blog\node_modules\bluebird\js\release\method.js:15:34) at Promise.map.key (E:\hexo\sites\blog\node_modules\hexo\lib\hexo\index.js:336:26) at tryCatcher (E:\hexo\sites\blog\node_modules\bluebird\js\release\util.js:16:23) at MappingPromiseArray._promiseFulfilled (E:\hexo\sites\blog\node_modules\bluebird\js\release\map.js:61:38) at MappingPromiseArray.PromiseArray._iterate (E:\hexo\sites\blog\node_modules\bluebird\js\release\promise_array.js:114:31) at MappingPromiseArray.init (E:\hexo\sites\blog\node_modules\bluebird\js\release\promise_array.js:78:10) at MappingPromiseArray._asyncInit (E:\hexo\sites\blog\node_modules\bluebird\js\release\map.js:30:10) at Async._drainQueue (E:\hexo\sites\blog\node_modules\bluebird\js\release\async.js:138:12) at Async._drainQueues (E:\hexo\sites\blog\node_modules\bluebird\js\release\async.js:143:10) at Immediate.Async.drainQueues (E:\hexo\sites\blog\node_modules\bluebird\js\release\async.js:17:14) at runCallback (timers.js:810:20) at tryOnImmediate (timers.js:768:5) at processImmediate [as _immediateCallback] (timers.js:745:5)

There is no solution (I mean URL in error log).

Well, I thought I have to download mamboer/lunr.js So I did this command npm install mamboer/lunr.js

Then this error happened.

Error3E:\hexo\sites\blog>npm install mamboer/lunr.js > nodejieba@2.2.6 install E:\hexo\sites\blog\node_modules\nodejieba > node-gyp rebuild E:\hexo\sites\blog\node_modules\nodejieba>if not defined npm_config_node_gyp (node "C:\Users\lemiliam\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\lemiliam\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) このソリューション内のプロジェクトを 1 度に 1 つずつビルドします。並行ビルドを有効にするには、"/m" スイッチを追加してく ださい。 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK vers ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [E:\hexo\sites\b log\node_modules\nodejieba\build\nodejieba.vcxproj] gyp ERR! build error gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\lemiliam\AppData\Roaming\npm\node_modules\npm\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 Windows_NT 10.0.17134 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\lemiliam\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd E:\hexo\sites\blog\node_modules\nodejieba gyp ERR! node -v v8.11.3 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! nodejieba@2.2.6 install: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the nodejieba@2.2.6 install 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! C:\Users\lemiliam\AppData\Roaming\npm-cache\_logs\2018-07-03T07_13_28_445Z-debug.log

このソリューション内のプロジェクトを 1 度に 1 つずつビルドします。並行ビルドを有効にするには、"/m" スイッチを追加してください。

This means "Build the projects in this solution one at a time. To enable concurrent builds, add the "/ m" switch.", so this is unrelated.

Well, I ran a command node-gyp rebuild because written. But then the error has come again.

Error4E:\hexo\sites\blog>node-gyp rebuild gyp info it worked if it ends with ok gyp info using node-gyp@3.7.0 gyp info using node@8.11.3 | win32 | x64 gyp info spawn C:\Users\lemiliam\.windows-build-tools\python27\python.exe gyp info spawn args [ 'C:\\Users\\lemiliam\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'msvs', gyp info spawn args '-G', gyp info spawn args 'msvs_version=2015', gyp info spawn args '-I', gyp info spawn args 'E:\\hexo\\sites\\blog\\build\\config.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\\Users\\lemiliam\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\\Users\\lemiliam\\.node-gyp\\8.11.3\\include\\node\\common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=C:\\Users\\lemiliam\\.node-gyp\\8.11.3', gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\lemiliam\\AppData\\Roaming\\npm\\node_modules\\node-gyp', gyp info spawn args '-Dnode_lib_file=C:\\Users\\lemiliam\\.node-gyp\\8.11.3\\<(target_arch)\\node.lib', gyp info spawn args '-Dmodule_root_dir=E:\\hexo\\sites\\blog', gyp info spawn args '-Dnode_engine=v8', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'E:\\hexo\\sites\\blog\\build', gyp info spawn args '-Goutput_dir=.' ] gyp: binding.gyp not found (cwd: E:\hexo\sites\blog) while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (C:\Users\lemiliam\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:345:16) 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 Windows_NT 10.0.17134 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\lemiliam\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd E:\hexo\sites\blog gyp ERR! node -v v8.11.3 gyp ERR! node-gyp -v v3.7.0 gyp ERR! not ok

I can't think other solution, so I opening issue. Are there any solutions?

[Other Information] Windows 10 64bit npm version: 6.1.0

BruceYuj commented 6 years ago

The error about node-gyp is caused by window OS because windows OS does not support node-gyp directly. you can see the readme.md.

note: If your OS is Windows, you may meet some problems when install the mamboer/lunr.js(because of the packagenodejieba). To fix this problem, you should install node-gyp(in administrator mode).

npm install -g windows-build-tools
npm install -g node-gyp

But this error will still exist because of the windows os complexity.

rikusen0335 commented 6 years ago

I have installed windows-build-tools on first, but errors happened. Btw, should I do it on Linux better to do with Windows?

BruceYuj commented 6 years ago

yes, linux or macos is better

BruceYuj commented 6 years ago

yes, linux or macos is better

rikusen0335 commented 6 years ago

Hi, I tried to install this theme on linux, but the same error happened.

Error: Cannot find module '/home/pi/blog/node_modules/nodejieba/build/Release/nodejieba.node'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/pi/blog/node_modules/nodejieba/index.js:1:79)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at /home/pi/blog/node_modules/lunr/lunr.js:199:23
    at Object.<anonymous> (/home/pi/blog/node_modules/lunr/lunr.js:2065:3)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (/home/pi/blog/node_modules/hexo/lib/hexo/index.js:219:21)
    at /home/pi/blog/themes/hexo-theme-skapp/scripts/renderer.js:5:16
INFO  Start processing
INFO  Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.

How do I fix it? It was tried on Raspbian, npm[5.6.0], node[8.11.3].

BruceYuj commented 6 years ago

Hi, I will see why it happens after my vacation.