h2non / nar

node.js application archive - create self-contained binary like executable applications that are ready to ship and run
MIT License
428 stars 23 forks source link

update archiver to more recent version - new Buffer() issues on node 6 #136

Closed thesebas closed 8 years ago

thesebas commented 8 years ago

when trying to create archive nar create got this error

Creating archive...
buffer.js:106
      throw new Error(
      ^

Error: If encoding is specified then the first argument must be a string
    at new Buffer (buffer.js:106:13)
    at Readable.<anonymous> (***\AppData\Roaming\npm\node_modules\nar\node_modules\archiver\lib\util\index.js:32:15)
    at emitNone (events.js:91:20)
    at Readable.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:926:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

seems that node >=5.6 has some changes with creating buffers and it seems to be fixed in recent versions of archiverjs/node-archiver

h2non commented 8 years ago

Will fix it soon. Thanks

aledbf commented 8 years ago

@h2non any update on this? I tried updating archiver to "^1.0.0" and this error disappears but I see this error running the test suite:

  1) CLI get "before all" hook:
     TypeError: Path must be a string. Received null
      at assertPath (path.js:7:11)
      at Object.dirname (path.js:1324:5)
      at Object.getArgs (/Users/aledbf/github/nar/node_modules/stubby/src/console/cli.js:141:38)
      at setupStartOptions (/Users/aledbf/github/nar/node_modules/stubby/src/main.js:60:18)
      at Stubby.start (/Users/aledbf/github/nar/node_modules/stubby/src/main.js:92:12)
      at module.exports.server (/Users/aledbf/github/nar/test/lib/helper.js:94:12)
      at Context.<anonymous> (/Users/aledbf/gimake: *** [mocha] Error 8
h2non commented 8 years ago

I'll work on this sometime during the weekend. Sorry for the delay.

algesten commented 8 years ago

@h2non don't push yourself. it's not like we're paying you. thanks for this excellent package!

h2non commented 8 years ago

Fixed in nar@0.3.37. Feel free to update to latest version: npm u -g nar

aledbf commented 8 years ago

@h2non I see this error running extract, run or list: Error: The given path is not a file

$ nar -V
0.3.37
$ node -v
v6.1.0
h2non commented 8 years ago

Will try to reproduce the issue.

h2non commented 8 years ago

@aledbf cannot reproduce the issue. Just tried to create multiple nar executable containers and then running or extracting them. No problems. I'm running the same versions as you are.

If you can share some package.json as example or the commands you're running, that would be helpful to me.

aledbf commented 8 years ago

@h2non I found the issue: the name of the package cannot be private (@myorg/demo). Removing @myorg solved the issue.

h2non commented 8 years ago

Then I can provide a solution for that case.

SimenB commented 8 years ago

@h2non Any news on this? Can't really rename the package...

To reproduce you can use the linked PR

h2non commented 8 years ago

See: https://github.com/h2non/nar/issues/140 nar still do not support private package names (but it can procees private dependencies).

It should be simple to fix. I will try to fix it soon, or feel free to send a PR.

SimenB commented 8 years ago

I'll provide a PR asap