Cannot find module '@schematics/angular/utility/json-utils'
See original GitHub issueBug Report or Feature Request (mark with an x
)
- [x] bug report -> please search issues before submitting
- [ ] feature request
OS and Version?
Catalina 10.15.7
Versions
Angular CLI: 11.0.2 Node: 14.14.0 OS: darwin x64
Repro steps
From the CLI, enter ng add ngx-auth-firebaseui
The log given by the failure
Installing packages for tooling via npm. Installed packages for tooling via npm. An unhandled exception occurred: Cannot find module ‘@schematics/angular/utility/json-utils’ Require stack:
- /Users/TDK/angularfire/node_modules/ngx-auth-firebaseui/schematics/helpers/angular/json-utils.js
- /Users/TDK/angularfire/node_modules/ngx-auth-firebaseui/schematics/helpers/angular/index.js
- /Users/TDK/angularfire/node_modules/ngx-auth-firebaseui/schematics/helpers/index.js
- /Users/TDK/angularfire/node_modules/ngx-auth-firebaseui/schematics/ng-add/index.js
- /Users/TDK/angularfire/node_modules/@angular-devkit/schematics/tools/export-ref.js
- /Users/TDK/angularfire/node_modules/@angular-devkit/schematics/tools/index.js
- /Users/TDK/angularfire/node_modules/@angular/cli/utilities/json-schema.js
- /Users/TDK/angularfire/node_modules/@angular/cli/models/command-runner.js
- /Users/TDK/angularfire/node_modules/@angular/cli/lib/cli/index.js
- /Users/TDK/.nvm/versions/node/v14.14.0/lib/node_modules/@angular/cli/lib/init.js
- /Users/TDK/.nvm/versions/node/v14.14.0/lib/node_modules/@angular/cli/bin/ng See “/private/var/folders/dv/x8kx3wkj0tj08gcq1csnk4jm0000gp/T/ng-fuBnGr/angular-errors.log” for further details.
Desired functionality
I want to install ngx-auth-firebaseui.
Mention any other details that might be useful
First time using this package. I’ll try installing with npm.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Cannot find module '@schematics/angular/utility/project'
The problem is schematics module incompatibility. Find out the version of the @schematics/angular.
Read more >cannot find module '@schematics/angular/utility - You.com
I got past the '@schematics/angular/utility/parse-name' error by following the recommended steps. But now I get this error: [error] Error: Cannot find module '@ ......
Read more >Cannot find module '@schematics/angular/utility/json-utils'
Cannot find module '@schematics/angular/utility/json-utils'
Read more >schematics-utilities
ℹ️️ Description. At the moment, none of the utilities from the Angular Schematics package are exported. This project was created from that purpose...
Read more >Facing Issue with Angular Universal Implemetation - Reddit
Facing: An unhandled exception occurred: Cannot find module '@schematics/angular/utility/json-utils'. I have already tried installing files, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m having the same issue
@andresrivero in my personal fork of this repo, I was able to remove the json-utils reference (which worked to remove the main issue), however just as you did, I also ran into the issue of 'Cannot read property ‘defaultProject’ of undefined. Upon further investigation into this I was able to find where the problem was occurring, but not why.
Inside a typescript file: projects\ngx-auth-firebaseui\schematics\ng-add\index.ts there is a function that handles the imports. It’s here where the problem lies.
the function ‘getProjectFromWorkspace()’ is coming from angular, however, it would appear the package it comes from should be considered an internal package and shouldn’t be used incase there are changes.
When I print out the value of ‘project’, I get undefined. So I don’t know where we are supposed to define this project (I tried in the angular.json file, but that didn’t seem to work for me). If no value is provided the method sets a default.
I have no idea how the schematics library is defining the value of defaultProject…but it is clear this is the source of the problem.