Open RinatValiullov opened 2 years ago
Hitting the same issue (even from a brand new Angular 14 app workspace). Debugging a little bit, exception being thown is:
TypeError: Cannot read properties of null (reading 'toString')
at https://github.com/scullyio/scully/blob/v2.1.39/libs/scully-schematics/src/utils/utils.ts#L151
(line 149 also throws the same error trying to invoke null.toString()
)
Seems like the issue is project
being 'defaultProject'
, for which the host.read()
calls return null
.
Initializing with an explicit --project
command-line argument seems to get past this problem:
npx ng add @scullyio/init --project=my-project-name
but if you choose what seems like the default renderer option (Scully platform server), the init schematic fails on a later step with:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-project-name@0.2.0
npm ERR! Found: @angular/animations@14.1.1
npm ERR! node_modules/@angular/animations
npm ERR! @angular/animations@"^14.1.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/animations@"12.2.16" from @angular/platform-server@12.2.16
npm ERR! node_modules/@angular/platform-server
npm ERR! @angular/platform-server@"^12" from the root project
(I did not try going in and updating Scully's @angular/platform-server version to 14).
But trying to init again and choosing Pupeteer completed the init schematic successfully.
Side note, I then had to remove the extra --
from the package.json Scully commands:
npx scully --project my-project-name
This default generated script did NOT work work (running from Windows Terminal PowerShell 7, though I would hope that doesn't affect behavior):
npx scully -- --project my-project-name
@Lindurion
Is this specific for Windows users only?
Is this specific for Windows users only?
Nope. Just tried on macOS with a fresh Angular 14 app and hit exactly the same results above, including the need to remove the extra --
separator before the --project
argument.
@Lindurion
Tried repeat with deprecated "defaultProject" and chose Scully platform server
. Get this upstream dependency conflict:
I think this is a bug with not updated versions of dependencies on the Scully side.
same here :(
Angular CLI: 14.1.0
Node: 18.3.0 (Unsupported)
Package Manager: npm 8.11.0
OS: darwin arm64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.1401.0 (cli-only)
@angular-devkit/core 14.1.0 (cli-only)
@angular-devkit/schematics 14.1.0 (cli-only)
@schematics/angular 14.1.0 (cli-only)
The upstream dependency is caused by some strange handling of peer-deps. I have been looking into this but have not yet found a solution.
That being said, you can install Scully using --force
on the npm install command.
Same problem here.
Angular CLI: 14.2.4
Node: 16.14.2
Package Manager: npm 8.5.0
OS: win32 x64
Angular: 14.2.4
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1402.4
@angular-devkit/build-angular 14.2.4
@angular-devkit/core 14.2.4
@angular-devkit/schematics 14.2.4
@schematics/angular 14.2.4
rxjs 7.5.7
typescript 4.7.4
Same problem here.
Angular CLI: 14.2.4 Node: 16.14.2 Package Manager: npm 8.5.0 OS: win32 x64 Angular: 14.2.4 ... animations, cli, common, compiler, compiler-cli, core, forms ... platform-browser, platform-browser-dynamic, router Package Version --------------------------------------------------------- @angular-devkit/architect 0.1402.4 @angular-devkit/build-angular 14.2.4 @angular-devkit/core 14.2.4 @angular-devkit/schematics 14.2.4 @schematics/angular 14.2.4 rxjs 7.5.7 typescript 4.7.4
As @Lindurion and @SanderElias suggested, this worked for me:
npx --force ng add --force @scullyio/init --project=[PROJECT_NAME]
Where PROJECT_NAME
is the one specified under angular.json
Output:
> npx --force ng add --force @scullyio/init --project=ng-kitsune-site
npm WARN using --force Recommended protections disabled.
Skipping installation: Package already installed
? Which route renderer would you like to use? Scully platform server
polyfills.ts is already upto date
Installing ng-lib
Installing Scully Platform Server plugin
UPDATE .gitignore (680 bytes)
UPDATE package.json (1228 bytes)
✔ Packages installed successfully.
CREATE scully.ng-kitsune-site.config.ts (325 bytes)
UPDATE package.json (1354 bytes)
CREATE scully/tsconfig.json (450 bytes)
CREATE scully/plugins/plugin.ts (305 bytes)
Same issue
🐞 Bug report
Trying to install the blog I am not getting any changes to the project. The package does nothing at all. But the dependency
@scullyio/init
is installed. Dependency@scullyio/ng-lib
NOT installed.Description
🔬 Minimal Reproduction
ng add @scullyio/init
nothing happens (I don't get any answer at all):
Scully doesn't create config file and doesn't import
ScullyLibModule
in the main application module.💻Your Environment
Angular Version:
Scully Version:
🔥 Exception or Error