ngx-rocket / generator-ngx-rocket

:rocket: Extensible Angular 14+ enterprise-grade project generator
https://ngx-rocket.github.io/
MIT License
1.53k stars 216 forks source link

Error running ngx new #421

Closed clarkmcnally closed 5 years ago

clarkmcnally commented 5 years ago

Environment node - 11.6.0 npm - 6.5.0 generator-ngx-rocket - 5.3.0

Getting this error when running ngx new

(node:45259) UnhandledPromiseRejectionWarning: TypeError: require(...).requirePackage is not a function at Object. (/usr/local/lib/node_modules/generator-ngx-rocket/node_modules/errlop/index.js:4:38) at Module._compile (internal/modules/cjs/loader.js:721:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:560:12) at Function.Module._load (internal/modules/cjs/loader.js:552:3) at Module.require (internal/modules/cjs/loader.js:657:17) at require (internal/modules/cjs/helpers.js:22:18) at Object. (/usr/local/lib/node_modules/generator-ngx-rocket/node_modules/editions/edition-node-0.8/index.js:12:14) at Module._compile (internal/modules/cjs/loader.js:721:30) (node:45259) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:45259) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

sinedied commented 5 years ago

I cannot take a deeper look right now, but this might be an issue related to your package manager: try reinstalling the generator after clearing you module cache:

npm rm -g generator-ngx-rocket
npm cache clean --force
npm i -g generator-ngx-rocket

What's you OS/version? Do you use a node version manager, like nvm, n or something else?

LuisReinoso commented 5 years ago

Environment node - 9.5.0 npm - 6.1.0 generator-ngx-rocket - 6.0.0

I have update ngx rocket When I execute ngx new imagen

/home/luis/.nvm/versions/node/v9.5.0/lib/node_modules/generator-ngx-rocket/node_modules/conf/index.js:56 throw new Error('Project name could not be inferred. Please specify the projectName option.'); ^

Error: Project name could not be inferred. Please specify the projectName option. at new Conf (/home/luis/.nvm/versions/node/v9.5.0/lib/node_modules/generator-ngx-rocket/node_modules/conf/index.js:56:11) at new NgxCli (/home/luis/.nvm/versions/node/v9.5.0/lib/node_modules/generator-ngx-rocket/cli/index.js:58:20) at Object. (/home/luis/.nvm/versions/node/v9.5.0/lib/node_modules/generator-ngx-rocket/cli/bin/ngx:3:13) at Module._compile (module.js:660:30) at Object.Module._extensions..js (module.js:671:10) at Module.load (module.js:573:32) at tryModuleLoad (module.js:513:12) at Function.Module._load (module.js:505:3) at Function.Module.runMain (module.js:701:10) at startup (bootstrap_node.js:190:16)

I have tried ngx new --projectName dummyproject too

sinedied commented 5 years ago

@LuisReinoso strange, seems that the conf package cannot find the package.json file where it gets the name to same the cli config. Might be related to NVM setup, not sure why it's failing like that. I will push a quick fix anyways, I'll keep you updated.

sinedied commented 5 years ago

Should be fixed in 6.0.1.

polu3g commented 4 years ago

C:\proj>ngx n


\ ./ / ____ ____ | ' \/ ` |> < |--< [] | |-: |=== | |||_, //°\\ ENTERPRISE APP STARTER -~*=> |___/ v8.1.0

(node:10052) UnhandledPromiseRejectionWarning: C:\Users\riv\AppData\Roaming\npm\node_modules\generator-ngx-rocket\generators\app\index.js:30 } catch { ^

SyntaxError: Unexpected token { at createScript (vm.js:80:10) at Object.runInThisContext (vm.js:139:10) at Module._compile (module.js:617:28) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) at Module.require (module.js:597:17) at require (internal/module.js:11:18) at Object.get [as ngx-rocket] (C:\Users\riv\AppData\Roaming\npm\node_modules\generator-ngx-rocket\node_modules\yeoman-environment\lib\store.js:47:27) (node:10052) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3) (node:10052) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

sinedied commented 4 years ago

@polu3g can you open a new issue, following the issue template please? We cannot help you if we don't have information about your environment.

pworoniecki commented 4 years ago

Just to let you know - I had exactly the same issue as posted by @polu3g and I was able to resolve it by upgrading Node version (previously I had 8.11.3, now I have last LTS version, i.e. 12.16.3). I use Win 10 64-bit.

polu3g commented 4 years ago

whats the min node version supported ? thanks

sinedied commented 4 years ago

The min version is currently 10.9, as shown on the badge on the top of readme here: https://github.com/ngx-rocket/generator-ngx-rocket

You can also find this information in the package.json file, under the engines property. If you try installing the package generator-ngx-rocket from an incompatible Node version, you should also get a warning in the console telling your the minimum supported version.