Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running ngx new #421

Closed
clarkmcnally opened this issue Dec 28, 2018 · 9 comments
Closed

Error running ngx new #421

clarkmcnally opened this issue Dec 28, 2018 · 9 comments
Labels

Comments

@clarkmcnally
Copy link

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
Copy link
Member

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
Copy link
Contributor

LuisReinoso commented Apr 24, 2019

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
Copy link
Member

@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
Copy link
Member

Should be fixed in 6.0.1.

@polu3g
Copy link

polu3g commented May 20, 2020

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
Copy link
Member

@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
Copy link

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
Copy link

polu3g commented May 26, 2020

whats the min node version supported ? thanks

@sinedied
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants