mobulum / npm-yo-generator-spring-boot-application-from-swagger

npm-yo-generator-spring-boot-application-from-swagger
MIT License
0 stars 2 forks source link

Error: Cannot find module '../../lib/generators/app' #7

Open akoeb opened 7 years ago

akoeb commented 7 years ago

Trying to get the generator working but it fails with said error:

$ npm --version
5.0.3
$ node --version 
v8.1.2
$ yo spring-boot-application-from-swagger
module.js:487
    throw err;
    ^

Error: Cannot find module '../../lib/generators/app'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/generator-spring-boot-application-from-
swagger/generators/app/index.js:4:13)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

I even tried to replace the local path from the error message to an absolute path like: const app = require('/usr/local/lib/node_modules/generator-spring-boot-application-from-swagger/generators/app/');

But then it fails with another error:

$ yo spring-boot-application-from-swagger
events.js:182
      throw er; // Unhandled 'error' event
      ^

AssertionError [ERR_ASSERTION]: A questions parameter is required
    at Object.promptSuggestion.prefillQuestions (/usr/local/lib/node_modules/generator-spring-boot-application-from-swagger/node_modules/yeoman-generator/lib/util/prompt-suggestion.js:106:3)
    at module.exports.Base.prompt (/usr/local/lib/node_modules/generator-spring-boot-application-from-swagger/node_modules/yeoman-generator/lib/index.js:165:32)
    at module.exports.prompting (/usr/local/lib/node_modules/generator-spring-boot-application-from-swagger/generators/app/index.js:18:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/generator-spring-boot-application-from-swagger/node_modules/yeoman-generator/lib/index.js:408:23)
    at /usr/local/lib/node_modules/generator-spring-boot-application-from-swagger/node_modules/run-async/index.js:25:25
    at Promise (<anonymous>)
    at /usr/local/lib/node_modules/generator-spring-boot-application-from-swagger/node_modules/run-async/index.js:24:19
    at /usr/local/lib/node_modules/generator-spring-boot-application-from-swagger/node_modules/yeoman-generator/lib/index.js:409:9
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)

Are there any other modules missing?

Reproduceable when running in a docker container like:

docker run -ti node bash

(you will need to create a user inside the docker container because yeoman fails to run as root: adduser test)

concrain commented 6 years ago

same problem

waytoharish commented 5 years ago

same problem Error: Cannot find module '../../lib/generators/app' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15) at Function.Module._load (internal/modules/cjs/loader.js:475:25) at Module.require (internal/modules/cjs/loader.js:598:17) at require (internal/modules/cjs/helpers.js:11:18)