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

Error in node v6: TypeError: haystack.get is not a function #13

Closed
binarykitchen opened this issue May 2, 2016 · 16 comments
Closed

Error in node v6: TypeError: haystack.get is not a function #13

binarykitchen opened this issue May 2, 2016 · 16 comments

Comments

@binarykitchen
Copy link

This says all. Happens only on node v6:

/home/michael-heuberger/binarykitchen/code/videomail.io/node_modules/bufferjs/indexOf.js:16
        if (haystack.get(i+j) !== needle.get(j)) {
                     ^

TypeError: haystack.get is not a function
    at indexOf (/home/michael-heuberger/binarykitchen/code/videomail.io/node_modules/bufferjs/indexOf.js:16:22)
    at Buffer.exports.indexOf (/home/michael-heuberger/binarykitchen/code/videomail.io/node_modules/bufferstream/lib/fn.js:16:14)
    at BufferStream.split (/home/michael-heuberger/binarykitchen/code/videomail.io/node_modules/bufferstream/lib/buffer-stream.js:30:24)
    at BufferStream.write (/home/michael-heuberger/binarykitchen/code/videomail.io/node_modules/bufferstream/lib/buffer-stream.js:210:17)
    at BufferStream.write (/home/michael-heuberger/binarykitchen/code/videomail.io/node_modules/bufferstream/lib/buffer-stream.js:3:61)
    at IncomingMessage.ondata (_stream_readable.js:555:20)
    at emitOne (events.js:96:13)
    at IncomingMessage.emit (events.js:188:7)
    at IncomingMessage.Readable.read (_stream_readable.js:387:10)
    at flow (_stream_readable.js:764:26)

npm ERR! Linux 4.2.0-35-generic
npm ERR! argv "/home/michael-heuberger/.nvm/versions/node/v6.0.0/bin/node" "/home/michael-heuberger/.nvm/versions/node/v6.0.0/bin/npm" "rebuild"
npm ERR! node v6.0.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! unicode@0.6.1 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR! 
@antonky
Copy link

antonky commented May 6, 2016

Can confirm +1

@bookercodes
Copy link
Collaborator

I only get this error on Windows.

@binarykitchen Are you on Windows?

@antonky
Copy link

antonky commented May 6, 2016

@alexbooker looks like he's on Linux

bookercodes pushed a commit to base16-builder/base16-builder that referenced this issue May 6, 2016
The "slug" module has a transitive dependency called "bufferjs".
"bufferjs" stopped working when Node 6 removed the Buffer.get method
[1]. This broke all modules that depend on "bufferjs" in environments
running Node 6. I sent a pull request [2] to fix "bufferjs" but I'm not
hopeful it'll get merged any time soon. What's more, even my pull
request *does* get merged, the "slug" module hasn't been updated in many
months.

Closes #105.

[1] coolaj86/node-bufferjs#13
[2] coolaj86/node-bufferjs#14
@binarykitchen
Copy link
Author

me on windoze? no way lol ... yup, linux it is

@bookercodes
Copy link
Collaborator

It's weird that I only experience this on Windows

@antonky
Copy link

antonky commented May 8, 2016

@alexbooker perhaps you need to try from a clean installation?

@robframpton
Copy link

I'm getting the same error in a travis-ci test, just for Node 6.x.

https://travis-ci.org/liferay/generator-liferay-theme/jobs/126265971

@pazoozooCH
Copy link

+1 Also getting this error on Windows:

C:\prog\java\IdeaProjects\me\node_modules\bufferjs\indexOf.js:16
        if (haystack.get(i+j) !== needle.get(j)) {
                     ^

TypeError: haystack.get is not a function
    at indexOf (C:\prog\java\IdeaProjects\me\node_modules\bufferjs\indexOf.js:16:22)

My system:

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Martin\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "unicode"
npm ERR! node v6.2.0
npm ERR! npm  v3.5.3
npm ERR! code ELIFECYCLE

Any workaround for this?

@antonky
Copy link

antonky commented Jun 1, 2016

@pazoozooCH, there are two open PR's that can fix this, but it seems like @coolaj86 doesn't maintain this package anymore so it's unlikely that it will be fixed.

@pazoozooCH
Copy link

@nakamin , thanks, we found a solution with another dependency, so it's not that urgent for me anymore 😄

@coolaj86
Copy link
Owner

coolaj86 commented Jun 1, 2016

Sorry, I don't mean to be a bum, just busy with other work these days.

I just have repo access to @alexbooker because he hit me up on twitter, so feel free to ask him for access if you need to fix anything once he pulls in and publishes his patch.

@antonky
Copy link

antonky commented Jun 1, 2016

@coolaj86 Sorry if came off rude or mean... wasn't the intention 😄. Giving repo access to @alexbooker is definitley a great idea! I'm sure he'll take care of all the issues.

@anyong
Copy link

anyong commented Jun 3, 2016

Also on linux, FWIW. Actually installed fine on Windows...

@bookercodes
Copy link
Collaborator

@anyong Yeah, I see no reason why this problem would be limited to a platform -- I suspect you aren't running Node 6 on Windows.


I just bumped the version number in 72c7763 and have updated the bufferjs npm module.

If someone can confirm that the problem is solved, that'd be great, thank you!

@robframpton
Copy link

I can confirm that I'm no longer getting the error in my travis-ci tests. Thanks @alexbooker

@bookercodes
Copy link
Collaborator

bookercodes commented Jun 4, 2016

That is terrific! Thanks, @Robert-Frampton.

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

No branches or pull requests

7 participants