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

Issues running conv-rest-api #21

Open
Hackman777 opened this issue Jun 10, 2021 · 0 comments
Open

Issues running conv-rest-api #21

Hackman777 opened this issue Jun 10, 2021 · 0 comments

Comments

@Hackman777
Copy link

Hackman777 commented Jun 10, 2021

Hello,

I am trying to get a new Fabric 2.2 installation set up and going and we've run into some issues trying to run conv-rest-api.

We currently have a Fabric 1.0 ledger that we need to upgrade. We thought it would be easier to just set up 2.2 from scratch and then repopulate our ledger. So, we installed the latest version of Convector and I followed the tutorial for configuring our new project, "sr2". All went well until I got past step where I created the api.json to expose my smart contract methods. I went to create the API with conv-rest-api and I got errors.

The command I executed was: conv-rest-api generate api -c sr2 -p sr2 -f ./sr2.config.json

NOTE: I had to add a new parameter, "-p sr2", not listed in the tutorial but conv-rest-api threw an error when run without it.

I got the following errors:
[error log]
in generateApi in command.ts chaincode=sr2
in generateApi in command.ts chaincodeConfigFile=./sr2.config.json
generating stub..
removing previously generated app (packages/sr2-app)
generating stub folder
/usr/lib/node_modules/@worldsibu/convector-rest-api/templates_scripts/generate_api_template.bash: line 5: yo: command not found
Exiting packages folder...
/home/hyper2/sr2
Compiling new app...
lerna notice cli v3.13.4
lerna info filter [ 'sr2-app' ]
lerna ERR! EFILTER No packages remain after filtering [ 'sr2-app' ]
Adding dependencies...
lerna notice cli v3.13.4
lerna info filter [ 'sr2-app' ]
lerna ERR! EFILTER No packages remain after filtering [ 'sr2-app' ]
lerna notice cli v3.13.4
lerna info filter [ 'sr2-app' ]
lerna ERR! EFILTER No packages remain after filtering [ 'sr2-app' ]
lerna notice cli v3.13.4
lerna info filter [ 'sr2-app' ]
lerna ERR! EFILTER No packages remain after filtering [ 'sr2-app' ]
lerna notice cli v3.13.4
lerna info filter [ 'sr2-app' ]
lerna ERR! EFILTER No packages remain after filtering [ 'sr2-app' ]
lerna notice cli v3.13.4
lerna info filter [ 'sr2-app' ]
lerna ERR! EFILTER No packages remain after filtering [ 'sr2-app' ]
lerna notice cli v3.13.4
lerna info filter [ 'sr2-app' ]
lerna ERR! EFILTER No packages remain after filtering [ 'sr2-app' ]
Bootstrapping...
lerna notice cli v3.13.4
lerna info Bootstrapping 1 package
lerna info Installing external dependencies
lerna info hoist Installing hoisted dependencies into root
lerna info hoist Finished bootstrapping root
lerna info hoist Pruning hoisted dependencies
lerna info hoist Finished pruning hoisted dependencies
lerna info Symlinking packages and binaries
lerna info lifecycle [email protected]~prepare: [email protected]

[email protected] prepare /home/hyper2/sr2/packages/sr2-cc
npm run build

[email protected] build
npm run clean && tsc

[email protected] clean
rimraf dist client

lerna success Bootstrapped 1 package
Adding chaincode(s)...
lerna notice cli v3.13.4
lerna info filter [ 'sr2-app' ]
lerna ERR! EFILTER No packages remain after filtering [ 'sr2-app' ]
/usr/lib/node_modules/@worldsibu/convector-rest-api/dist/models/env.smart-model.js:51
for (var _i = 0, _a = apiConfig.environments; _i < _a.length; _i++) {
^

TypeError: Cannot read property 'length' of undefined
at EnvModel.get [as selectedApiConfig] (/usr/lib/node_modules/@worldsibu/convector-rest-api/dist/models/env.smart-model.js:51:67)
at EnvModel. (/usr/lib/node_modules/@worldsibu/convector-rest-api/dist/models/env.smart-model.js:25:50)
at step (/usr/lib/node_modules/@worldsibu/convector-rest-api/node_modules/tslib/tslib.js:141:27)
at Object.next (/usr/lib/node_modules/@worldsibu/convector-rest-api/node_modules/tslib/tslib.js:122:57)
at /usr/lib/node_modules/@worldsibu/convector-rest-api/node_modules/tslib/tslib.js:115:75
at new Promise ()
at Object.__awaiter (/usr/lib/node_modules/@worldsibu/convector-rest-api/node_modules/tslib/tslib.js:111:16)
at EnvModel.save (/usr/lib/node_modules/@worldsibu/convector-rest-api/dist/models/env.smart-model.js:21:24)
at ApiGenerator. (/usr/lib/node_modules/@worldsibu/convector-rest-api/dist/apiGenerator.js:57:49)
at step (/usr/lib/node_modules/@worldsibu/convector-rest-api/node_modules/tslib/tslib.js:141:27)
[end of error log]

First off, I assume that I may need to install Yeoman but figured that it probably should have installed automatically as a dependency so I ran "npm i" from my project root. This generated another set of error messages:
[error log]
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '^10.15.3 || ^12.15.0', npm: '^6.4.1' },
npm WARN EBADENGINE current: { node: 'v16.3.0', npm: '7.15.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '^10.15.3 || ^12.15.0', npm: ' ^6.4.1' },
npm WARN EBADENGINE current: { node: 'v16.3.0', npm: '7.15.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '^8.17.0', npm: '^6.13.4' },
npm WARN EBADENGINE current: { node: 'v16.3.0', npm: '7.15.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '^8.9.0', npm: '^5.5.1' },
npm WARN EBADENGINE current: { node: 'v16.3.0', npm: '7.15.1' }
npm WARN EBADENGINE }

[email protected] install
npm-run-all -s lerna:install

[email protected] lerna:install
lerna bootstrap

lerna notice cli v3.13.4
lerna info Bootstrapping 1 package
lerna info Installing external dependencies
lerna info hoist Installing hoisted dependencies into root
lerna info hoist Finished bootstrapping root
lerna info hoist Pruning hoisted dependencies
lerna info hoist Finished pruning hoisted dependencies
lerna info Symlinking packages and binaries
lerna info lifecycle [email protected]~prepare: [email protected]

[email protected] prepare /home/hyper2/sr2/packages/sr2-cc
npm run build

[email protected] build
npm run clean && tsc

[email protected] clean
rimraf dist client

lerna success Bootstrapped 1 package

removed 24 packages, and audited 1150 packages in 24s
[end of error log]

I currently have Node v16.3.0 and npm v7.15.1 installed.

Any ideas or suggestions? TIA

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

1 participant