On Windows, Yeoman generator should stop with error if your NPM version is too old #1614

Closed
opened 2025-08-09 17:20:54 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @SteveSandersonMS on 5/18/2016

NPM < v3 on Windows can't correctly restore the full dependency tree for packages like @angular/*.

If you use these Yeoman generators, you'll eventually end up with an error like:

ERROR in ./ClientApp/boot-client.ts
Module not found: Error: Cannot resolve module 'reflect-metadata' in C:\Users\stevesa\Desktop\spapacktest2\ClientApp
 @ ./ClientApp/boot-client.ts 4:0-27

The underlying cause is NPM not restoring the packages properly, and the solution is to update to NPM 3+. We should prevent things from getting this far by stopping the generator up front if you're on NPM < 3 on Windows.

*Originally created by @SteveSandersonMS on 5/18/2016* NPM < v3 on Windows can't correctly restore the full dependency tree for packages like `@angular/*`. If you use these Yeoman generators, you'll eventually end up with an error like: ``` ERROR in ./ClientApp/boot-client.ts Module not found: Error: Cannot resolve module 'reflect-metadata' in C:\Users\stevesa\Desktop\spapacktest2\ClientApp @ ./ClientApp/boot-client.ts 4:0-27 ``` The underlying cause is NPM not restoring the packages properly, and the solution is to update to NPM 3+. We should prevent things from getting this far by stopping the generator up front if you're on NPM < 3 on Windows.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1614
No description provided.