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

npm installation faild on Node.js v0.11.13 #4

Closed
pm5 opened this issue Sep 21, 2014 · 12 comments
Closed

npm installation faild on Node.js v0.11.13 #4

pm5 opened this issue Sep 21, 2014 · 12 comments

Comments

@pm5
Copy link

pm5 commented Sep 21, 2014

Installation on Node.js v0.10 works fine for us, but failed on v0.11.13. Not sure what went wrong.

npm WARN package.json node-htmlstrip-native-example@1.0.0 No description
npm WARN package.json node-htmlstrip-native-example@1.0.0 No repository field.
npm WARN package.json node-htmlstrip-native-example@1.0.0 No README data

> htmlstrip-native@0.0.2 install /Users/pm5/src/code/n/node-htmlstrip-native/node_modules/htmlstrip-native
> node-gyp rebuild

  CXX(target) Release/obj.target/htmlstrip/htmlstrip.o
../htmlstrip.cpp:166:31: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
Handle<Value> HtmlStrip(const Arguments& args) {
                              ^~~~~~~~~
                              v8::internal::Arguments
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:149:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../htmlstrip.cpp:167:17: error: calling a protected constructor of class 'v8::HandleScope'
    HandleScope scope;
                ^
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:845:13: note: declared protected here
  V8_INLINE HandleScope() {}
            ^
../htmlstrip.cpp:171:13: error: member access into incomplete type 'const v8::internal::Arguments'
    if (args.Length() >= 2) {
            ^
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:149:7: note: forward declaration of 'v8::internal::Arguments'
class Arguments;
      ^
../htmlstrip.cpp:173:14: error: type 'const v8::internal::Arguments' does not provide a subscript operator
                args[0].As<Object>()->GetIndexedPropertiesExternalArrayData());
                ~~~~^~
../htmlstrip.cpp:173:21: error: 'Object' does not refer to a value
                args[0].As<Object>()->GetIndexedPropertiesExternalArrayData());
                           ^
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:2176:17: note: declared here
class V8_EXPORT Object : public Value {
                ^
../htmlstrip.cpp:173:29: error: expected expression
                args[0].As<Object>()->GetIndexedPropertiesExternalArrayData());
                                   ^
../htmlstrip.cpp:174:20: error: type 'const v8::internal::Arguments' does not provide a subscript operator
                        inBufSize = args[1]->Uint32Value();
                                    ~~~~^~
../htmlstrip.cpp:180:16: error: no member named 'New' in 'v8::String'
                                                        String::New("HtmlStrip: Arguments must be a UTF-16 encoded Buffer, and length"))
                                                        ~~~~~~~~^
../htmlstrip.cpp:188:10: error: member access into incomplete type 'const v8::internal::Arguments'
                if(args.Length() >= 3){
                       ^
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:149:7: note: forward declaration of 'v8::internal::Arguments'
class Arguments;
      ^
../htmlstrip.cpp:189:32: error: type 'const v8::internal::Arguments' does not provide a subscript operator
      Local<Object> opts = args[2].As<Object>();
                           ~~~~^~
../htmlstrip.cpp:189:39: error: 'Object' does not refer to a value
      Local<Object> opts = args[2].As<Object>();
                                      ^
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:2176:17: note: declared here
class V8_EXPORT Object : public Value {
                ^
../htmlstrip.cpp:189:47: error: expected expression
      Local<Object> opts = args[2].As<Object>();
                                              ^
../htmlstrip.cpp:191:13: error: no matching member function for call to 'Has'
                        if(opts->Has(include_script_sym)){
                           ~~~~~~^~~
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:2207:8: note: candidate function not viable: no known conversion from 'Persistent<v8::String>' to 'Handle<v8::Value>' for 1st argument
  bool Has(Handle<Value> key);
       ^
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:2215:8: note: candidate function not viable: no known conversion from 'Persistent<v8::String>' to 'uint32_t' (aka 'unsigned int') for 1st argument
  bool Has(uint32_t index);
       ^
../htmlstrip.cpp:192:28: error: no matching member function for call to 'Get'
                                include_script = opts->Get(include_script_sym)->ToBoolean()->Value();
                                                 ~~~~~~^~~
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:2196:16: note: candidate function not viable: no known conversion from 'Persistent<v8::String>' to 'Handle<v8::Value>' for 1st argument
  Local<Value> Get(Handle<Value> key);
               ^
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:2198:16: note: candidate function not viable: no known conversion from 'Persistent<v8::String>' to 'uint32_t' (aka 'unsigned int') for 1st argument
  Local<Value> Get(uint32_t index);
               ^
../htmlstrip.cpp:195:13: error: no matching member function for call to 'Has'
                        if(opts->Has(include_style_sym)){
                           ~~~~~~^~~
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:2207:8: note: candidate function not viable: no known conversion from 'Persistent<v8::String>' to 'Handle<v8::Value>' for 1st argument
  bool Has(Handle<Value> key);
       ^
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:2215:8: note: candidate function not viable: no known conversion from 'Persistent<v8::String>' to 'uint32_t' (aka 'unsigned int') for 1st argument
  bool Has(uint32_t index);
       ^
../htmlstrip.cpp:196:27: error: no matching member function for call to 'Get'
                                include_style = opts->Get(include_style_sym)->ToBoolean()->Value();
                                                ~~~~~~^~~
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:2196:16: note: candidate function not viable: no known conversion from 'Persistent<v8::String>' to 'Handle<v8::Value>' for 1st argument
  Local<Value> Get(Handle<Value> key);
               ^
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:2198:16: note: candidate function not viable: no known conversion from 'Persistent<v8::String>' to 'uint32_t' (aka 'unsigned int') for 1st argument
  Local<Value> Get(uint32_t index);
               ^
../htmlstrip.cpp:199:13: error: no matching member function for call to 'Has'
                        if(opts->Has(compact_whitespace_sym)){
                           ~~~~~~^~~
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:2207:8: note: candidate function not viable: no known conversion from 'Persistent<v8::String>' to 'Handle<v8::Value>' for 1st argument
  bool Has(Handle<Value> key);
       ^
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:2215:8: note: candidate function not viable: no known conversion from 'Persistent<v8::String>' to 'uint32_t' (aka 'unsigned int') for 1st argument
  bool Has(uint32_t index);
       ^
../htmlstrip.cpp:200:32: error: no matching member function for call to 'Get'
                                compact_whitespace = opts->Get(compact_whitespace_sym)->ToBoolean()->Value();
                                                     ~~~~~~^~~
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:2196:16: note: candidate function not viable: no known conversion from 'Persistent<v8::String>' to 'Handle<v8::Value>' for 1st argument
  Local<Value> Get(Handle<Value> key);
               ^
/Users/pm5/.node-gyp/0.11.13/deps/v8/include/v8.h:2198:16: note: candidate function not viable: no known conversion from 'Persistent<v8::String>' to 'uint32_t' (aka 'unsigned int') for 1st argument
  Local<Value> Get(uint32_t index);
               ^
../htmlstrip.cpp:205:40: error: no member named 'GetCurrent' in 'v8::Context'
          Local<Object> global = v8::Context::GetCurrent()->Global();
                                 ~~~~~~~~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/htmlstrip/htmlstrip.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/pm5/.nvm/v0.11.13/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1046:12)
gyp ERR! System Darwin 13.3.0
gyp ERR! command "node" "/Users/pm5/.nvm/v0.11.13/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/pm5/src/code/n/node-htmlstrip-native/node_modules/htmlstrip-native
gyp ERR! node -v v0.11.13
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok 
npm ERR! htmlstrip-native@0.0.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the htmlstrip-native@0.0.2 install script.
npm ERR! This is most likely a problem with the htmlstrip-native package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls htmlstrip-native
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/Users/pm5/.nvm/v0.11.13/bin/npm" "install" "htmlstrip-native" "--save"
npm ERR! cwd /Users/pm5/src/code/n/node-htmlstrip-native
npm ERR! node -v v0.11.13
npm ERR! npm -v 1.4.27
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/pm5/src/code/n/node-htmlstrip-native/npm-debug.log
npm ERR! not ok code 0
@zaro
Copy link
Owner

zaro commented Oct 7, 2014

Maybe something of in the v8 API has changed, but I don't feel like finding out what untill, 0.12/1.0 is released. 0.11.X are development releases not stable.

@zaro
Copy link
Owner

zaro commented Dec 3, 2014

Just tried to build it under 0.11.14 .

The interface for C++ modules is rewritten, so the module needs to be rewritten also. Definitelly postponing this for a stable 0.12/1.0 release.

@notthetup
Copy link

👍 0.12 stable is out now. Is there a fix?

@zaro
Copy link
Owner

zaro commented Feb 16, 2015

I am working on the port, but it is still unstable..

@zaro
Copy link
Owner

zaro commented Feb 16, 2015

Ok it seem I hit a bug in node itself, I opened and issue nodejs/node-v0.x-archive#9227 , and until it is resolved there is no point releasing version that supports v0.12.x as it will just crash randomly most of the time.

@zaro
Copy link
Owner

zaro commented Feb 16, 2015

All the changes are in master, so feel free to test yourself . Once things are stable, I will make a npm release.

@pm5
Copy link
Author

pm5 commented Feb 22, 2015

Installation went fine, but calling html_strip() yield the following error:

#
# Fatal error in ../deps/v8/src/lookup.cc, line 47
# CHECK(!root->IsNull()) failed
#

==== C stack trace ===============================

 1: ??
 2: ??
 3: ??
 4: ??
 5: ??
 6: ??
 7: ??
 8: ??
 9: ??
10: ??
Illegal instruction: 4

@zaro
Copy link
Owner

zaro commented Feb 22, 2015

ok, can you provide more detail ?

Like, OS , node version( I guess its 0.12.0 ), and a simple test case if
possible..

On Sun, Feb 22, 2015 at 6:44 AM, Pomin Wu notifications@github.com wrote:

Installation went fine, but calling html_strip() yield the following error:

Fatal error in ../deps/v8/src/lookup.cc, line 47

CHECK(!root->IsNull()) failed

==== C stack trace ===============================

1: ??
2: ??
3: ??
4: ??
5: ??
6: ??
7: ??
8: ??
9: ??
10: ??
Illegal instruction: 4


Reply to this email directly or view it on GitHub
#4 (comment)
.

@pm5
Copy link
Author

pm5 commented Feb 23, 2015

node v0.12.0 on OS X 10.9.5 with

$ c++ -v
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

Installed with

$ npm i zaro/node-htmlstrip-native

Then ran

"use strict"

var htmlstrip = require('htmlstrip-native');
var html = '<style>b {color: red;}</style>' +
           ' Yey, <b> No more, tags</b>' +
           '<script>document.write("Hello from Javascript")</script>';

console.log(htmlstrip.html_strip(html));
console.log(htmlstrip.html_strip(html, {
  include_script: false,
  include_style: false,
  compact_whitespace: true
}));

Only the above error showed up.

Tested the same thing with node v0.10.36, the script ran correctly.

@zaro
Copy link
Owner

zaro commented Feb 23, 2015

Thanks, that was a good catch :) It seems null function arguments work differently in v0.12 and I didn't that at all.

Fixed it in master, reinstall and it should be fine now.

@zaro
Copy link
Owner

zaro commented Feb 26, 2015

Just published 0.1.0 which supports both v0.12, v0.10 and iojs.

@zaro zaro closed this as completed Feb 26, 2015
@pm5
Copy link
Author

pm5 commented Mar 1, 2015

woot! thanks :)

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

3 participants