Angular-cli: 'ng new ' is not working

Created on 25 Mar 2017  Â·  10Comments  Â·  Source: angular/angular-cli

`D:\Work\learnangular>node --version
v6.10.1

D:\Work\learnangular>npm --version
3.10.10

D:\Work\learnangular>ng --version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ â–³ \ | '_ \ / _| | | | |/ _ | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ __| |_|__, |__,_|_|__,_|_| ____|_____|___|
|___/
@angular/cli: 1.0.0
node: 6.10.1
os: win32 x64

D:\Work\learnangular>ng new myapp
installing ng
create .editorconfig
create README.md
create srcappapp.component.css
create srcappapp.component.html
create srcappapp.component.spec.ts
create srcappapp.component.ts
create srcappapp.module.ts
create srcassets.gitkeep
create src\environments\environment.prod.ts
create src\environments\environment.ts
create src\favicon.ico
create src\index.html
create srcmain.ts
create srcpolyfills.ts
create src\styles.css
create src\test.ts
create src\tsconfig.app.json
create src\tsconfig.spec.json
create src\typings.d.ts
create .angular-cli.json
create e2eapp.e2e-spec.ts
create e2eapp.po.ts
create e2e\tsconfig.e2e.json
create .gitignore
create karma.conf.js
create package.json
create protractor.conf.js
create tsconfig.json
create tslint.json
Successfully initialized git.
Installing packages for tooling via cnpm.

error: unknown option `--quiet'

Package install failed, see above.

D:\Work\learnangular>`

easy (hours) low 1 (urgent) broken bufix

Most helpful comment

I found the solution to my problem. I had an old version of node running. after I updated that, I was good to go.

All 10 comments

I've also hit a problem attempting to run the CLI commands.

$ npm -v
3.10.8

$ node -v
v4.6.0

$ ng -v
[Also crashed]

$ ng new my-app
C:\Users\<redacted>\AppData\Roaming\npm\node_modules\@angular\cli\models\config\config.js:16
    constructor(_configPath, schema, configJson, fallbacks = []) {
                                                           ^

SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (C:\Users\<redacted>\AppData\Roaming\npm\node_modules\@angular\cli\models\config.js:3:18)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

I found the solution to my problem. I had an old version of node running. after I updated that, I was good to go.

@ahag You are passing in an option (--quiet) that is not valid. Use ng new --help to see the valid options. Or, go here: https://github.com/angular/angular-cli/wiki/new

@ahag update your node to >= 6.9.0

It appears cnpm does not have a --quiet flag. As a workaround you can use the --skip-install option on ng new and run the package install manually afterwards with cnpm.

I've figured that running ng new angular-project creates a new project in the home directory. In my case on MacOS in /Users/<username>/angular-project.

Moving it from there to the desired location will serve as a workaround.

It seems that the package manager "cnpm" added --quite to ng new, but actually ng new has no such option. So you have to set back to npm.

This is a bug, we should not pass --quiet when using cnpm.

hitting error on using

ng new
Soln: install node.js from nodes.org
run this : it will take time to install have patient.
npm install -g @angular/cli

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings