akita: Cannot find module 'bluebird'
Is this a regression?
Yes
Description
After running ng add @datorama/akita
I get the below output.
The package @datorama/akita@7.0.1 will be installed and executed.
Would you like to proceed? Yes
✔ Package successfully installed.
An unhandled exception occurred: Cannot find module 'bluebird'
Require stack:
- C:\Users\...\Development\appp\node_modules\@schematics\update\node_modules\pacote\extract.js
- C:\Users\...\Development\appp\node_modules\@schematics\update\node_modules\pacote\index.js
- C:\Users\...\Development\appp\node_modules\@schematics\update\update\npm.js
- C:\Users\...\Development\appp\node_modules\schematics-utilities\dist\package_update\npm.js
- C:\Users\...Development\appp\node_modules\schematics-utilities\dist\package_update\index.js
- C:\Users\...\Development\appp\node_modules\schematics-utilities\dist\index.js
- C:\Users\...\Development\appp\node_modules\@datorama\akita\schematics\ng-add\index.js
- C:\Users\...Development\appp\node_modules\@angular-devkit\schematics\tools\export-ref.js
- C:\Users\...\Development\appp\node_modules\@angular-devkit\schematics\tools\index.js
- C:\Users\...\Development\appp\node_modules\@angular\cli\utilities\json-schema.js
- C:\Users\...\Development\appp\node_modules\@angular\cli\models\command-runner.js
- C:\Users\...\Development\appp\node_modules\@angular\cli\lib\cli\index.js
- C:\Users\...\AppData\Roaming\npm\node_modules\@angular\cli\lib\init.js
And I cannot run any Akita schematics
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in
No response
Anything else?
No response
Do you want to create a pull request?
No
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 20
happend to me too, running
ng add ...again (without installing bluebird) and its workit looks like the issue comes from schematics-utilities having dependencies on angular 8 https://github.com/nitayneeman/schematics-utilities/blob/master/package.json#L37-L44
another schematic had this exact same issue, and they ended up removing schematics-utilities in favor of angular/cdk https://github.com/angular/angular-cli/issues/20685 https://github.com/oktadev/schematics/pull/569
for now however, you should just be able to install bluebird, run the schematics and then uninstall it another way would be to just bypass the schematics and manually install akita using
npm i @datorama/akitaand executingng config cli.defaultCollection @datorama/akitaif you want to get theng gcommands for akita (note that with angular 14, you will be able to have multiple values in defaultCollection, which will be usefull if you already have a library giving you customng gcommands)Same error
They have used promises in their utils.ts inside ng-add schematics. Maybe it has something to do with it