无法运行第一个结构应用程序

时间:2017-09-17 07:33:50

标签: node.js hyperledger-fabric hyperledger

当我使用official Fabric document提供的以下说明在织物样本中运行第一个结构应用程序时:

npm install

它显示:

npm WARN deprecated crypto@0.0.3: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead

> pkcs11js@1.0.9 install /home/ubuntu/go/src/github.com/hyperledger/fabric-samples/fabcar/node_modules/pkcs11js
> npm run build


> pkcs11js@1.0.9 build /home/ubuntu/go/src/github.com/hyperledger/fabric-samples/fabcar/node_modules/pkcs11js
> node-gyp configure build

make: Entering directory '/home/ubuntu/go/src/github.com/hyperledger/fabric-samples/fabcar/node_modules/pkcs11js/build'
  CXX(target) Release/obj.target/pkcs11/src/main.o
  CXX(target) Release/obj.target/pkcs11/src/dl.o
  CXX(target) Release/obj.target/pkcs11/src/const.o
  CXX(target) Release/obj.target/pkcs11/src/pkcs11/error.o
  CXX(target) Release/obj.target/pkcs11/src/pkcs11/v8_convert.o
  CXX(target) Release/obj.target/pkcs11/src/pkcs11/template.o
  CXX(target) Release/obj.target/pkcs11/src/pkcs11/mech.o
../src/pkcs11/mech.cpp: In member function ‘void Mechanism::Free()’:
../src/pkcs11/mech.cpp:121:15: warning: deleting ‘void*’ is undefined [-Wdelete-incomplete]
   delete(param);
               ^
  CXX(target) Release/obj.target/pkcs11/src/pkcs11/param.o
  CXX(target) Release/obj.target/pkcs11/src/pkcs11/param_aes.o
  CXX(target) Release/obj.target/pkcs11/src/pkcs11/param_rsa.o
  CXX(target) Release/obj.target/pkcs11/src/pkcs11/param_ecdh.o
  CXX(target) Release/obj.target/pkcs11/src/pkcs11/pkcs11.o
  CXX(target) Release/obj.target/pkcs11/src/async.o
  CXX(target) Release/obj.target/pkcs11/src/node.o
  SOLINK_MODULE(target) Release/obj.target/pkcs11.node
  COPY Release/pkcs11.node
make: Leaving directory '/home/ubuntu/go/src/github.com/hyperledger/fabric-samples/fabcar/node_modules/pkcs11js/build'

> grpc@1.6.0 install /home/ubuntu/go/src/github.com/hyperledger/fabric-samples/fabcar/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

[grpc] Success: "/home/ubuntu/go/src/github.com/hyperledger/fabric-samples/fabcar/node_modules/grpc/src/node/extension_binary/node-v46-linux-x64/grpc_node.node" is installed via remote
(omitting )
npm WARN fabcar@1.0.0 No repository field.

然后我运行命令:node query.js,发生错误。

module.js:471
    throw err;
    ^

Error: Cannot find module '/home/ubuntu/go/src/github.com/hyperledger/fabric-samples/fabcar/node_modules/grpc/src/node/extension_binary/node-v48-linux-x64/grpc_node.node'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/ubuntu/go/src/github.com/hyperledger/fabric-samples/fabcar/node_modules/grpc/src/node/src/grpc_extension.js:30:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

我在ubuntu 16.04上通过VMware软件使用节点v6.9.5和npm v3.10.10进行了上述操作。 请帮助,thx。

1 个答案:

答案 0 :(得分:0)

你可以运行

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

安装grpc模块以避免错误。