ellamaolson / ngMigration-Assistant

An analysis tool to determine which migration path from AngularJS to Angular is right for you.
198 stars 24 forks source link

EISDIR Error while running ngma #22

Closed ajojra closed 5 years ago

ajojra commented 5 years ago

Error 1: ``` { Error: EISDIR: illegal operation on a directory, read at Object.fs.readSync (fs.js:675:18) at tryReadSync (fs.js:540:20) at Object.fs.readFileSync (fs.js:583:19) at AnalysisTool.testFile (/usr/local/lib/node_modules/ngma/bin/analysisTool.js:196:38) at AnalysisTool.runAnalysis (/usr/local/lib/node_modules/ngma/bin/analysisTool.js:174:18) at AnalysisTool.countLinesOfCode.then.sourceLines (/usr/local/lib/node_modules/ngma/bin/analysisTool.js:70:18) at at process._tickCallback (internal/process/next_tick.js:188:7) errno: -21, code: 'EISDIR', syscall: 'read' }



Output:
App Statistics
  * **Complexity: 0 controllers, 0 AngularJS components,** 55 JavaScript files, and 0 Typescript files.
trejoramiro commented 5 years ago

Having the same issue, has anyone found a fix?

trejoramiro commented 5 years ago

Found the cause. I was not targeting my app's javascript.

@Aman-Jojra make sure the folder path points to where your angular files are located. In most cases that would be the scripts folder. e.g. .../scripts/ ngma <folder-name-holding-angularjs>

ashclarke commented 5 years ago

My issue is caused by third-party scripts being read.

This is because:

Example:

Parent Folder
|__ app
|    |__ feature
|    |__ feature
|    |__ third-party
|        |__ dependency
|            |__ erroring-file.js
|__ sibling folder
|__ .gitignore

It would be great to specify the ignore file, e.g.

ngma app --ignore ..\.gitignore

For now, I've just copied the .gitignore into the app directory. 😏