Open rikusen0335 opened 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.
I have installed windows-build-tools
on first, but errors happened.
Btw, should I do it on Linux better to do with Windows?
yes, linux or macos is better
yes, linux or macos is better
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].
Hi, I will see why it happens after my vacation.
First, I got this error.
Error1
07: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.
Error2
07: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 (There is no solution (I mean URL in error log).
Well, I thought I have to download
mamboer/lunr.js
So I did this commandnpm install mamboer/lunr.js
Then this error happened.
Error3
E:\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.logThis 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.Error4
E:\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 okI can't think other solution, so I opening issue. Are there any solutions?
[Other Information] Windows 10 64bit npm version: 6.1.0