Repository navigation
Closed
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimefreq1: lowstate: has PRtype: bug/fix
Milestone
Description
🐞 bug report
Affected Package
@angular/compiler-cli
Is this a regression?
No
Description
Node does not exist error is thrown by NGCC when a direct or transitive dependency of a module that is being processed is missing.
For example in the reproduction, when trying to process @angular/material/progress-bar it is failing, because this depends on @angular/material/core, and the later on @angular/cdk. But @angular/cdk is not installed.
The error itself is not self explanatory and might send users on a goose chase. Hence, we should handle missing dependencies more gracefully and hint the users which is the missing dependency.
🔬 Minimal Reproduction
https://github.com/alan-agius4/ngcc-node-error/tree/master
🔥 Exception or Error
throw new Error('Node does not exist: ' + node);
^
Error: Node does not exist: /workspace/ngcc-node-error/node_modules/@angular/material/progress-bar
at DepGraph.dependenciesOf (/workspace/ngcc-node-error/node_modules/dependency-graph/lib/dep_graph.js:187:13)
at DependencyResolver.sortEntryPointsByDependency (/workspace/ngcc-node-error/node_modules/@angular/compiler-cli/ngcc/src/packages/dependency_resolver.js:42:47)
at EntryPointFinder.findEntryPoints (/workspace/ngcc-node-error/node_modules/@angular/compiler-cli/ngcc/src/packages/entry_point_finder.js:37:34)
at Object.mainNgcc [as process] (/workspace/ngcc-node-error/node_modules/@angular/compiler-cli/ngcc/src/main.js:50:34)
at Object. (/workspace/ngcc-node-error/index.js:4:6)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
npm ERR! Test failed. See above for more details.
🌍 Your Environment
Angular Version:
8.0.0-beta.10
Metadata
Metadata
Assignees
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimefreq1: lowstate: has PRtype: bug/fix
Activity
[-]NGCC - Node does not exist error [/-][+]NGCC Error: Node does not exist [/+]petebacondarwin commentedon Apr 1, 2019
We should handle this better. There is logic in ngcc to cope with this but it is obviously not working correctly in this case.
3 remaining items
fix(ivy): ngcc - handle missing entry-point dependencies better
fix(ivy): ngcc - handle missing entry-point dependencies better (angu…
wuboy0307 commentedon Jul 25, 2019
I still get "Node does not exist" error on 8.2.0-next.2
If I rollback to angular/compiler-cli 8.0.3. I will show only warning:
However there are other errors in version 8.0.3. So I can't use this version.
Is there anything I can do? Should this be fixed by ngx-papaparse ?
petebacondarwin commentedon Jul 28, 2019
@wuboy0307 - in this case the problem is that
ngx-papaparseis indeed doing a deep importimport * as lib from 'papaparse/papaparse.min.js';rather than simplyimport * as lib from 'papaparse';.In the latest version of ngcc the dependency checking phase is not handling this correctly. I think we should probably be more resilient to this approach.
qaxqaxqax commentedon Jul 30, 2019
I have got the same issue with ngx-highlightjs:
(8.2.0-rc.0)
petebacondarwin commentedon Jul 30, 2019
This crash should be fixed by #31872 but note that this failure is probably due to a missing dependency. Try running
./node_modules/.bin/ivy-ngcc -l debug. It should tell you if this package has a dependency that has not been installed.qaxqaxqax commentedon Jul 30, 2019
Should I open a ticket at ngx-highlightjs?
petebacondarwin commentedon Jul 30, 2019
@qaxqaxqax - not just yet. Can you confirm that
highlight.jsis indeed installed in your local project? I can see from here https://unpkg.com/browse/ngx-highlightjs@3.0.3/package.json that it is only a peer dependency, in which case you must install it yourself.Assuming that you have done this, then the problem is that ngx-hightlightjs is doing a "deep import" directly to a file in
highlight.jsrather than just a regular entry-point dependency. If so then this is a scenario that is common enough that we might want to look into fixing ngcc to cope with it...Edit:
I tried it locally and it is indeed a problem with the deep import. This has occurred before with other packages so we should look at how to fix this in ngcc.... cc @JoostK :-)
qaxqaxqax commentedon Aug 1, 2019
I don't know if it helps but the minimal repro is:
then import HighlightModule from ngx-highlightjs at app.moudle.ts and add it to the imports of @NgModule decorator.
and the "Error in Node does not exist: /Users/localadmin/D/restructure/my-project/node_modules/ngx-highlightjs" message appears.
isawk commentedon Aug 7, 2019
Project configured for SSR produces similar error
ERROR in Node does not exist: /Users/KOGA/Development/angular/telkom/node_modules/@nguniversal/express-engineVersion Info
@angular-devkit/architect 0.802.0
@angular-devkit/build-angular 0.802.0
@angular-devkit/build-optimizer 0.802.0
@angular-devkit/build-webpack 0.802.0
@angular-devkit/core 8.2.0
@angular-devkit/schematics 8.2.0
@ngtools/webpack 8.2.0
@nguniversal/express-engine 8.1.1
@nguniversal/module-map-ngfactory-loader 8.1.1
@schematics/angular 8.2.0
@schematics/update 0.802.0
rxjs 6.4.0
typescript 3.5.3
webpack 4.38.0
vugar005 commentedon Aug 11, 2019
This case should be reopened. I have same error. Please loook at this issue
csaszika commentedon Aug 25, 2019
Hi,
I just would like share my experience. I had the same issue with another package and ivy enabled.
I disabled ivy then the problem appeared...my not existed package has a dependency what I have to install. Then everything works with ivy also.
Result:
So I think ivy need some improvements in error logging :)
angular-automatic-lock-bot commentedon Sep 25, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.