akita
akita copied to clipboard
Cannot find module 'bluebird'
Is this a regression?
Yes
Description
After running ng add @datorama/akita
I get the below output.
The package @datorama/[email protected] 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
OK I see, but do you have bluebird installed?
I created a new Angular project.
OK, let me see what's wrong on my side, I will update and close the issue if it's something on my end
I have installed bluebird: npm i bluebird
and run ng add @datorama/akita
.
It worked, I have uninstalled bluebird after that,
I am not sure what's the issue as the error was also thrown in a new ng project.
happend to me too, running ng add ...
again (without installing bluebird) and its work
Same error
Also getting this error. Created a fresh Angular 13 app with ng new
then immediately followed up with ng add @datorama/akita
. Get the missing bluebird module error.
I am also getting the same error when using Angular 13
+1 Same error with Angular 13 using ng add @datorama/akita
.
bump. Angular 13 using ng add @datorama/akita
Same error, I'm on angular version 13.2.0
and it gives same bluebird error when installed using ng add ...
Works after installing bluebird as dependency
@yousafraza39142 why do I need to install bluebird for it to work? What is bluebird for?
@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
I tried installing bluebird and then re-installing akita, then i get
does anyone know if there's a patch for this
+1 Same error using ng add
on Angular 13
@jerosancho use npm to remove Akita,
ensure all imports/declarations related to Akita are removed from your app.module.ts
then proceed to add the bluebird package and then akita.
this was the fix for my own issue
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)
The repo is updated now. I'll release new versions soon.