Skip to content
This repository was archived by the owner on Jun 18, 2021. It is now read-only.
This repository was archived by the owner on Jun 18, 2021. It is now read-only.

Error while running npm install -g composer-cli #112

Closed

Description

@dkangala

Hello,

Following error is getting generated while running "npm install -g composer-cli" - please clarify how to get this issue resolved:

F:\open_source\blockchain>npm install -g composer-cli
C:\Users\Aspire E1-572\AppData\Roaming\npm\composer -> C:\Users\Aspire E1-572\AppData\Roaming\npm\node_modules\composer-
cli\cli.js

> dtrace-provider@0.8.7 install C:\Users\Aspire E1-572\AppData\Roaming\npm\node_modules\composer-cli\node_modules\dtrace
-provider
> node-gyp rebuild || node suppress-error.js


C:\Users\Aspire E1-572\AppData\Roaming\npm\node_modules\composer-cli\node_modules\dtrace-provider>if not defined npm_con
fig_node_gyp (node "C:\Users\Aspire E1-572\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\nod
e-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.

> node-report@2.2.1 install C:\Users\Aspire E1-572\AppData\Roaming\npm\node_modules\composer-cli\node_modules\node-repor
t
> node-gyp rebuild


C:\Users\Aspire E1-572\AppData\Roaming\npm\node_modules\composer-cli\node_modules\node-report>if not defined npm_config_
node_gyp (node "C:\Users\Aspire E1-572\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gy
p\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  node_report.cc
  module.cc
  utilities.cc
C:\Program Files (x86)\Windows Kits\8.1\Include\um\dbghelp.h(1544): warning C4091: 'typedef ': ignored on left of '' wh
en no variable is declared (compiling source file ..\src\node_report.cc) [C:\Users\Aspire E1-572\AppData\Roaming\npm\no
de_modules\composer-cli\node_modules\node-report\build\api.vcxproj]
C:\Program Files (x86)\Windows Kits\8.1\Include\um\dbghelp.h(3190): warning C4091: 'typedef ': ignored on left of '' wh
en no variable is declared (compiling source file ..\src\node_report.cc) [C:\Users\Aspire E1-572\AppData\Roaming\npm\no
de_modules\composer-cli\node_modules\node-report\build\api.vcxproj]
  win_delay_load_hook.c
C:\Users\Aspire E1-572\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34): error
C2373: '__pfnDliNotifyHook2': redefinition; different type modifiers [C:\Users\Aspire E1-572\AppData\Roaming\npm\node_m
odules\composer-cli\node_modules\node-report\build\api.vcxproj]
  D:\open_source\MicrosoftVisualStudio14\VC\include\delayimp.h(134): note: see declaration of '__pfnDliNotifyHook2'
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Aspire E1-572\AppData\Roaming\npm\node_modules\npm\node_modules\node
-gyp\lib\build.js:276:23)
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 Windows_NT 6.3.9600
gyp ERR! command "D:\\open_source\\nodejs\\node.exe" "C:\\Users\\Aspire E1-572\\AppData\\Roaming\\npm\\node_modules\\npm
\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Aspire E1-572\AppData\Roaming\npm\node_modules\composer-cli\node_modules\node-report
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.3.0
gyp ERR! not ok
C:\Users\Aspire E1-572\AppData\Roaming\npm
`-- (empty)

npm WARN optional Skipping failed optional dependency /composer-cli/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.4
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "D:\\open_source\\nodejs\\node.exe" "C:\\Users\\Aspire E1-572\\AppData\\Roaming\\npm\\node_modules\\npm\\b
in\\npm-cli.js" "install" "-g" "composer-cli"
npm ERR! node v8.11.1
npm ERR! npm  v3.8.0
npm ERR! code ELIFECYCLE

npm ERR! node-report@2.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-report@2.2.1 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 node-report 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 node-report
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-report
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     F:\open_source\blockchain\npm-debug.log
npm ERR! code 1

Activity

  1. richardlau commented on Jul 1, 2018

    @richardlau
    Member

    I think you're running into nodejs/node-gyp#952 -- It looks like you are running on an older version of npm and node-gyp in C:\Users\Aspire E1-572\AppData\Roaming\npm\. Node.js v8.11.1 should have come with npm 5.6.0.

  2. Abhik1998 commented on Oct 3, 2018

    @Abhik1998

    m facing same issue

  3. eddiehartman commented on Oct 8, 2018

    @eddiehartman

    I re-installed npm using npm:

    sudo npm install -g npm
    

    and that solved it for me.

  4. adasari commented on Dec 15, 2018

    @adasari

    upgrading npm version didnt resolve the issue. I am currently using node 8.14.0 and npm 6.5.0
    Do you have any workaround ? Thanks.

  5. Abhik1998 commented on Dec 15, 2018

    @Abhik1998

    Hii I have resolved the problem . Actually let me know of the version
    If there is a mismatch in the version of node-gyp and your OS (or JDK version). then this happens . Is it like you are running it on windows?

  6. sandra-calvo commented on Jan 5, 2019

    @sandra-calvo

    Hi,

    I have the same problem.
    I am currently using Node version v10.15.0 and npm version 6.5.0.

  7. seasiainfotech commented on Jan 8, 2019

    @seasiainfotech

    Hii I have resolved the problem . Actually let me know of the version
    If there is a mismatch in the version of node-gyp and your OS (or JDK version). then this happens . Is it like you are running it on windows?

    Yes installing on windows, please suggest a solution.

  8. Abhik1998 commented on Jan 8, 2019

    @Abhik1998

    For Linux:
    run
    sudo apt-get update
    If the problem exists then (same for windows)
    npm config get prefix
    This will give your npm path.

    It can give something like: /usr/local/share/npm

    Write the following command on your .bashrc or .bash_profile file or simply run the command on your terminal:

    export PATH="/usr/local/share/npm/bin:$PATH"
    But if it doesnot work then you shoud consider reinstalling npm

  9. amaka98 commented on Feb 9, 2019

    @amaka98

    Hello, I have the same problem. I am using a Mac: node version: v8.15.0, npm version: 6.7.0

    I appreciate any help.

  10. mhdawson commented on Feb 11, 2019

    @mhdawson
    Member

    @richardlau do you have any suggestions?

  11. richardlau commented on Feb 12, 2019

    @richardlau
    Member

    @amaka98 Can you post your npm install log, possibly in a new issue? I don't think you can be seeing the same problem as the original post (...\win_delay_load_hook.c(34): error C2373: '__pfnDliNotifyHook2': redefinition; different type modifiers) on a Mac as that error is Windows specific and related to an outdated version of node-gyp.

  12. praveensharmajpr commented on Feb 22, 2019

    @praveensharmajpr

    Where te file path for .bashrc or .bash_profile file in Windows 10 machine

  13. praveensharmajpr commented on Feb 24, 2019

    @praveensharmajpr

    any suggestion to resolve this issue on windows 10 machine.

  14. richardlau commented on Feb 24, 2019

    @richardlau
    Member

    @praveensharmajpr What is your actual issue? Can you post your npm install log?

  15. praveensharmajpr commented on Feb 24, 2019

    @praveensharmajpr

    i am trying to setup hyperledger composer on my windows 10 machine. i am getting error as reported in issue. here is the log file

    C:\Users\prave\AppData\Roaming\npm\node_modules\composer-cli\node_modules\node-report>if not defined npm_config_node_gyp (node "C:\Users\prave\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\prave\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
    Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
    node_report.cc
    module.cc
    utilities.cc
    win_delay_load_hook.cc
    c:\users\prave\appdata\roaming\npm\node_modules\composer-cli\node_modules\node-report\src\utilities.cc(421): error C203
    9: 'due': is not a member of 'uv_timer_s' [C:\Users\prave\AppData\Roaming\npm\node_modules\composer-cli\node_modules\no
    de-report\build\api.vcxproj]
    c:\users\prave.node-gyp\10.15.1\include\node\uv.h(800): note: see declaration of 'uv_timer_s'
    gyp ERR! build error
    gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1
    gyp ERR! stack at ChildProcess.onExit (C:\Users\prave\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
    gyp ERR! stack at ChildProcess.emit (events.js:189:13)
    gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
    gyp ERR! System Windows_NT 10.0.17134
    gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\prave\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
    gyp ERR! cwd C:\Users\prave\AppData\Roaming\npm\node_modules\composer-cli\node_modules\node-report
    gyp ERR! node -v v10.15.1
    gyp ERR! node-gyp -v v3.8.0
    gyp ERR! not ok
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\composer-cli\node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! node-report@2.2.1 install: node-gyp rebuild
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the node-report@2.2.1 install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\prave\AppData\Roaming\npm-cache_logs\2019-02-24T15_22_32_747Z-debug.log

  16. 13 remaining items

  17. insafachour commented on Nov 4, 2019

    @insafachour

    @richardlau how to upgrade node-report?

  18. richardlau commented on Nov 4, 2019

    @richardlau
    Member

    You'll need to get the composer-cli package to update the version of node-report they require.

  19. yatashashank commented on Dec 9, 2019

    @yatashashank

    Seems like composer-cli is deprecated
    https://www.npmjs.com/package/composer-cli

  20. yatashashank commented on Dec 9, 2019

    @yatashashank

    I tried with node 10.16.3 but still see the same error.

  21. richardlau commented on Dec 9, 2019

    @richardlau
    Member

    @yatashashank What error? There's two different errors reported in this issue -- the original error C2373: '__pfnDliNotifyHook2': redefinition; which looks to be an out of date node-gyp issue and the error C2039: 'due': is not a member of 'uv_timer_s' issue which is an out of date version of node-report.

  22. yatashashank commented on Dec 9, 2019

    @yatashashank

    The gyp Build Error.
    #112 (comment). I was looking to install composer-cli but seems like it's deprecated. Tried downing node from 12 to 10 but still no luck. Is there any update on this issue @richardlau ??

  23. richardlau commented on Dec 9, 2019

    @richardlau
    Member

    @yatashashank what version of node-gyp is reported in your error log?

  24. deepcrysp commented on Dec 9, 2019

    @deepcrysp

    Deepaks-MacBook-Air:~ deepak$ npm i composer-cli
    npm WARN deprecated composer-cli@0.20.9: Hyperledger Composer has been deprecated. Please see the README for more details: https://github.com/hyperledger/composer/blob/master/README.md
    npm WARN deprecated composer-documentation@0.20.9: Hyperledger Composer has been deprecated. Please see the README for more details: https://github.com/hyperledger/composer/blob/master/README.md
    npm WARN deprecated composer-wallet-filesystem@0.20.9: Hyperledger Composer has been deprecated. Please see the README for more details: https://github.com/hyperledger/composer/blob/master/README.md
    npm WARN deprecated composer-report@0.20.9: Hyperledger Composer has been deprecated. Please see the README for more details: https://github.com/hyperledger/composer/blob/master/README.md
    npm WARN deprecated composer-wallet-inmemory@0.20.9: Hyperledger Composer has been deprecated. Please see the README for more details: https://github.com/hyperledger/composer/blob/master/README.md
    npm WARN deprecated composer-client@0.20.9: Hyperledger Composer has been deprecated. Please see the README for more details: https://github.com/hyperledger/composer/blob/master/README.md
    npm WARN deprecated composer-admin@0.20.9: Hyperledger Composer has been deprecated. Please see the README for more details: https://github.com/hyperledger/composer/blob/master/README.md
    npm WARN deprecated composer-common@0.20.9: Hyperledger Composer has been deprecated. Please see the README for more details: https://github.com/hyperledger/composer/blob/master/README.md
    npm WARN deprecated composer-connector-proxy@0.20.9: Hyperledger Composer has been deprecated. Please see the README for more details: https://github.com/hyperledger/composer/blob/master/README.md
    npm WARN deprecated composer-connector-hlfv1@0.20.9: Hyperledger Composer has been deprecated. Please see the README for more details: https://github.com/hyperledger/composer/blob/master/README.md
    npm WARN deprecated core-js@2.3.0: core-js@<3.0 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
    npm WARN deprecated hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
    npm WARN deprecated json3@3.3.2: Please use the native JSON object instead of JSON 3
    npm WARN deprecated fsevents@1.2.9: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size

    node-report@2.2.1 install /Users/deepak/node_modules/composer-report/node_modules/node-report
    node-gyp rebuild

    CXX(target) Release/obj.target/api/src/node_report.o
    ../src/node_report.cc:512:52: error: too few arguments to function call, expected 2, have 1
    PrintStackFrame(out, isolate, stack->GetFrame(i), i, nullptr);
    ~~~~~~~~~~~~~~~ ^
    /Users/deepak/Library/Caches/node-gyp/12.13.1/include/node/v8.h:1890:3: note: 'GetFrame' declared here
    Local GetFrame(Isolate* isolate, uint32_t index) const;
    ^
    ../src/node_report.cc:548:54: error: too few arguments to function call, expected 2, have 1
    PrintStackFrame(out, isolate, stack->GetFrame(i), i, samples[i]);
    ~~~~~~~~~~~~~~~ ^
    /Users/deepak/Library/Caches/node-gyp/12.13.1/include/node/v8.h:1890:3: note: 'GetFrame' declared here
    Local GetFrame(Isolate* isolate, uint32_t index) const;
    ^
    ../src/node_report.cc:550:54: error: too few arguments to function call, expected 2, have 1
    PrintStackFrame(out, isolate, stack->GetFrame(i), i, nullptr);
    ~~~~~~~~~~~~~~~ ^
    /Users/deepak/Library/Caches/node-gyp/12.13.1/include/node/v8.h:1890:3: note: 'GetFrame' declared here
    Local GetFrame(Isolate* isolate, uint32_t index) const;
    ^
    3 errors generated.
    make: *** [Release/obj.target/api/src/node_report.o] Error 1
    gyp ERR! build error
    gyp ERR! stack Error: make failed with exit code: 2
    gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
    gyp ERR! stack at ChildProcess.emit (events.js:210:5)
    gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
    gyp ERR! System Darwin 18.6.0
    gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /Users/deepak/node_modules/composer-report/node_modules/node-report
    gyp ERR! node -v v12.13.1
    gyp ERR! node-gyp -v v5.0.5
    gyp ERR! not ok
    npm WARN notsup Unsupported engine for fabric-ca-client@1.2.1: wanted: {"node":"^8.9.0","npm":"^5.5.1"} (current: {"node":"12.13.1","npm":"6.12.1"})
    npm WARN notsup Not compatible with your version of node/npm: fabric-ca-client@1.2.1
    npm WARN notsup Unsupported engine for fabric-client@1.2.1: wanted: {"node":"^8.9.0","npm":"^5.5.1"} (current: {"node":"12.13.1","npm":"6.12.1"})
    npm WARN notsup Not compatible with your version of node/npm: fabric-client@1.2.1
    npm WARN deepak No description
    npm WARN deepak No repository field.
    npm WARN deepak No license field.

    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! node-report@2.2.1 install: node-gyp rebuild
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the node-report@2.2.1 install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR! /Users/deepak/.npm/_logs/2019-12-09T16_46_28_362Z-debug.log
    Deepaks-MacBook-Air:~ deepak$

  25. richardlau commented on Dec 9, 2019

    @richardlau
    Member

    @deepcrysp I already responded to your error log in #112 (comment)

  26. deepcrysp commented on Dec 9, 2019

    @deepcrysp

    I have installed node-report 2.2.4 but its still taking node-report 2.2.1 ..

  27. yatashashank commented on Dec 9, 2019

    @yatashashank

    With node 12
    gyp ERR! node -v v12.13.0
    gyp ERR! node-gyp -v v5.0.5

    With node 10
    gyp ERR! node -v v10.16.3
    gyp ERR! node-gyp -v v3.8.0
    @richardlau

  28. richardlau commented on Dec 9, 2019

    @richardlau
    Member

    @deepcrysp @yatashashank Okay it looks like the problem is with composer-cli -- they've fixed the version of node-report in their package.json to 2.2.1 (instead of using semver ranges to allow newer versions): https://github.com/hyperledger/composer/blob/06ac7a75090eb552752b9c0526b9dabb7a69f65d/packages/composer-cli/package.json#L57 and the errors you're seeing were fixed in node-report 2.2.4.

    I suggest you submit a pull request to composer-cli (it's deprecated but they say "if you wish to submit code changes via pull requests, these will be merged.") to update the version of node-report it is depending on. Or switch to Hyperledger Fabric instead of the deprecated Hyperledger Composer.

  29. insafachour commented on Dec 16, 2019

    @insafachour

    Hello i steel have the error composer-cli is not installed.
    Please any help

  30. richardlau commented on Dec 16, 2019

    @richardlau
    Member

    @insafachour Your options are to either to try to get https://github.com/hyperledger/composer to update their dependency on an outdated version of node-report or switch to the non-deprecated Hyperledger Fabric. There's nothing else we can do here in node-report as the errors have already been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions