allenhwkim / ngentest

Angular6+ Unit Test Generator For Components, Directive, Services, and Pipes
https://ngentest.github.io
MIT License
144 stars 60 forks source link

Cannot find module #27

Closed andsan closed 3 years ago

andsan commented 4 years ago

Error: Cannot find module '@sct-ng2/compatibility/services/config.service' code: 'MODULE_NOT_FOUND', requireStack: [ '', '/usr/local/lib/node_modules/ngentest/index.js' ]

I guess this tool can't handle paths or moduleNameMapper in the same manner as tsconfig and jest config provides.

"@sct-ng2/": ["src/app/"]

Polgabarro commented 4 years ago

This happen also in my project

allenhwkim commented 4 years ago

sorry for the late response. This can be done with replacements. From README.md

image

netalex commented 4 years ago

similar error, with custom library, and there is not a requireStack: [ '', 'path_to_lib' ] line in output:

{ Error: Cannot find module 'myLibraryName'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)   
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (<anonymous>:10:26)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at requireFromString (C:\Nodist\bin\node_modules\ngentest\node_modules\require-from-string\index.js:28:4)
    at run (C:\Nodist\bin\node_modules\ngentest\index.js:151:21)
    at Object.<anonymous> (C:\Nodist\bin\node_modules\ngentest\index.js:220:3)    
    at Module._compile (internal/modules/cjs/loader.js:778:30) code: 'MODULE_NOT_FOUND' }

Can you please suggest how to use replacement on what, to fix it? Tank you

allenhwkim commented 4 years ago

Can someone build a simple project to replicate this issue? I can do it but too busy with bill-paying tasks.

allenhwkim commented 3 years ago

closing because of inactivity