Giter Club home page Giter Club logo

xnbcli's Introduction

xnbcli

Build Status

A CLI tool for XNB packing/unpacking purpose built for Stardew Valley.

This tool currently supports unpacking all LZX compressed XNB files for Stardew Valley.
There is some basic groundwork for XACT as well.

The end goal for this project is to serve as a CLI for a GUI wrapper to leverage so the average user can interface with XNB files a lot easier.

Usage

Unpacking XNB files

Place any files you wish to extract in the packed folder and run the appropriate file for unpacking. unpack.bat, unpack.command or unpack.sh.

Packing XNB files

Place any files you wish to repack back into XNB files in the unpacked folder and run the appropriate file for packing. pack.bat, pack.command or pack.sh.

Terminal Use

xnbcli (pack|unpack) [input] [output]

Developers

If you wish to run this with Node.js and all the source code, please refer to the following.

  • node.js installed
  • npm installed
  • python installed
  • (for Windows users) windows-build-tools installed (npm i --g --production windows-build-tools)
  • Run npm install to install node packages.
  • npm run unpack and npm run pack scripts are available for use in the package.json file.

License

GNU LGPL v3.0

xnbcli's People

Contributors

dependabot[bot] avatar kacperknapik avatar king-millez avatar leonblade avatar stevenlele avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xnbcli's Issues

Using xnbcli as a module

I'm having some difficulties using xnbcli as a module.

Could you add "main": "xnbcli.js", to the package.json? And consider publishing the package on npm too?

It would also help if there was a non-CLI way to use xnbcli. Exporting the processUnpack() and processPack() functions in xnbcli.js, for example.

decompile problem

it doesn't decompile image correctly when there are some color values in RGB and with alpha channel in 0 at the same time.

Can't pack XNB file

I don't know if there's something very obvious that I'm missing, but I cant figure it out. I have no problem unpacking files, but when I try to repack the same file nothing happens. I do as the directions say, I put the unpacked file in the unpacked folder, then run pack.bat, but the file doesn't repack and all that comes up is this
https://user-images.githubusercontent.com/62083131/97391420-6ac21080-189c-11eb-9f15-19eb9c06ee2b.png

I click enter and the window closes, same thing if I press any key

Unable to unpack Movies.xnb in /Content/Data

[ERROR] Filename: packed\Movies.xnb
XnbError: Non-implemented type found, cannot resolve type "StardewValley.GameData.Movies.MovieData", "StardewValley.GameData.Movies.MovieData, StardewValley.GameData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null".
at simplifyType (C:\snapshot\xnbcli\app\Xnb\TypeReader.js:0:0)
at Array.map ()
at simplifyType (C:\snapshot\xnbcli\app\Xnb\TypeReader.js:0:0)
at Xnb.load (C:\snapshot\xnbcli\app\Xnb\index.js:0:0)
at processUnpack (C:\snapshot\xnbcli\xnbcli.js:0:0)
at Walker.walker.on (C:\snapshot\xnbcli\xnbcli.js:0:0)
at Walker.emit (events.js:198:13)
at Object.emitSingleEvents [as emitNodeType] (C:\snapshot\xnbcli\node_modules\walk\lib\node-type-emitter.js:58:13)
at Walker._wLstatHandler (C:\snapshot\xnbcli\node_modules\walk\lib\walk.js:88:19)
at C:\snapshot\xnbcli\node_modules\walk\lib\walk.js:106:12

Won't Unpack Or Pack

C:\Windows\system32>xnbcli.exe pack ".\unpacked" ".\packed"
'xnbcli.exe' is not recognized as an internal or external command,
operable program or batch file.

C:\Windows\system32>echo Press enter to continue
Press enter to continue

C:\Windows\system32>pause
Press any key to continue . . .

I downloaded the latest release.

xnbcli packed file does not work for SDV credits.xnb

I'm making a Finnish translation of Stardew Valley and to be thorough, took also the credits (which is outside the saved game).
I got this:

Crashed.txt

This is from a run where I had the credits.xnb from the base game just unpacked, packed and renamed, without editing (an .xnb only renamed worked).

The unpacked .json worked after I had stripped it of the header part leaving only the array part (this was a workround).

Suggestion: Pause before exiting

A common use case of this tool is for new users to run the pack unpack/scripts directly. When they do that currently, a window flashes open and then closes quickly. They often interpret this as something going wrong and go to get support, only to be told that that's normal.

Instead, add a prompt that waits for a key to be pressed before exiting after the tool finishes processing files.

If you wanted to maintain backwards compatible behavior when running the executable directly, you could add a flag to the executable that configures whether to wait or not, set it be false by default, and update the {pack,unpack}.{bat,command,sh} scripts to set it to true.

Can't extract "TailoringRecipes.xnb"

I can't extract the file "TailoringRecipes.xnb" in Data with xnbcli,
it's telling me that there is a "Non-implemented type found".
I was wondering if there is a way to extract it, or if you will do it in the future.

Xnb Error: Invalid File

I was trying to extract an image from a .xnb file but I ran into this error:
My-MacBook-Air:~ Me$ /Users/Me/Downloads/xnbcli-macos/unpack.command ; exit;
[INFO] Reading file "packed/Coby 2 copy.xnb" ...
[ERROR] Filename: packed/Coby 2 copy.xnb
XnbError: Invalid file magic found, expecting "XNB", found ""
at Xnb._validateHeader (/snapshot/xnbcli/app/Xnb/index.js)
at Xnb.load (/snapshot/xnbcli/app/Xnb/index.js)
at processUnpack (/snapshot/xnbcli/xnbcli.js)
at Walker. (/snapshot/xnbcli/xnbcli.js)
at Walker.emit (events.js:311:20)
at Object.emitSingleEvents [as emitNodeType] (/snapshot/xnbcli/node_modules/walk/lib/node-type-emitter.js:58:13)
at Walker._wLstatHandler (/snapshot/xnbcli/node_modules/walk/lib/walk.js:88:19)
at /snapshot/xnbcli/node_modules/walk/lib/walk.js:106:12
at FSReqCallback.oncomplete (fs.js:167:5)

Success 0
Fail 1

I have next to no knowledge on programming, converting files like xnb's, nor what "invalid file magic" means or how to handle it. Is there any course of action you can recommend?

Support new XNB format in Stardew Valley 1.4

Stardew Valley 1.4 adds a new type of XNB which contains data models, in the form List<SomeModelClass> or Dictionary<string, SomeModelClass>. Currently xnbcli skips them when unpacking.

Affected assets:

  • Data\Concessions
  • Data\FishPondData
  • Data\Movies
  • Data\MoviesReactions
  • Data\TailoringRecipes

The game developers provided these representative files for the new format (including the original files, debug pack, and release pack). See this overview of the XNB feature they used (the "Custom Classes" section).

Let me know if you need anything else!

Won't Unpack Or Pack

Problem:

  • I Paste my File (cat.xnb)
  • In Packed And Run Unpack.bat On Windows 10,
    -I Press Enter As It Says And Nothing In Unpacked Or Packed
    -This is the command prompt that It follows with

C:\Users\XXXX\Downloads\xnbcli-master>xnbcli.exe unpack ".\packed" ".\unpacked"
'xnbcli.exe' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\XXXX\Downloads\xnbcli-master>echo Press enter to continue
Press enter to continue

C:\Users\XXXX\Downloads\xnbcli-master>pause
Press any key to continue . . .

Ok Plz Help Me

'No such file' error on Mac

If you run the pack.sh and unpack.sh files from the Mac UI (not directly from a terminal), they fail with this error:

$ /Users/username/Desktop/xnbcli/unpack.sh ; exit;
   /Users/username/Desktop/xnbcli/unpack.sh: line 2: ./xnbcli: No such file or directory   

Adding this at the top of the .sh files should fix it:

cd "`dirname "$0"`"

Font unpacking PNG issues

Unpacking fonts from Content/Fonts doesn't seem to work well, where the PNG generated is messed up..

Example attached for SmallFont. This was on Windows 10
SmallFont

Let me know if you need anything else from me!

Underrail Expansion Issue

Hi,

I wanted to edit Underrail sprites and redo some of them. The base game seems to unpack fine and this tool works great to unpack and repack. The expedition expansion seems to cause an error though and I was hoping you could take a look. Weirdly it isnt every new expansion file so I found 4 that had this issue.

[INFO] Reading file "packed\1p33.xnb" ...
[INFO] XNB file validated successfully!
[ERROR] Filename: packed\1p33.xnb
XnbError: Decode table did not reach table mask.
at Lzx.decodeTable (C:\snapshot\xnbcli\app\Presser\Lzx.js:0:0)
at Lzx.decompress (C:\snapshot\xnbcli\app\Presser\Lzx.js:0:0)
at Function.decompress (C:\snapshot\xnbcli\app\Presser\index.js:0:0)
at Xnb.load (C:\snapshot\xnbcli\app\Xnb\index.js:0:0)
at processUnpack (C:\snapshot\xnbcli\xnbcli.js:0:0)
at Walker.walker.on (C:\snapshot\xnbcli\xnbcli.js:0:0)
at Walker.emit (events.js:182:13)
at Object.emitSingleEvents [as emitNodeType] (C:\snapshot\xnbcli\node_modules\walk\lib\node-type-emitter.js:58:13)
at Walker._wLstatHandler (C:\snapshot\xnbcli\node_modules\walk\lib\walk.js:88:19)
at C:\snapshot\xnbcli\node_modules\walk\lib\walk.js:106:12

Here is a link to the xnb files

http://www.mediafire.com/file/pu9y9wfkxa3y5v3/Underrrail_Error.7z/file

Not sure if issue

Hi! I am Very New! at editing mods and this is probably 100% my fault but every time i try to unpack my file (shane.xnb) it just makes a copy of the unpack.command and from what I can see doesnt actually unpack the file. I was wondering if im doing anything wrong

Please make xnbcli-Linux for other architecture

I have problem when trying to open xnbcli-linux command in my device.

Im using Termux and installed Ubuntu with armhf.Most android device using Armhf/Arm64.And your file doesnt support the architecture.Please make it for this arch so it Will helpful for android user who doesnt have PC.Thanks.

Does not have "content" error when trying to pack?

I am getting this error when trying to pack files
[ERROR] Filename: unpacked\NPCNames.json
XnbError: unpacked\NPCNames.json does not have "content".
at resolveImports (C:\snapshot\xnbcli\app\Porter.js:0:0)
at processPack (C:\snapshot\xnbcli\xnbcli.js:0:0)
at Walker.walker.on (C:\snapshot\xnbcli\xnbcli.js:0:0)
at Walker.emit (events.js:198:13)
at Object.emitSingleEvents [as emitNodeType] (C:\snapshot\xnbcli\node_modules\walk\lib\node-type-emitter.js:58:13)
at Walker._wLstatHandler (C:\snapshot\xnbcli\node_modules\walk\lib\walk.js:88:19)
at C:\snapshot\xnbcli\node_modules\walk\lib\walk.js:106:12
at FSReqWrap.oncomplete (fs.js:154:5)
Am I missing something?

Log show warning with iOS file

Like my title, I hope you will support it soon!
It can unpack file but when pack to XNB file, it has a large size (I'm doesn't change anything).

Warning:
warning

Original Size:
ORG_size

After Pack size:
After_pack_size

missing xnbcli.exe

Running unpack.bat in windows returns a "command not recognized" error for xnbcli.exe
I can't find this executable anywhere in the project. Is there some script I need to compile first?

Simply downloading the project and running the bat as per instructions doesn't work, unless I'm missing something obvious...

LGPL or other license?

Can this be offered under any more permissive license than the normal GPL. LGPL perhaps? I'm looking to use this as a DLL but my project also links other DLLs that are not GPL compatible which makes the entire operation a no-go.

Use .command extension on Mac

The Mac UI opens .sh files in a text editor by default for some reason. Consider using .command extensions for the shell scripts on Mac instead.

Possible terraria support?

[ERROR] Filename: packed/Content/Fonts/Combat_Text.xnb XnbError: Non-implemented type found, cannot resolve type "ReLogic.Graphics.DynamicSpriteFontReader", "ReLogic.Graphics.DynamicSpriteFontReader, ReLogic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null". at simplifyType (/snapshot/xnbcli/app/Xnb/TypeReader.js:0:0) at Xnb.load (/snapshot/xnbcli/app/Xnb/index.js:0:0) at processUnpack (/snapshot/xnbcli/xnbcli.js:0:0) at Walker.walker.on (/snapshot/xnbcli/xnbcli.js:0:0) at Walker.emit (events.js:189:13) at Object.emitSingleEvents [as emitNodeType] (/snapshot/xnbcli/node_modules/walk/lib/node-type-emitter.js:58:13) at Walker._wLstatHandler (/snapshot/xnbcli/node_modules/walk/lib/walk.js:88:19) at /snapshot/xnbcli/node_modules/walk/lib/walk.js:106:12 at FSReqWrap.oncomplete (fs.js:154:5)

It'd be very nice to add font types to xnbcli as it's the only thing it doesn't really support for Terraria. This'd be very nice as there's no other xnb extractor project like this one.

Can't run pack.command on Mac

Whenever I try to run the pack.command file, I get the error "The file "pack.command" could not be executed because you do not have appropriate access privileges." I've tried changing the access privileges and reinstalling the program, but neither one worked.

Screenshot 2024-05-24 at 5 36 17 PM-2

I can't unpack??

Issue
I'm trying to unpack a font from Terraria, so I put the .xnb file into the "packed" folder. I ran "unpack.bat", and it stopped doing anything at "XNB file validated successfully!" I waited for a while and then... It just closed. No output file. Nothing. I don't know what happened, but something definitely didn't work right... I'm using Windows 10 x64.
How to replicate
I have no idea. It seems that it's just an issue on my end, but the program should work on all computers. If there's anything you could suggest to fix it, then please tell me.

bmfont type *.xml file couldn't repack

It was perfectly working when i unpack .xnb to xml (.fnt from bmfont)
but I couldn't pack that file again. even though I repacked a file, it still looked same after I packed.

These are pictures after I unpacked it and repacked.

Cannot unpack Sound Effects

Admittedly, the game I'm trying to unpack is not SDV, but still. I get this error for all Sound Files:

XnbError: Non-implemented type found, cannot resolve type "Microsoft.Xna.Framework.Content.SoundEffectReader", "Microsoft.Xna.Framework.Content.SoundEffectReader".

TConvert, however unpacked these files just fine.

Error when trying to pack files

I was able to unpack the XNB files with no issues but when I try to repack them I receive an error saying ENOENT: no such file or directory (for every file). I placed the unpacked files in the unpacked folder and then clicked on pack.bat. Did I miss a step?

Support for ModelRead

C:\Users\H510\Downloads\xnbcli-windows-x64>xnbcli.exe unpack ".\packed" ".\unpacked"
[INFO] Reading file "packed\TerrainMesh.xnb" ...
[INFO] XNB file validated successfully!
[INFO] File has been successfully decompressed!
[ERROR] Filename: packed\TerrainMesh.xnb
XnbError: Non-implemented type found, cannot resolve type "Microsoft.Xna.Framework.Content.ModelReader", "Microsoft.Xna.Framework.Content.ModelReader, Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553".
at simplifyType (C:\snapshot\xnbcli\app\Xnb\TypeReader.js:0:0)
at Xnb.load (C:\snapshot\xnbcli\app\Xnb\index.js:0:0)
at processUnpack (C:\snapshot\xnbcli\xnbcli.js:0:0)
at Walker.walker.on (C:\snapshot\xnbcli\xnbcli.js:0:0)
at Walker.emit (events.js:198:13)
at Object.emitSingleEvents [as emitNodeType] (C:\snapshot\xnbcli\node_modules\walk\lib\node-type-emitter.js:58:13)
at Walker._wLstatHandler (C:\snapshot\xnbcli\node_modules\walk\lib\walk.js:88:19)
at C:\snapshot\xnbcli\node_modules\walk\lib\walk.js:106:12
at FSReqWrap.oncomplete (fs.js:154:5)

Success 0
Fail 1

C:\Users\H510\Downloads\xnbcli-windows-x64>echo Press enter to continue
Press enter to continue

C:\Users\H510\Downloads\xnbcli-windows-x64>pause
Press any key to continue . . .

Repacking Ruins the .xnb file?

When I unpack a file, then pack it back up, even when making no changes to the unpacked contents, if I try to unpack the file I just packed, I get an error message and the unpack fails.
This is the message that gets printed out:

Error Message 2
This was after modifying the .png file

Error Message
This was after merely unpacking a file, packing it up, then unpacking the packed file.

Minor issues on Linux

Hi, I was just made aware of this tool; figured I'd give it a shot.
It's definitely a nice alternative to using the Wine workaround.

But, I came across a few small issues while testing the v1.0.0 release for Linux.

Error 1. Line Feed/EOL error in the scripts:
Example:

Aescylon-3:~/Downloads/xnbcli$ ./pack.sh
bash: ./pack.sh: /bin/bash^M: bad interpreter: No such file or directory"

Error 2. Scripts, and xnbcli binary are not executable.

Error 3. xnbcli can not create directories when packing files, causing a failure to repack the files if they were in sub-directories in the unpacked folder.
However, it has no issue creating new directories when files are being unpacked.

Example packing with 2 Crops.json files. One under 'unpacked', the other in a sub-directory:

Aescylon-3:~/Downloads/xnbcli$ ./pack.sh 
[INFO] Reading file "unpacked/crops.json" ...
[INFO] Output file saved: packed/crops.xnb

[INFO] Reading file "unpacked/Content/TileSheets/crops.json" ...
[ERROR] Filename: unpacked/Content/TileSheets/crops.json
Error: ENOENT: no such file or directory, open 'packed/Content/TileSheets/crops.xnb'
    at Object.fs.openSync (fs.js:663:18)
    at Object.fs.openSync (pkg/prelude/bootstrap.js:483:32)
    at Object.fs.writeFileSync (fs.js:1314:33)
    at processPack (/snapshot/xnbcli/xnbcli.js:0:0)
    at Walker.walker.on (/snapshot/xnbcli/xnbcli.js:0:0)
    at Walker.emit (events.js:159:13)
    at Object.emitSingleEvents [as emitNodeType] (/snapshot/xnbcli/node_modules/walk/lib/node-type-emitter.js:55:13)
    at Walker._wLstatHandler (/snapshot/xnbcli/node_modules/walk/lib/walk.js:87:19)
    at /snapshot/xnbcli/node_modules/walk/lib/walk.js:105:12
    at FSReqWrap.oncomplete (fs.js:167:5)

Success 1
Fail 1

Error 4. xnbcli will not read .yaml files.


Suggested Fixes/Current Workarounds:

Assuming you're running Windows. You can probably use something like Notepad++ to convert the DOS EOL to a UNIX EOL. I know you can do so in Geany.

Same with setting, and preserving the executable bit for the files in the zip. Might need a Linux VM, or Cygwin/Windows Subystem for Linux to do those tasks; as I'm not quite sure if Windows has support for that.

What I personally did under Linux to fix my issues:

  1. Opened, Geany -> "Document" tab -> Set Line Endings -> Convert and Set to LF (Unix); then resaved. //Fix line endings.

  2. Ran in the terminal, chmod +x *.sh xnbcli //Set files to be executable.

  3. Ran in the terminal, cd ./unpacked && find . -type d -exec mkdir -p ../packed/{} \; && cd .. //If there's a directory structure in 'unpacked' recreate it in the 'packed' folder before repacking files.

  4. Inform users it'll only read .json data files when packing. I spent a bit trying to troubleshoot why it wouldn't pack my .yaml files. Eventually, I stopped trying to pack files, and instead tried to unpack some XNB files; that's when I noticed that it output .json files.

    So, any WIP mods in the .yaml format, or unpacked backup files will need to be repacked with XNBnode first; or converted to the same .json format before this tool can use them.

    Not too big of a deal for new modders using this as their first XNB packer/unpacker. But, definitely a good heads up for those who have used XNBnode in the past, and may have .yamls lying around.

Other then those few things; it seems to work great! Much appreciated!

Core xnbcli file missing. Can't pack or unpack .xnb files.

The core xnbcli file (I'm guessing it's a binary) is missing from my download. I've downloaded the zip and cloned with git multiple times. Whenever I run unpack.sh from the terminal, this is the result:
$ dash unpack.sh
./unpack.sh: line 3: ./xnbcli: No such file or directory
Press enter to continue
I don't know what's wrong but I would be happy to help in any way I can. Attached is a picture of the main xnbcli folder shown graphically in nautilus.
I'm running Ubuntu 16.04. Thank you for the help!
Screenshot 2020-03-09 16:16:23

NeuroVoider

Hello, I tried to unpack NeuroVoider game file for PS Vita but I got an error: XnbError: Invalid file magic found, expecting "XNB", found "V�X" . Is there any solution?

Can you compress the xnb files even more?

I'm making a mod for Cryptark, a 2D space mech game made by Alientrap.

I used this xnbcli tool to unpack the .png files + a .json file that were inside. I edited the grapics by simply changing the color. Then I repacked it with the tool. It all works wonderfully and even shows up in the game successfully but I noticed something wierd.

Original .xnb file was 13kb
New repacked .xnb file is 62kb

Its almost six times as big.

I was wondering if there is a way to compress the filesize even more?

unpack.bat not working

Im on windows 10, I followed all the instructions but when i run unpack.bat the command prompt says this:
"C:\Users(my username)\Desktop\games\asset editors\xnbcli>xnbcli.exe pack ".\unpacked" ".\packed"
'xnbcli.exe' is not recognized as an internal or external command,
operable program or batch file.

C:\Users(my username)\Desktop\games\asset editors\xnbcli>echo Press enter to continue
Press enter to continue

C:\Users(my username)\Desktop\games\asset editors\xnbcli>pause
Press any key to continue . . ."

Pressing a key closes the command prompt without doing anything.

Error: Cannot find module '../build/Release/xxhash'

Goal

To unpack and repack Stardew Valley xnb assets offline via npm.

Problem

Error: Cannot find module '../build/Release/xxhash' when trying to run
npm run unpack
or
npm run pack

Attempted solution

  1. Installing xxhash via:
    npm install xxhash

Result:
Still receiving the same error.

System Info
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.18362 N/A Build 18362

Node JS Version
Node 8.2.0

Npm
5.3.0

CL error message:

C:\Users\John\Desktop\xnbcli-master\xnbcli-master>npm run unpack

> [email protected] unpack C:\Users\John\Desktop\xnbcli-master\xnbcli-master
> node ./xnbcli.js unpack ./packed ./unpacked

module.js:487
    throw err;
    ^

Error: Cannot find module '../build/Release/xxhash'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\John\Desktop\xnbcli-master\xnbcli-master\node_modules\lz4\lib\utils.js:4:11)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] unpack: `node ./xnbcli.js unpack ./packed ./unpacked`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] unpack 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\John\AppData\Roaming\npm-cache\_logs\2019-06-21T18_32_51_259Z-debug.log

Does it work with 1.6?

i got this error [ERROR] Filename: packed\Objects.xnb
XnbError: Non-implemented type found, cannot resolve type "StardewValley.GameData.Objects.ObjectData", "StardewValley.GameData.Objects.ObjectData, StardewValley.GameData, Version=1.6.3.24087, Culture=neutral, PublicKeyToken=null".
at simplifyType (C:\snapshot\xnbcli\app\Xnb\TypeReader.js:0:0)
at Array.map ()
at simplifyType (C:\snapshot\xnbcli\app\Xnb\TypeReader.js:0:0)
at Xnb.load (C:\snapshot\xnbcli\app\Xnb\index.js:0:0)
at processUnpack (C:\snapshot\xnbcli\xnbcli.js:0:0)
at Walker.walker.on (C:\snapshot\xnbcli\xnbcli.js:0:0)
at Walker.emit (events.js:198:13)
at Object.emitSingleEvents [as emitNodeType] (C:\snapshot\xnbcli\node_modules\walk\lib\node-type-emitter.js:58:13)
at Walker._wLstatHandler (C:\snapshot\xnbcli\node_modules\walk\lib\walk.js:88:19)
at C:\snapshot\xnbcli\node_modules\walk\lib\walk.js:106:12

1.0.5 xnbcli-windows-x64.zip is labeled 1.0.4 and indicates there is an update

At first I thought I had accidentally downloaded the wrong version, but I downloaded it from https://github.com/LeonBlade/xnbcli/releases/download/v1.0.5/xnbcli-windows-x64.zip and extracted it again and got the same result:

PS> .\xnbcli.exe --version
[INFO] xnbcli v1.0.5 is available! Visit https://github.com/LeonBlade/xnbcli/releases to get the latest release.
1.0.4

The Product version on the file is 10.15.3, and the File version is 10.15.3.0. But this is definitely the download for the Windows 64 bit 1.0.5 release.

DXT package doesn't work with newer versions of nodejs

I successfully got npm install to complete with the following changes (ie. switching from dxt to dxt-js and upgrading lz4):

diff --git a/app/Xnb/Readers/Texture2DReader.js b/app/Xnb/Readers/Texture2DReader.js
index 1756318..988189b 100644
--- a/app/Xnb/Readers/Texture2DReader.js
+++ b/app/Xnb/Readers/Texture2DReader.js
@@ -2,7 +2,7 @@ const BaseReader = require('./BaseReader');
 const BufferReader = require('../../BufferReader');
 const Int32Reader = require('./Int32Reader');
 const UInt32Reader = require('./UInt32Reader');
-const dxt = require('dxt');
+const dxt = require('dxt-js');
 const Log = require('../../Log');
 const XnbError = require('../../XnbError');
 
diff --git a/package-lock.json b/package-lock.json
index 3d32054..c8705a9 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
 {
   "name": "xnbcli",
-  "version": "1.0.3",
+  "version": "1.0.5",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
@@ -27,6 +27,20 @@
       "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
       "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4="
     },
+    "base64-js": {
+      "version": "1.3.1",
+      "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz",
+      "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g=="
+    },
+    "buffer": {
+      "version": "5.4.3",
+      "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz",
+      "integrity": "sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A==",
+      "requires": {
+        "base64-js": "^1.0.2",
+        "ieee754": "^1.1.4"
+      }
+    },
     "cacheable-request": {
       "version": "6.0.0",
       "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.0.0.tgz",
@@ -94,13 +108,10 @@
       "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",
       "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI="
     },
-    "dxt": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/dxt/-/dxt-1.0.1.tgz",
-      "integrity": "sha512-8X5KFe+ErroNXnMu6+a90nZlt+cmOQZpJGZ9Ca4ThaEooLscvw+72Ez3L4Itf9v1rq3tUPS1YP/Ybpb5kBtCYA==",
-      "requires": {
-        "nan": "^2.8.0"
-      }
+    "dxt-js": {
+      "version": "0.0.3",
+      "resolved": "https://registry.npmjs.org/dxt-js/-/dxt-js-0.0.3.tgz",
+      "integrity": "sha512-qNBx0i5/ICyNFO7rs5ZothChgfFD408dg/ZBBfWFXDy0xeDQ86t91QUZxj5WqeUzZQ/+PPtjTUC0w3mS+198jg=="
     },
     "end-of-stream": {
       "version": "1.4.1",
@@ -159,6 +170,11 @@
       "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz",
       "integrity": "sha512-TcIMG3qeVLgDr1TEd2XvHaTnMPwYQUQMIBLy+5pLSDKYFc7UIqj39w8EGzZkaxoLv/l2K8HaI0t5AVA+YYgUew=="
     },
+    "ieee754": {
+      "version": "1.1.13",
+      "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
+      "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg=="
+    },
     "json-buffer": {
       "version": "3.0.0",
       "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz",
@@ -178,13 +194,14 @@
       "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA=="
     },
     "lz4": {
-      "version": "0.6.0",
-      "resolved": "https://registry.npmjs.org/lz4/-/lz4-0.6.0.tgz",
-      "integrity": "sha512-J2ZqNFyNfW7f0kPRRmuXmn3toy0ZLmLJFxVyVDUGaNNvUqI3J+eiAVRmN4tAX/xUASFg3voCPNCCVK27HxtEkw==",
+      "version": "0.6.3",
+      "resolved": "https://registry.npmjs.org/lz4/-/lz4-0.6.3.tgz",
+      "integrity": "sha512-NEs7p58fnU69P6mGl1slL5I+FVhYIUXXfZRXNBIFvmTkEsHh+TMpO1BPcQREwFpThHNC5wa61d7vQdZ0zz9aUg==",
       "requires": {
-        "cuint": "^0.2.0",
-        "nan": "^2.0.9",
-        "xxhashjs": "^0.1.1"
+        "buffer": "^5.2.1",
+        "cuint": "^0.2.2",
+        "nan": "^2.13.2",
+        "xxhashjs": "^0.2.2"
       }
     },
     "mimic-response": {
@@ -206,9 +223,9 @@
       }
     },
     "nan": {
-      "version": "2.8.0",
-      "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz",
-      "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo="
+      "version": "2.14.0",
+      "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
+      "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg=="
     },
     "normalize-url": {
       "version": "3.3.0",
@@ -295,18 +312,11 @@
       "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
     },
     "xxhashjs": {
-      "version": "0.1.1",
-      "resolved": "https://registry.npmjs.org/xxhashjs/-/xxhashjs-0.1.1.tgz",
-      "integrity": "sha1-oDzhvjopRqHTH+zgwYly+L0uRk8=",
+      "version": "0.2.2",
+      "resolved": "https://registry.npmjs.org/xxhashjs/-/xxhashjs-0.2.2.tgz",
+      "integrity": "sha512-AkTuIuVTET12tpsVIQo+ZU6f/qDmKuRUcjaqR+OIvm+aCBsZ95i7UVY5WJ9TMsSaZ0DA2WxoZ4acu0sPH+OKAw==",
       "requires": {
         "cuint": "^0.2.2"
-      },
-      "dependencies": {
-        "cuint": {
-          "version": "0.2.2",
-          "resolved": "https://registry.npmjs.org/cuint/-/cuint-0.2.2.tgz",
-          "integrity": "sha1-QICG1AlVDCYxFVYZ6fp7ytw7mRs="
-        }
       }
     }
   }
diff --git a/package.json b/package.json
index f95cc4d..32a436f 100644
--- a/package.json
+++ b/package.json
@@ -15,9 +15,9 @@
     "chalk": "^1.1.3",
     "commander": "^2.19.0",
     "compare-versions": "^3.4.0",
-    "dxt": "^1.0.0",
+    "dxt-js": "^0.0.3",
     "got": "^9.6.0",
-    "lz4": "^0.6.0",
+    "lz4": "^0.6.3",
     "mkdirp": "^0.5.1",
     "pngjs": "^2.2.0",
     "walk": "^2.3.14"

[Solved!]Can't use xnbcli to unpack/pack

I use the lastest the version and when I open the command window it says:

[ERROR] Failed to search for a new update. Application should still function normally.
[ERROR] RequestError: getaddrinfo ENOENT raw.githubusercontent.com raw.githubusercontent.com:443

Can you help me with it? Thanks a lot!

Error after running unpack

XnbError: Non-implemented type found, cannot resolve type "StardewValley.GameData.Weapons.WeaponData", "StardewValley.GameData.Weapons.WeaponData, StardewValley.GameData, Version=1.6.4.24110, Culture=neutral, PublicKeyToken=null".
at simplifyType (C:\snapshot\xnbcli\app\Xnb\TypeReader.js:0:0)
at Array.map ()
at simplifyType (C:\snapshot\xnbcli\app\Xnb\TypeReader.js:0:0)
at Xnb.load (C:\snapshot\xnbcli\app\Xnb\index.js:0:0)
at processUnpack (C:\snapshot\xnbcli\xnbcli.js:0:0)
at Walker.walker.on (C:\snapshot\xnbcli\xnbcli.js:0:0)
at Walker.emit (events.js:198:13)
at Object.emitSingleEvents [as emitNodeType] (C:\snapshot\xnbcli\node_modules\walk\lib\node-type-emitter.js:58:13)
at Walker._wLstatHandler (C:\snapshot\xnbcli\node_modules\walk\lib\walk.js:88:19)
at C:\snapshot\xnbcli\node_modules\walk\lib\walk.js:106:12

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.