File tree 2 files changed +21
-4
lines changed
packages/schematics/update/update
2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -845,10 +845,9 @@ export default function(options: UpdateSchema): Rule {
845
845
try {
846
846
return isPkgFromRegistry ( name , specifier ) ;
847
847
} catch {
848
- // Abort on failure because package.json is malformed.
849
- throw new SchematicsException (
850
- `Failed to parse dependency "${ name } " with specifier "${ specifier } "`
851
- + ` from package.json. Is the specifier malformed?` ) ;
848
+ logger . warn ( `Package ${ name } was not found on the registry. Skipping.` ) ;
849
+
850
+ return false ;
852
851
}
853
852
} ) ) ;
854
853
const packages = _buildPackageList ( options , npmDeps , logger ) ;
Original file line number Diff line number Diff line change @@ -72,6 +72,24 @@ describe('@schematics/update', () => {
72
72
) . toPromise ( ) . then ( done , done . fail ) ;
73
73
} , 45000 ) ;
74
74
75
+ it ( 'should not error with yarn 2.0 protocols' , async ( ) => {
76
+ const tree = new UnitTestTree ( new HostTree ( new virtualFs . test . TestHost ( {
77
+ '/package.json' : `{
78
+ "name": "blah",
79
+ "dependencies": {
80
+ "src": "src@link:./src",
81
+ "@angular-devkit-tests/update-base": "1.0.0"
82
+ }
83
+ }` ,
84
+ } ) ) ) ;
85
+
86
+ const newTree = await schematicRunner . runSchematicAsync ( 'update' , {
87
+ packages : [ '@angular-devkit-tests/update-base' ] ,
88
+ } , tree ) . toPromise ( ) ;
89
+ const { dependencies } = JSON . parse ( newTree . readContent ( '/package.json' ) ) ;
90
+ expect ( dependencies [ '@angular-devkit-tests/update-base' ] ) . toBe ( '1.1.0' ) ;
91
+ } ) ;
92
+
75
93
it ( 'updates Angular as compatible with Angular N-1' , done => {
76
94
// Add the basic migration package.
77
95
const content = virtualFs . fileBufferToString ( host . sync . read ( normalize ( '/package.json' ) ) ) ;
You can’t perform that action at this time.
0 commit comments