Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repak.js is broken on newer node installs #69

Open
glennhartmann opened this issue Sep 12, 2020 · 1 comment · May be fixed by #70
Open

repak.js is broken on newer node installs #69

glennhartmann opened this issue Sep 12, 2020 · 1 comment · May be fixed by #70

Comments

@glennhartmann
Copy link

running it results in errors that look like this:

node_modules/temp/lib/temp.js:142
exports.dir               = os.tmpDir();
                               ^

TypeError: os.tmpDir is not a function
    at Object.<anonymous> (node_modules/temp/lib/temp.js:142:32)
    at Module._compile (internal/modules/cjs/loader.js:1076:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:941:32)
    at Function.Module._load (internal/modules/cjs/loader.js:782:14)
    at Module.require (internal/modules/cjs/loader.js:965:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (node_modules/execSync/index.js:6:12)
    at Module._compile (internal/modules/cjs/loader.js:1076:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)

due to the temp package being too old and trying to call os.tmpDir() instead of the newer os.tmpdir().

Fixing that locally then results in further errors:

internal/modules/cjs/loader.js:896
  throw err;
  ^

Error: Cannot find module './build/Release/shell'
Require stack:
- node_modules/execSync/index.js
- bin/repak.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:893:15)
    at Function.Module._load (internal/modules/cjs/loader.js:743:27)
    at Module.require (internal/modules/cjs/loader.js:965:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (node_modules/execSync/index.js:30:11)
    at Module._compile (internal/modules/cjs/loader.js:1076:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:941:32)
    at Function.Module._load (internal/modules/cjs/loader.js:782:14)
    at Module.require (internal/modules/cjs/loader.js:965:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [                                                                                                                                                                      
    'node_modules/execSync/index.js',
    'bin/repak.js'
  ]
}

The execSync package is no longer supported, and can be replaced with built-in child_process.execSync.

glennhartmann added a commit to glennhartmann/quakejs that referenced this issue Sep 12, 2020
There were 2 separate issues:
* the specified version of  uses os.tmpDir() instead of os.tmpdir()
* the  package doesn't work anymore, and should be replaced by the built-in

This fixes inolen#69.
@glennhartmann glennhartmann linked a pull request Sep 12, 2020 that will close this issue
glennhartmann added a commit to glennhartmann/quakejs that referenced this issue Sep 14, 2020
There were 2 separate issues:
* the specified version of  uses os.tmpDir() instead of os.tmpdir()
* the  package doesn't work anymore, and should be replaced by the built-in

This fixes inolen#69.
@ghost
Copy link

ghost commented Sep 20, 2020

There are other problems deeper in.
inolen/quakejs-files#2
And someone PRed a change that uses some internal buffer on the file stream and that no longer works. Use my repack on latest commit, cli options are extensive and in the readme and available with npm run repack -- -h
https://github.com/briancullinan/planet_quake/blob/checksum_spoofing/code/xquakejs/bin/repack.js#L23

npm run repack -- --no-graph --pk3dir ~/baseq3 is common for me.

Requires image magick and ogg encoder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant