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 install' and 'npm start' fail #1

Open
traumschule opened this issue Oct 24, 2018 · 6 comments
Open

'npm install' and 'npm start' fail #1

traumschule opened this issue Oct 24, 2018 · 6 comments

Comments

@traumschule
Copy link

Hi!

I tried to use this project however there are issues.

nvm instead of npm -g

In #nodejs i was told it's better to install nvm as user. did that.

npm install

Fails with

7099 warn tbb-manual-image-creator@0.0.1 No repository field.
7100 verbose stack Error: segfault-handler@1.0.1 install: `node-gyp rebuild`
7100 verbose stack Exit status 1
7100 verbose stack     at EventEmitter.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/index.js:283:16)
7100 verbose stack     at emitTwo (events.js:126:13)
7100 verbose stack     at EventEmitter.emit (events.js:214:7)
7100 verbose stack     at ChildProcess.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
7100 verbose stack     at emitTwo (events.js:126:13)
7100 verbose stack     at ChildProcess.emit (events.js:214:7)
7100 verbose stack     at maybeClose (internal/child_process.js:925:16)
7100 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
7101 verbose pkgid segfault-handler@1.0.1
7102 verbose cwd /home/user/tor/manual/tbb-manual-image-creator
7103 verbose Linux 4.18.0-1-686
7104 verbose argv "/usr/bin/node" "/usr/bin/npm" "install"
7105 verbose node v8.11.2
7106 verbose npm  v5.8.0
7107 error code ELIFECYCLE
7108 error errno 1
7109 error segfault-handler@1.0.1 install: `node-gyp rebuild`
7109 error Exit status 1

So i fixed that:

$ git diff
diff --git a/package.json b/package.json
index 6a4f3a3..d45f6e8 100644
--- a/package.json
+++ b/package.json
@@ -2,6 +2,7 @@
   "name": "tbb-manual-image-creator",
   "version": "0.0.1",
   "description": "make tbb manual in many locales",
+  "repository": "https://github.com/arthuredelstein/tbb-manual-image-creator",
   "main": "index.js",
   "scripts": {
     "start": "node index.js",
@@ -16,6 +17,7 @@
     "iohook": "^0.2.0",
     "jsdom": "^12.0.0",
     "mkdirp-promise": "^5.0.1",
+    "n": "^2.1.12",
     "opn": "^5.3.0",
     "request": "^2.87.0",
     "request-promise-native": "^1.0.5"

Next error is

gyp: Call to 'node -e "require('nan')"' returned exit status 0 while in binding.gyp. while trying to load binding.gyp                                                                                 
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:349:16)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.18.0-1-686
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/user/tor/manual/tbb-manual-image-creator/node_modules/segfault-handler                                                                                                
gyp ERR! node -v v8.11.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! segfault-handler@1.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1

Still trying to get over that.

npm start

$ npm start

> tbb-manual-image-creator@0.0.1 start /media/user/traumschule/tor/manual/tbb-manual-image-creator
> node index.js

module.js:549
    throw err;
    ^

Error: Cannot find module 'opn'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/media/user/traumschule/tor/manual/tbb-manual-image-creator/index.js:2:13)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tbb-manual-image-creator@0.0.1 start: `node index.js`
npm ERR! Exit status 1

Someone in the channel tried it as well:

$ npm start

> tbb-manual-image-creator@0.0.1 start /opt/local/dev/tbb-manual-image-creator
> node index.js

Download https://ftp.mozilla.org/pub/firefox/releases/60.2.2esr/linux-x86_64/xpi/
downloading https://ftp.mozilla.org/pub/firefox/releases/60.2.2esr/linux-x86_64/xpi/ach.xpi
internal/streams/legacy.js:59
      throw er; // Unhandled stream error in pipe.
      ^

Error: ENOENT: no such file or directory, open '../tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default/extensions/langpack-ach@firefox.mozilla.org.xpi'
PID 39742 received SIGSEGV for address: 0x20
0   segfault-handler.node               0x00000001027db408 _ZL16segfault_handleriP9__siginfoPv + 312
1   libsystem_platform.dylib            0x00007fff7e217f5a _sigtramp + 26
2   ???                                 0x0000000000000000 0x0 + 0
3   iohook.node                         0x00000001027ec012 process_key_pressed + 226
4   iohook.node                         0x00000001027ebc4a hook_event_proc + 2090
5   SkyLight                            0x00007fff77da82f5 processDecodedEventRef + 112
6   SkyLight                            0x00007fff77da7b68 processEventTapData + 569
7   SkyLight                            0x00007fff77d5d813 _XPostEventTapData + 278
8   SkyLight                            0x00007fff77da78d1 eventTapMessageHandler + 132
9   CoreFoundation                      0x00007fff560d1546 __CFMachPortPerform + 310
10  CoreFoundation                      0x00007fff560d13f9 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
11  CoreFoundation                      0x00007fff560d1345 __CFRunLoopDoSource1 + 533
12  CoreFoundation                      0x00007fff560c8f00 __CFRunLoopRun + 2848
13  CoreFoundation                      0x00007fff560c8153 CFRunLoopRunSpecific + 483
14  CoreFoundation                      0x00007fff56106be3 CFRunLoopRun + 99
15  iohook.node                         0x00000001027ecd95 hook_run + 1749
16  iohook.node                         0x00000001027e815e _Z16hook_thread_procPv + 14
17  libsystem_pthread.dylib             0x00007fff7e221661 _pthread_body + 340
18  libsystem_pthread.dylib             0x00007fff7e22150d _pthread_body + 0
19  libsystem_pthread.dylib             0x00007fff7e220bf9 thread_start + 13
Segmentation fault: 11

This would be easy to fix but i could not get so far yet.

@traumschule
Copy link
Author

It was using the OS's npm (5.8.0), so i ran nvm i --lts again. It recommended

$ nvm use --delete-prefix v8.12.0
Now using node v8.12.0 (npm v6.4.1)

And i gave npm install another try:

gyp: Call to 'node -e "require('nan')"' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/user/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.18.0-1-686
gyp ERR! command "/home/user/.nvm/versions/node/v8.12.0/bin/node" "/media/user/traumschule/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/user/tor/manual/tbb-manual-image-creator/node_modules/segfault-handler
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! segfault-handler@1.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the segfault-handler@1.0.1 install script.

dead end.

@arthuredelstein
Copy link
Owner

Hm, I'm not sure why you'r running into this. Did you follow the installation steps in the README? You'll need to install some apt packages as well.

@arthuredelstein
Copy link
Owner

arthuredelstein commented Oct 24, 2018

Also, your version of node is maybe too old. Please see the README for how I installed the latest nodejs version.

@traumschule
Copy link
Author

Gave it another try and got rid of above error by not using torsocks.
Using nvm because i was told so in #nodejs to not mess with the npm as root. Below trace shows what happens when i follow the README with system's npm.

$ node --version
v8.12.0

iohook fails to install for nvm's and system npm, maybe it's not available for 32bit?

$ which npm
/home/user/.nvm/versions/node/v8.12.0/bin/npm
$ npm i npm && npm i
+ npm@6.4.1                                                                                                                                                                                           
removed 246 packages, updated 1 package and audited 5020 packages in 129.97s
found 0 vulnerabilities                                                                                                                                                                               

npm WARN deprecated flavored-path@0.0.8: use rwd                                                                                                                                                      
npm WARN deprecated meta-path@0.0.8: use rwd                                                                                                                                                          

> segfault-handler@1.0.1 install /homr/user/tbb-manual-image-creator/node_modules/segfault-handler                                                                            
> node-gyp rebuild
                                                                                                                                                                                                      
make: Entering directory '/homr/user/tbb-manual-image-creator/node_modules/segfault-handler/build'                                                                            
  CXX(target) Release/obj.target/segfault-handler/src/segfault-handler.o                                                                                                                              
In file included from /home/user/.node-gyp/8.12.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,                                                                                                                                                             
                 from ../src/segfault-handler.cpp:2:                                                                                                                                                  
/home/user/.node-gyp/8.12.0/include/node/v8.h: In static member function ‘static void v8::V8::SetAllowCodeGenerationFromStringsCallback(v8::DeprecatedAllowCodeGenerationFromStringsCallback)’:
/home/user/.node-gyp/8.12.0/include/node/v8.h:10311:19: warning: cast between incompatible function types from ‘v8::DeprecatedAllowCodeGenerationFromStringsCallback’ {aka ‘bool (*)(v8::Local<v
8::Context>)’} to ‘v8::FreshNewAllowCodeGenerationFromStringsCallback’ {aka ‘bool (*)(v8::Local<v8::Context>, v8::Local<v8::String>)’} [-Wcast-function-type]                                         
           callback));
                   ^                                                                                                                                                                                  
/home/user/.node-gyp/8.12.0/include/node/v8.h: In static member function ‘static void v8::V8::RemoveGCPrologueCallback(v8::GCCallback)’:
/home/user/.node-gyp/8.12.0/include/node/v8.h:10356:53: warning: cast between incompatible function types from ‘v8::GCCallback’ {aka ‘void (*)(v8::GCType, v8::GCCallbackFlags)’} to ‘v8::Isolat
e::GCCallback’ {aka ‘void (*)(v8::Isolate*, v8::GCType, v8::GCCallbackFlags)’} [-Wcast-function-type]                                                                                                 
       reinterpret_cast<Isolate::GCCallback>(callback));                                                                                                                                              
                                                     ^
/home/user/.node-gyp/8.12.0/include/node/v8.h: In static member function ‘static void v8::V8::RemoveGCEpilogueCallback(v8::GCCallback)’:                                                       
/home/user/.node-gyp/8.12.0/include/node/v8.h:10363:53: warning: cast between incompatible function types from ‘v8::GCCallback’ {aka ‘void (*)(v8::GCType, v8::GCCallbackFlags)’} to ‘v8::Isolat
e::GCCallback’ {aka ‘void (*)(v8::Isolate*, v8::GCType, v8::GCCallbackFlags)’} [-Wcast-function-type]
       reinterpret_cast<Isolate::GCCallback>(callback));
                                                     ^
In file included from ../src/segfault-handler.cpp:2:                                                                                                                                                  
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2208:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-fun
ction-type]
     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
                                                              ^
In file included from ../../nan/nan.h:52,
                 from ../src/segfault-handler.cpp:2:
../src/segfault-handler.cpp: At global scope:                                                                                                                                                         
/home/user/.node-gyp/8.12.0/include/node/node.h:505:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::O
bject>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]                                                                  
       (node::addon_register_func) (regfunc),                          \
                                           ^
/home/user/.node-gyp/8.12.0/include/node/node.h:536:3: note: in expansion of macro ‘NODE_MODULE_X’                                                                                             
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/segfault-handler.cpp:339:3: note: in expansion of macro ‘NODE_MODULE’
   NODE_MODULE(segfault_handler, init)                                                                                                                                                                
   ^~~~~~~~~~~                                                                                                                                                                                        
In file included from /home/user/.node-gyp/8.12.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,                                                                                                                                                             
                 from ../src/segfault-handler.cpp:2:
/home/user/.node-gyp/8.12.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/home/user/.node-gyp/8.12.0/include/node/node_object_wrap.h:85:78:   required from here                                                                                                        
/home/user/.node-gyp/8.12.0/include/node/v8.h:9307:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCa
llbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);                                                                                                                                          
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/.node-gyp/8.12.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::Obj
ectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:66:61:   required from here                                                                                                                                               
/home/user/.node-gyp/8.12.0/include/node/v8.h:9307:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCal
lbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]                                                                               
  SOLINK_MODULE(target) Release/obj.target/segfault-handler.node
  COPY Release/segfault-handler.node
make: Leaving directory '/homr/user/tbb-manual-image-creator/node_modules/segfault-handler/build'                                                                             

> iohook@0.2.1 install /homr/user/tbb-manual-image-creator/node_modules/iohook                                                                                                
> node install.js

Downloading prebuild for platform: iohook-v0.2.1-node-v57-linux-ia32
Prebuild for current platform (iohook-v0.2.1-node-v57-linux-ia32) not found!
Try to compile for your platform:
# cd node_modules/iohook;
# npm run compile


/homr/user/tbb-manual-image-creator/node_modules/iohook/install.js:14
  throw err;
  ^
Prebuild for current platform (iohook-v0.2.1-node-v57-linux-ia32) not found!
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iohook@0.2.1 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the iohook@0.2.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Replaced iohook with node-iohook 0.0.3 but it seems too fresh:

Scanning dependencies of target prepare_iuhook
./bootstrap.sh: 3: [: Linux: unexpected operator
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'config'.
libtoolize: copying file 'config/ltmain.sh'
.ibtoolize:   error: AC_CONFIG_MACRO_DIRS([m4]) conflicts with ACLOCAL_AMFLAGS=-I m4
autoreconf: libtoolize failed with exit status: 1
make[2]: *** [CMakeFiles/prepare_iuhook.dir/build.make:57: CMakeFiles/prepare_iuhook] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/prepare_iuhook.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
ERR! OMG Process terminated: 2
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-iohook@0.0.3 install: `cmake-js compile`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-iohook@0.0.3 install script.

Still trying, will create PR to update package.json when it finally works.

@arthuredelstein
Copy link
Owner

I'm using node 11, so that might be an issue.

@traumschule
Copy link
Author

Ok, i can try to update node. Upstream report: wilix-team/iohook#112

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

2 participants