Closed SeinopSys closed 3 years ago
I just tried to do a fresh install again and the necessary files appeared, I have no idea what causes this but looks like it was a temporary issue.
1. `npm init --yes` 2. `npm install node-7z-archive` 3. `node_modules\.bin\createArchive pkg.zip package.json`
Instead of creating the archive
pkg.zip
an error message is displayed:C:\Users\username\folder>node_modules\.bin\createArchive pkg.zip package.json Creating/adding... CreateArchive failed using `7z`, retying with `7za`. --- error: Error: spawn C:\Users\username\folder\node_modules\node-7z-archive\binaries\win32\7za.exe ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19) at onErrorNT (internal/child_process.js:467:16) at processTicksAndRejections (internal/process/task_queues.js:82:21) { errno: -4058, code: 'ENOENT', syscall: 'spawn C:\\Users\\username\\folder\\node_modules\\node-7z-archive\\binaries\\win32\\7za.exe', path: 'C:\\Users\\username\\folder\\node_modules\\node-7z-archive\\binaries\\win32\\7za.exe', spawnargs: [ 'a', 'pkg.zip', 'package.json', '-ssc', '-y', '-bb2' ] }
Inspecting the installed package folder, it seem the binaries folder has an additional layer of nesting which is not accounted for: ... ... ...
The
7za.exe
file is executed asbinaries\win32\7za.exe
but the location on disk is actuallybinaries\win32\other32\7za.exe
.
It could haved happened for a couple of reasons.
You might want to install package globally, those scripts in '.bin' folder expects itself to be executed in that fashion.
They was tested that way only, not from current node module directory as you have it executed. Thereafter just createArchive pkg.zip package.json.
The folder layout is correct. Some files are stored that way depending on system platform installed onto.
I just attempted to use this package on Windows 10 version 20H2 (build 19042.1237) 64-bit, with Node.js v14.17.3 and npm v7.24.0, and it seems the downloaded binaries are not in the expected location.
To reproduce, run the following commands in an empty directory (
C:\Users\username\folder
is used as an example)npm init --yes
npm install node-7z-archive
node_modules\.bin\createArchive pkg.zip package.json
Instead of creating the archive
pkg.zip
an error message is displayed:Inspecting the installed package folder, it seem the binaries folder has an additional layer of nesting which is not accounted for:
The
7za.exe
file is executed asbinaries\win32\7za.exe
but the location on disk is actuallybinaries\win32\other32\7za.exe
.