addaleax / lzma-native

Node.js interface to the native liblzma compression library (.xz file format, among others)
MIT License
105 stars 37 forks source link

npm install fails for 3.0.6 #54

Closed mrmacete closed 6 years ago

mrmacete commented 6 years ago

Configuration

OS: macOS 10.13.3 node: v9.9.0 npm: 5.6.0

Steps to reproduce

npm init
npm install lzma-native

> lzma-native@3.0.6 install /Users/ftamagni/src/test-lzma/node_modules/lzma-native
> node-pre-gyp install --fallback-to-build && node node_modules/rimraf/bin.js build

node-pre-gyp ERR! Pre-built binaries not installable for lzma-native@3.0.6 and node@9.9.0 (node-v59 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error ENOTDIR: Cannot cd into '/Users/ftamagni/src/test-lzma/node_modules/lzma-native/binding-v3.0.6-node-v59-darwin-x64'

Then it starts to build from source, but at the end:

  COPY /Users/ftamagni/src/test-lzma/node_modules/lzma-native/binding-v3.0.6-node-v59-darwin-x64/lzma_native.node
mkdir: /Users/ftamagni/src/test-lzma/node_modules/lzma-native/binding-v3.0.6-node-v59-darwin-x64/: Not a directory
make: *** [/Users/ftamagni/src/test-lzma/node_modules/lzma-native/binding-v3.0.6-node-v59-darwin-x64/lzma_native.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2

The contents of node_modules/lzma-native directory at the beginning of installation is like:

$ ls -al node_modules/lzma-native/
total 176
drwxr-xr-x  20 ftamagni  staff    640 Mar 26 10:46 .
drwxr-xr-x   5 ftamagni  staff    160 Mar 26 10:46 ..
-rw-r--r--   1 ftamagni  staff   5642 Oct 26  1985 CHANGELOG.md
-rw-r--r--   1 ftamagni  staff   1088 Oct 26  1985 LICENSE
-rw-r--r--   1 ftamagni  staff  23728 Oct 26  1985 README.md
-rw-r--r--   1 ftamagni  staff   6652 Oct 26  1985 README.md.xz
drwxr-xr-x   3 ftamagni  staff     96 Mar 26 10:46 bin
drwxr-xr-x   3 ftamagni  staff     96 Mar 26 10:46 binding-v3.0.4-node-v61-linux-x64
-rw-r--r--   1 ftamagni  staff   6652 Mar 26 01:48 binding-v3.0.6-node-v59-darwin-x64
drwxr-xr-x   3 ftamagni  staff     96 Mar 26 10:46 binding-v3.0.6-node-v59-linux-x64
drwxr-xr-x   3 ftamagni  staff     96 Mar 26 10:46 binding-v3.0.6-node-v62-linux-x64
-rw-r--r--   1 ftamagni  staff   3203 Oct 26  1985 binding.gyp
-rwxr-xr-x   1 ftamagni  staff    253 Oct 26  1985 cflags.sh
drwxr-xr-x   9 ftamagni  staff    288 Mar 26 10:46 deps
-rw-r--r--   1 ftamagni  staff  13996 Oct 26  1985 index.js
-rwxr-xr-x   1 ftamagni  staff     52 Oct 26  1985 liblzma-build.sh
-rwxr-xr-x   1 ftamagni  staff    443 Oct 26  1985 liblzma-config.sh
drwxr-xr-x  68 ftamagni  staff   2176 Mar 26 10:46 node_modules
-rw-r--r--   1 ftamagni  staff   2352 Mar 26 10:46 package.json
drwxr-xr-x  11 ftamagni  staff    352 Mar 26 10:46 src

where binding-v3.0.6-node-v59-darwin-x64 (the interesting one) in fact is not a directory.

Note: npm install lzma-native@3.0.5 instead works.

addaleax commented 6 years ago

That’s really odd… Can you do an npm install with --verbose and/or share the npm debug log for the failed build?

I assume you already tried removing all of node_modules and installing from scratch?

mrmacete commented 6 years ago

yep tried that, also the snippets pasted above are from a new project from scratch.

Here's the debug log.

2018-03-26T11_10_34_199Z-debug.log

mrmacete commented 6 years ago

also, it seems package.json is still on 3.0.5 ?

addaleax commented 6 years ago

where binding-v3.0.6-node-v59-darwin-x64 (the interesting one) in fact is not a directory.

Can you share the contents? That might give a clue as to why this is happening.

yep tried that, also the snippets pasted above are from a new project from scratch.

I’m surprised, maybe the other folders accidentally got published with my npm publish too? They really shouldn’t be there… I’ll assume that’s the case and publish 3.0.7 as soon as I can.

also, it seems package.json is still on 3.0.5 ?

That’s odd. :/

It might really be good to have the output from npm install --verbose, the debug log doesn’t include node-pre-gyp’s part…

mrmacete commented 6 years ago

here's the full output of npm install --verbose: verbose_install.out.txt

and the binding-v3.0.6-node-v59-darwin-x64 is:

$ file node_modules/lzma-native/binding-v3.0.6-node-v59-darwin-x64
node_modules/lzma-native/binding-v3.0.6-node-v59-darwin-x64: XZ compressed data

github doesn't allow me to paste it here, but the contents are:

$ 7z l node_modules/lzma-native/binding-v3.0.6-node-v59-darwin-x64

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=utf8,Utf16=on,HugeFiles=on,64 bits,8 CPUs x64)

Scanning the drive for archives:
1 file, 6652 bytes (7 KiB)

Listing archive: node_modules/lzma-native/binding-v3.0.6-node-v59-darwin-x64

--
Path = node_modules/lzma-native/binding-v3.0.6-node-v59-darwin-x64
Type = xz
Physical Size = 6652
Method = LZMA2:23 CRC32
Streams = 1
Blocks = 1

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
                    .....        23728         6652  binding-v3.0
------------------- ----- ------------ ------------  ------------------------
                                 23728         6652  1 files
addaleax commented 6 years ago

@mrmacete I’ve published lzma-native@3.0.7 with the node-pre-gyp dependency reverted to the old version, could you try this again?

mrmacete commented 6 years ago

yep! i confirm 3.0.7 is working! thanks!

addaleax commented 6 years ago

Cool, let me know if you run into any more problems! :)