felixrieseberg / slack-archive

Generate static HTML archives of Slack workspaces
243 stars 33 forks source link

Unable to run on Windows 10 #14

Open dlinny-lag opened 2 years ago

dlinny-lag commented 2 years ago

I'm trying to execute command npx slack-archive mentioned in readme, but it failed with 'slack-archive' is not recognized as an internal or external command error What I'm missing?

here is the detailed log

D:\sl\Slack\tools\slack-archive>npx --loglevel verbose slack-archive
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm verb cli C:\Program Files\nodejs\node.exe C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
npm info using npm@8.15.0
npm info using node@v16.16.0
npm timing npm:load:whichnode Completed in 1ms
npm timing config:load:defaults Completed in 6ms
npm timing config:load:file:C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 4ms
npm timing config:load:builtin Completed in 4ms
npm timing config:load:cli Completed in 3ms
npm timing config:load:env Completed in 0ms
npm timing config:load:file:D:\sl\Slack\tools\slack-archive\.npmrc Completed in 1ms
npm timing config:load:project Completed in 2ms
npm timing config:load:file:C:\Users\Administrator\.npmrc Completed in 0ms
npm timing config:load:user Completed in 0ms
npm timing config:load:file:C:\Users\Administrator\AppData\Roaming\npm\etc\npmrc Completed in 0ms
npm timing config:load:global Completed in 1ms
npm timing config:load:validate Completed in 0ms
npm timing config:load:credentials Completed in 1ms
npm timing config:load:setEnvs Completed in 2ms
npm timing config:load Completed in 21ms
npm timing npm:load:configload Completed in 21ms
npm timing npm:load:mkdirpcache Completed in 1ms
npm timing npm:load:mkdirplogs Completed in 1ms
npm verb title npm exec slack-archive
npm verb argv "exec" "--loglevel" "verbose" "--" "slack-archive"
npm timing npm:load:setTitle Completed in 2ms
npm timing config:load:flatten Completed in 5ms
npm timing npm:load:display Completed in 30ms
npm verb logfile logs-max:10 dir:C:\Users\Administrator\AppData\Local\npm-cache\_logs
npm verb logfile C:\Users\Administrator\AppData\Local\npm-cache\_logs\2022-07-23T10_36_10_215Z-debug-0.log
npm timing npm:load:logFile Completed in 10ms
npm timing npm:load:timers Completed in 0ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load Completed in 69ms
npm timing arborist:ctor Completed in 1ms
npm timing arborist:ctor Completed in 0ms
'slack-archive' is not recognized as an internal or external command,
operable program or batch file.
npm timing command:exec Completed in 355ms
npm verb exit 1
npm timing npm Completed in 581ms
npm verb code 1

UPD: Error above can be fixed by executing npm link But it leads to another problem - missing file

D:\sl\Slack\tools\slack-archive>npx slack-archive
node:internal/errors:465
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'D:\sl\Slack\tools\slack-archive\lib\cli.js' imported from D:\sl\Slack\tools\slack-archive\bin\slack-archive.js
    at new NodeError (node:internal/errors:372:5)
    at finalizeResolution (node:internal/modules/esm/resolve:437:11)
    at moduleResolve (node:internal/modules/esm/resolve:1009:10)
    at defaultResolve (node:internal/modules/esm/resolve:1218:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)
    at ESMLoader.import (node:internal/modules/esm/loader:380:22)
    at importModuleDynamically (node:internal/modules/esm/translators:106:35)
    at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14)
    at file:///D:/sl/Slack/tools/slack-archive/bin/slack-archive.js:3:1 {
  code: 'ERR_MODULE_NOT_FOUND'
}

UPD 2: I was able to run application by executing npm run cli with fix mentioned in PR

felixrieseberg commented 2 years ago

I run this script primarily on Windows 10, so it should work. I'd try removing all contents of %LocalAppData%/npm-cache/_npx.

dlinny-lag commented 2 years ago

Error message states that ...slack-archive\lib\cli.js was not found. There is no lib directory and it is not creating by executing npx slack-archive I suspect that some step is missing in the description.

kasumiru commented 4 months ago

You should use node 16 (nodejs-16.20.2-1nodesource.x86_64). not higher than this. In 18 node I also get this error "ErrorCaptureStackTrace(err);"