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

Most upvoted comments

happend to me too, running ng add ... again (without installing bluebird) and its work

it 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/akita and executing ng config cli.defaultCollection @datorama/akita if you want to get the ng g commands 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 custom ng g commands)

Same error

@yousafraza39142 why do I need to install bluebird for it to work? What is bluebird for? Honestly, I’m not sure, I looked up bluebird and it is an implementation of promises for js.

They have used promises in their utils.ts inside ng-add schematics. Maybe it has something to do with it