Angular-cli: ng new -d -> Cannot read property 'replace' of undefined

Created on 19 Jun 2017  路  3Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.1.2
node: 6.9.2
os: win32 x64
Windows 10, powershell

Repro steps.

run "ng new [name] --dry-run"

The log given by the failure.

PS W:\> ng new Something --dry-run
installing ng
You specified the dry-run flag, so no changes will be written.
Cannot read property 'replace' of undefined
TypeError: Cannot read property 'replace' of undefined
    at decamelize (%APPDATA%\Roaming\npm\node_modules\@angular\cli\node_modules\ember-cli-string-utils\index.js:25:13)
    at Object.dasherize (%APPDATA%\Roaming\npm\node_modules\@angular\cli\node_modules\ember-cli-string-utils\index.js:50:11)
    at Class.<anonymous> (%APPDATA%\Roaming\npm\node_modules\@angular\cli\ember-cli\lib\models\blueprint.js:869:42)
    at tryCatch (%APPDATA%\Roaming\npm\node_modules\@angular\cli\node_modules\rsvp\dist\rsvp.js:539:12)
    at invokeCallback (%APPDATA%\Roaming\npm\node_modules\@angular\cli\node_modules\rsvp\dist\rsvp.js:554:13)
    at %APPDATA%\Roaming\npm\node_modules\@angular\cli\node_modules\rsvp\dist\rsvp.js:629:16
    at flush (%APPDATA%\Roaming\npm\node_modules\@angular\cli\node_modules\rsvp\dist\rsvp.js:2414:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Additional Informations

I just reinstalled angular cli before

npm uninstall cli
npm clear cache
npm install cli

easy (hours) 2 (required) broken bufix

All 3 comments

@LProemer Can you confirm the the following, and perhaps close the issue ?

With @angular/cli 1.2.6, node 8.2.1, I can run

ng new no-app-will-be-generated --dry-run
ng new no-app-will-be-generated -d
ng new --dry-run-run no-app-will-be-generated
ng new -d no-app-will-be-generated

The output is in each case the same:

installing ng
You specified the dry-run flag, so no changes will be written.
  create .editorconfig
  create README.md
  create src/app/app.component.css
  create src/app/app.component.html
  create src/app/app.component.spec.ts
  create src/app/app.component.ts
  create src/app/app.module.ts
  create src/assets/.gitkeep
  create src/environments/environment.prod.ts
  create src/environments/environment.ts
  create src/favicon.ico
  create src/index.html
  create src/main.ts
  create src/polyfills.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 e2e/app.e2e-spec.ts
  create e2e/app.po.ts
  create e2e/tsconfig.e2e.json
  create karma.conf.js
  create package.json
  create protractor.conf.js
  create tsconfig.json
  create tslint.json
Project 'no-app-will-be-generated' successfully created.

No error of any kind shows up.

The last line in the output is misleading, though.
More accurately, it could be "Generation of project 'APP_NAME' files successfully simulated."

Closing this per @catull response. If you can still reproduce this issue with the latest CLI (1.2.7) please create a new issue and fill the template. Thanks!

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