UniBO-PRISMLab / wam

WoT Application Manager - a command line interface to build a Web of Things application for https://github.com/eclipse/thingweb.node-wot
MIT License
15 stars 4 forks source link

Error when project inited. #18

Closed MarcGraham closed 3 years ago

MarcGraham commented 3 years ago

Hi,

System: macOS Big Sur node 15.10.0 npm 7.10.1 nvm 0.37.2

I was giving WAM a try and got this error when trying to init a project:

`xxxx@xxxx wot % wam init ./wotTutorialThermostat


\ \ / / \ | \/ | \ \ /\ / / _ \ | |\/| | \ V V / __ | | | | _/_// __| |_|

? language: JavaScript ? name: wotTutorialThermostat ? version: 1.0.0 ? description: ? Enter the keywords separated by a comma: ? author: ? license: Apache License 2.0

Thanks!; installing packages using npm: /Users/marc/.nvm/versions/node/v15.10.0/lib/node_modules/npm/lib/npm.js:163 throw new TypeError('callback must be a function if provided') ^

TypeError: callback must be a function if provided at Object.load (/Users/marc/.nvm/versions/node/v15.10.0/lib/node_modules/npm/lib/npm.js:163:13) at /Users/marc/.nvm/versions/node/v15.10.0/lib/node_modules/@arces-wot/wam/dist/src/utils/npm-install.js:9:30 at new Promise () at Object.install [as default] (/Users/marc/.nvm/versions/node/v15.10.0/lib/node_modules/@arces-wot/wam/dist/src/utils/npm-install.js:8:12) at Command. (/Users/marc/.nvm/versions/node/v15.10.0/lib/node_modules/@arces-wot/wam/dist/src/commands/init.js:86:53) at step (/Users/marc/.nvm/versions/node/v15.10.0/lib/node_modules/@arces-wot/wam/dist/src/commands/init.js:33:23) at Object.next (/Users/marc/.nvm/versions/node/v15.10.0/lib/node_modules/@arces-wot/wam/dist/src/commands/init.js:14:53) at fulfilled (/Users/marc/.nvm/versions/node/v15.10.0/lib/node_modules/@arces-wot/wam/dist/src/commands/init.js:5:58) at processTicksAndRejections (node:internal/process/task_queues:94:5)`

I went ahead and ran npm install in the project directory and completed the tutorial -- it seems to work correctly.

relu91 commented 3 years ago

Thank you so much for using wam and reporting here. That's probably because npm does not have a real stable API. I even left and warning comment on the code itself: https://github.com/UniBO-PRISMLab/wam/blob/master/src/utils/npm-install.ts#L7

We should handle different APIs consistently.

I'll look into it. Maybe it's time to implement some CI tests 🤔 .

relu91 commented 3 years ago

should be fixed now, please re-open if not!

MarcGraham commented 3 years ago

Works for me! Thanks.