worldsibu / convector-example-fabcar

Convector version of Fabcar official Fabric-Samples codebase
Apache License 2.0
5 stars 9 forks source link

npm install failed #5

Open jackyjqcheung opened 5 years ago

jackyjqcheung commented 5 years ago

Hi, I git clone this example and run "npm install" and it fails and asks for "chai" so I install the chai as follows

npm install --save-dev @types/chai

then I run "npm install " again, but it still fails. Here is the error log:

lerna info Symlinking packages and binaries lerna info lifecycle car-cc@0.1.0~prepare: car-cc@0.1.0

car-cc@0.1.0 prepare /home/osboxes/fabric/convector-example-fabcar/packages/car-cc npm run build

car-cc@0.1.0 build /home/osboxes/fabric/convector-example-fabcar/packages/car-cc npm run clean && npm run client:generate && tsc

car-cc@0.1.0 clean /home/osboxes/fabric/convector-example-fabcar/packages/car-cc rimraf dist client

car-cc@0.1.0 client:generate /home/osboxes/fabric/convector-example-fabcar/packages/car-cc generate-controller-interface -c CarController

../../node_modules/@types/chai/index.d.ts(121,9): error TS8020: JSDoc types can only be used inside documentation comments. ../../node_modules/@types/chai/index.d.ts(122,9): error TS8020: JSDoc types can only be used inside documentation comments. ../../node_modules/@types/chai/index.d.ts(126,16): error TS2370: A rest parameter must be of an array type. npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! car-cc@0.1.0 build: npm run clean && npm run client:generate && tsc npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the car-cc@0.1.0 build 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! /home/osboxes/.npm/_logs/2019-08-30T23_23_50_972Z-debug.log

diestrin commented 5 years ago

Hey @jackyjqcheung, the issue is because both @types/chai and @types/mocha made a breaking change in one of their releases. Removing the ^ in the dependencies and leaving the same version as it is marked in the package.json will fix the issue.

However, this a very old repo, and we created a new version f this one with an auto rest api generator. You can find it here https://github.com/worldsibu/convector-example-fabcar-rest

jackyjqcheung commented 5 years ago

After removing the ^ symbols, it works now. Thanks.