Closed mhp-borisbojic closed 2 weeks ago
Same issue as well when trying to use a schematic for initializing a store in a project
Sadly, it only fixed the error message, but it still doesn't work as expected - I've deleted node_modules and yarn.lock as well:
โฏ ng add @ngxs/store
โน Using package manager: yarn
โ Found compatible package version: @ngxs/store@18.0.0.
โ Package information loaded.
The package @ngxs/store@18.0.0 will be installed and executed.
Would you like to proceed? Yes
โ Packages successfully installed.
Collection "@ngxs/store" cannot be resolved.
โฏ yarn
โค YN0000: ยท Yarn 4.3.1
โค YN0000: โ Resolution step
โค YN0000: โ Completed
โค YN0000: โ Fetch step
โค YN0000: โ Completed in 0s 251ms
โค YN0000: โ Link step
โค YN0000: โ ESM support for PnP uses the experimental loader API and is therefore experimental
โค YN0000: โ Completed
โค YN0000: ยท Done with warnings in 0s 433ms
โฏ ng generate @ngxs/store:starter-kit
An unhandled exception occurred: Collection "@ngxs/store" cannot be resolved.
See "/private/var/folders/jd/5j65z2j12ql0c1bkp5jlz3qc0000gp/T/ng-ma6wHT/angular-errors.log" for further details.
The content of the log:
[error] Error: Collection "@ngxs/store" cannot be resolved.
at SchematicEngineHost.resolve (/opt/homebrew/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js:86:19)
at SchematicEngineHost._resolveCollectionPath (/opt/homebrew/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js:91:37)
at SchematicEngineHost.createCollectionDescription (/opt/homebrew/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js:116:27)
at SchematicEngine._createCollectionDescription (/opt/homebrew/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/src/engine/engine.js:167:40)
at SchematicEngine.createCollection (/opt/homebrew/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/src/engine/engine.js:160:43)
at GenerateCommandModule.getSchematics (/opt/homebrew/lib/node_modules/@angular/cli/src/commands/generate/cli.js:137:48)
at async GenerateCommandModule.getSchematicsToRegister (/opt/homebrew/lib/node_modules/@angular/cli/src/commands/generate/cli.js:177:76)
at async GenerateCommandModule.builder (/opt/homebrew/lib/node_modules/@angular/cli/src/commands/generate/cli.js:33:55)
at async runCommand (/opt/homebrew/lib/node_modules/@angular/cli/src/command-builder/command-runner.js:76:5)
at async default_1 (/opt/homebrew/lib/node_modules/@angular/cli/lib/cli/index.js:70:16)
@mhp-borisbojic The fix has been merged, but not released yet. It will be released soon.
If you want to try out the unreleased version you can use the @ngxs/store@dev
package.
Affected Package
@ngxs/store
Description
Following the documentation (installation) leads to an error message
๐ฌ Minimal Reproduction
ng new ng18test
with all default configuration / settings, no SSRcd ng18test
ng add @ngxs/store
๐ฅ Exception or Error
Adding @ngxs/store leads to:
Environment