dojo / cli

:rocket: Dojo - command line tooling.
http://dojo.io
Other
25 stars 34 forks source link

Dojo CLI extension discovery is broken when using private npm registry #218

Closed evra closed 6 years ago

evra commented 6 years ago

Bug

After upgrade to CLI RC all dojo commands stoped working with a private npm registry server.

Package Version: 0.6.1

Code

> dojo
Commands are not available: TypeError: Cannot read property 'Symbol(Symbol.iterator)' of regEx.exec

Expected behavior:

> dojo
...help information...

Actual behavior:

dojo commands such as dojo build are not working.

Deeper analysis of the issue shows that the problem happens when the dojo cli extensions discovery cache file is filled with unrelated package names. The cache file is stored here ~\.config\configstore\@dojo\cli

A search command https://github.com/dojo/cli/blob/0ebf262f7afe7d9380bf092dab0567123df8e90e/src/installableCommands.ts#L43

May also return packages which are not dojo cli extensions, for example in my environment it finds a "dojo-layer-treemap" package. Such entries make the https://github.com/dojo/cli/blob/0ebf262f7afe7d9380bf092dab0567123df8e90e/src/installableCommands.ts#L89 to break the programm execution.

According to the search command documentation all package meta data is used by search.

Please, note I'm observing this only when I'm using our internal npm registry Nexus server.