Got a problem with installing duniter/ucoin from my own forked/cloned repo

It’s actually ucoin 0.14.2, the last stable release. All I did was change the name and logo.
For some reason I can’t install it anymore and am running into problem I’ve had before, but can’t remember how I resolved it.

[npm@ArkOS_Dev ~]$ npm install -g duniter
npm WARN deprecated MD5@1.3.0: deprecated, use lowercase 'md5@2.x' from now on
/var/lib/npm/.npm-global/bin/duniter -> /var/lib/npm/.npm-global/lib/node_modules/duniter/bin/duniter

> naclb@1.0.0 install /var/lib/npm/.npm-global/lib/node_modules/duniter/node_modules/naclb
> node-gyp rebuild

make: Entering directory '/var/lib/npm/.npm-global/lib/node_modules/duniter/node_modules/naclb/build'
  CXX(target) Release/obj.target/nacl/nacl.o
In file included from ../nacl.cc:2:0:
../node_modules/nan/nan.h:602:20: error: variable or field ‘AddGCEpilogueCallback’ declared void
       v8::Isolate::GCEpilogueCallback callback
                    ^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:602:7: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCEpilogueCallback callback
       ^~
../node_modules/nan/nan.h:603:18: error: expected primary-expression before ‘gc_type_filter’
     , v8::GCType gc_type_filter = v8::kGCTypeAll) {
                  ^~~~~~~~~~~~~~
../node_modules/nan/nan.h:608:20: error: variable or field ‘RemoveGCEpilogueCallback’ declared void
       v8::Isolate::GCEpilogueCallback callback) {
                    ^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:608:7: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCEpilogueCallback callback) {
       ^~
../node_modules/nan/nan.h:613:20: error: variable or field ‘AddGCPrologueCallback’ declared void
       v8::Isolate::GCPrologueCallback callback
                    ^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:613:7: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCPrologueCallback callback
       ^~
../node_modules/nan/nan.h:614:18: error: expected primary-expression before ‘gc_type_filter’
     , v8::GCType gc_type_filter = v8::kGCTypeAll) {
                  ^~~~~~~~~~~~~~
../node_modules/nan/nan.h:619:20: error: variable or field ‘RemoveGCPrologueCallback’ declared void
       v8::Isolate::GCPrologueCallback callback) {
                    ^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:619:7: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCPrologueCallback callback) {
       ^~
nacl.target.mk:91: recipe for target 'Release/obj.target/nacl/nacl.o' failed
make: *** [Release/obj.target/nacl/nacl.o] Error 1
make: Leaving directory '/var/lib/npm/.npm-global/lib/node_modules/duniter/node_modules/naclb/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Linux 4.5.4-1-ARCH
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/lib/npm/.npm-global/lib/node_modules/duniter/node_modules/naclb
gyp ERR! node -v v6.1.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 
/var/lib/npm/.npm-global/lib
└── (empty)

npm ERR! Linux 4.5.4-1-ARCH
npm ERR! argv "/usr/bin/node" "/usr/sbin/npm" "install" "-g" "duniter"
npm ERR! node v6.1.0
npm ERR! npm  v3.9.0
npm ERR! code ELIFECYCLE

npm ERR! naclb@1.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the naclb@1.0.0 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the naclb 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 information on how to open an issue for this project with:
npm ERR!     npm bugs naclb
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls naclb
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /var/lib/npm/npm-debug.log
npm ERR! code 1

When I try rebuilding node-gyp:

[npm@ArkOS_Dev ~]$ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.3.1
gyp info using node@6.1.0 | linux | x64
gyp info spawn /usr/sbin/python2
gyp info spawn args [ '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/var/lib/npm/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/var/lib/npm/.node-gyp/6.1.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/var/lib/npm/.node-gyp/6.1.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=/var/lib/npm',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp: binding.gyp not found (cwd: /var/lib/npm) 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/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Linux 4.5.4-1-ARCH
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/lib/npm
gyp ERR! node -v v6.1.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 

I already noticed the big flaw. The gyp_dir is in /usr/lib, but it’s supposed to be in /var/lib/npm.

Actually, duniter is using a virtuall npm install now. Do you use npm 5.0 ?

The stable release 0.14.2 is to be forgotten now. Please use Installation tutorial which will be easier and is up-to-date.

I like stable versions and being able to download them via the npm package manager.
Should I rename my fork from duniter to let’s say… barchan in order to avoid confusion?

Well yes, and I will publish the latest stable on it (the Duniter one).

Hmmm… that makes it more confusing and pointless for me to fork it.
I thought you abandoned npmjs. Have you changed your mind?
The installation tutorial does not mention npmjs.

We have to update this tutorial to include several possibilities of installation. Why not having npmjs in it, after all!

1 Like

She’s all yours again.

Actually, duniter is using a virtuall npm install now. Do you use npm 5.0 ?

I prefer doing it via package managers, due to the structure of the personal web server OS I use and that I have written a plugin for it.

Problem by the way turns out to be the naclb package being outdated somehow. From version 1.2.9 on it installs again.

Thank you, I’ve just published it again. So the current version is 0.20.0a64, you should be able to insall it using:

git clone https://github.com/duniter/duniter.git
cd duniter
npm install

Node 5.9.1+ is required.

Then you should be able to use it with:

export DEV_MODE=true
./duniter.sh webwait

Then the UI should be available at http://localhost:9220

If you want to join our netwrok, once on the UI you can connect to the existing currency at cgeek.fr and port 9330.

Why not have the option to install it like this: npm install -g duniter?
That’s the way package managers are meant to work.

Right now I’ve tried it and it doesn’t install because an naclb file can’t find <nan.h>.
So the probably only reason it doesn’t install is that one package can’t find another package.

Yes, that’s a NPM issue. If you understand what is happening and how we could solve this, I would be glad to hear your solution.

Things have started to break on installation since NPM3.

You know, when said that I thought that you were putting me up with an impossible mission, with no way of actually testing the installation and no knowledge of what any of the packages do.

I think I got it though:

naclb/binding.gyp

-- "node_modules/nan"
++ '<!(node -e "require(\'nan\')")'
1 Like

I will test that for sure :slight_smile: the best would be that you actually make a pull request on the naclb repository. Because this is your contribution, I prefer you to be the commiter.

How will I know if it works?

I only got this solution by looking at one project with the same issue, that was resolved by re-adding “include_dirs” in binding.gyp and two other projects with this code.

I don’t want to break your projects.

[Edit]
I guess Appveyor takes care of that. It’s asking for credentials.

npm WARN naclb@1.3.1 No repository field.
npm WARN naclb@1.3.1 No license field.
node node_modules\node-pre-gyp\bin\node-pre-gyp info
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.6.23
node-pre-gyp info using node@5.8.0 | win32 | x64
node-pre-gyp ERR! info error 
node-pre-gyp ERR! stack CredentialsError: Missing credentials in config
node-pre-gyp ERR! stack     at Object.parse (native)
node-pre-gyp ERR! stack     at C:\projects\naclb\node_modules\aws-sdk\lib\metadata_service.js:115:38
node-pre-gyp ERR! stack     at IncomingMessage.<anonymous> (C:\projects\naclb\node_modules\aws-sdk\lib\metadata_service.js:74:45)
node-pre-gyp ERR! stack     at emitNone (events.js:85:20)
node-pre-gyp ERR! stack     at IncomingMessage.emit (events.js:179:7)
node-pre-gyp ERR! stack     at endReadableNT (_stream_readable.js:913:12)
node-pre-gyp ERR! stack     at _combinedTickCallback (node.js:377:13)
node-pre-gyp ERR! stack     at process._tickDomainCallback (node.js:425:11)
node-pre-gyp ERR! System Windows_NT 6.3.9600
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\projects\\naclb\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "info"
node-pre-gyp ERR! cwd C:\projects\naclb
node-pre-gyp ERR! node -v v5.8.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.23
node-pre-gyp ERR! not ok 
Missing credentials in config
Command exited with code 1

[/Edit]

You should remove this line from appveyor.yml for your code to work and pass, I guess.

Isn’t that an important line?

No, it was most probably a debugging line for deployment testing. Which explains why you have the “no credentials” error, due to how the pull request environment is made on AppVeyor.

Iimagine if the credentials were OK, then you could hack our releases by modifying the appveyor file!

edit: I think your fix is the right way, would you accept to make an identical fix on wotb module? We have the exact same issue.

edit2: nevermind, I’ve done it :slight_smile:

Awww… I was just about to do it.

Duniter on npmjs is still unchanged.