1

Can someone help a Windows user here?

I tried different tutorials, none helped with my issue. When I try to use the publish command on a git bash, the error below appears.

I am a Windows 10 user; tried both with Github Desktop and Git for Windows. My node.js version v12.18.3.

igorc@VEGA MINGW64 /d/vdocs/documon/website (master)
$ GIT_USER=kaze12 CURRENT_BRANCH=master USE_SSH=true npm run publish-gh-pages

> @ publish-gh-pages D:\vdocs\documon\website
> docusaurus-publish

master
https://github.com/kaze12/documon.git
Error: Cannot find module 'imagemin-gifsicle'
Require stack:
- D:\vdocs\documon\website\node_modules\docusaurus\lib\server\generate.js
- D:\vdocs\documon\website\node_modules\docusaurus\lib\build-files.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at _callee$ (D:\vdocs\documon\website\node_modules\docusaurus\lib\server\/generate.js:42:28)
    at tryCatch (D:\vdocs\documon\website\node_modules\regenerator-runtime\runtime.js:63:40)
    at Generator.invoke [as _invoke] (D:\vdocs\documon\website\node_modules\regenerator-runtime\runtime.js:293:22)
    at Generator.next (D:\vdocs\documon\website\node_modules\regenerator-runtime\runtime.js:118:21)
    at asyncGeneratorStep (D:\vdocs\documon\website\node_modules\docusaurus\lib\server\generate.js:3:103)
    at _next (D:\vdocs\documon\website\node_modules\docusaurus\lib\server\generate.js:5:194) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'D:\\vdocs\\documon\\website\\node_modules\\docusaurus\\lib\\server\\generate.js',
    'D:\\vdocs\\documon\\website\\node_modules\\docusaurus\\lib\\build-files.js'
  ]
}
Error: generating html failed
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ publish-gh-pages: `docusaurus-publish`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ publish-gh-pages 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\igorc\AppData\Roaming\npm-cache\_logs\2020-08-15T12_31_06_107Z-debug.log

And this is the debug log that npm recorded: 2020-08-15T12_31_06_107Z-debug.log

1 Answers1

0

Try first and install the missing module, as seen in imagemin/gifsicle-bin issue 44:

npm install imagemin-gifsicle

If poychang/publish-gh-pages is a grunt project, you might need to perform this installation in .\node_modules\grunt-contrib-imagemin\node_modules\imagemin\, as mentioned in gruntjs/grunt-contrib-imagemin issue 228.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I couldn't find the folder you mentioned. My path ended at .\website\node_modules\. What I found was .\website\node_modules\imagemin (without the grunt subdirectory). Tried to use the suggested command there and it gave me this result: – Igor Mendonça Aug 16 '20 at 17:28
  • $ npm install imagemin-gifsicle npm WARN website No repository field. npm WARN website No license field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) + imagemin-gifsicle@7.0.0 removed 1 package, updated 2 packages and audited 1021 packages in 10.735s 29 packages are looking for funding run `npm fund` for details found 0 vulnerabilities – Igor Mendonça Aug 16 '20 at 17:28
  • And when I tried to publish, there was a clone issue: https://1drv.ms/u/s!Ai5xJLBe-GsAibVVNqiLxWIljYIyvg?e=j6u1DF – Igor Mendonça Aug 16 '20 at 17:33
  • 1
    @IgorMendonça As in https://stackoverflow.com/a/49591086/6309, try a `npm install --no-optional --no-shrinkwrap --no-package-lock` – VonC Aug 16 '20 at 18:04