Angular-cli: [ERROR] ng new failed on @angular/cli 1.6

Created on 6 Dec 2017  路  38Comments  路  Source: angular/angular-cli

Versions

Angular CLI: 1.6.0
Node: 8.9.1
OS: darwin x64

Repro steps

when i launch command ng new to create a new app, i have error.

Observed behavior

ng new look-error
error! look-error/src/app/app.component.html already exists.
error! look-error/src/app/app.component.spec.ts already exists.
error! look-error/src/app/app.component.ts already exists.
error! look-error/src/app/app.module.ts already exists.
ENOENT: no such file or directory, uv_chdir
Error: ENOENT: no such file or directory, uv_chdir
at process.chdir (/usr/local/lib/node_modules/@angular/cli/node_modules/graceful-fs/polyfills.js:21:9)
at /usr/local/lib/node_modules/@angular/cli/tasks/init.js:74:25
at
at process._tickCallback (internal/process/next_tick.js:188:7)

Desired behavior

Mention any other details that might be useful (optional)

Most helpful comment

This is a problem with trying to overwrite files in Schematics. It seems like some files were created twice and fixing a bug in validation actually uncovered the error. I'm working on a fix right now.

All 38 comments

Same problem here :(

System Version: macOS 10.13.1 (17B1003)
Kernel Version: Darwin 17.2.0

Same here on Windows 7.

I have the same problem. But the strangest thing is that when I go back to v1.5.5 this problem still occurs.

Node: 8.9.2
OS: macOS 10.13.1

Seeing this on Win 10, Node 8.1.2 too.

(I tried uninstalling, clearing NPM cache and re-installing, without luck)

ETA: Installing earlier versions on a similarly clean cache also shows the error, so it definitely looks like some unpinned dependency wreaking havoc.

I don't think it's an issue with @angular/cli itself but on one of its dependencies.

Same error on Window 7 and Ubuntu 16.04.

Angular CLI: 1.6.0
Node: 8.9.2
OS: win32 x64

Angular CLI: 1.6.0
Node: 9.1.0
OS: linux x64

@yarrgh you are right, when I downgraded it to 1.5.5 and 1.4.x this problem still occured.

Same error Windows 10:

Angular CLI: 1.6.0
Node: 9.2.0
OS: win32 x64

Testing locally, I'll come back with some (hopefully good) news soon.

Same error here with Windows 10/Node 6.11.5/npm 3.10.10.

If I create the directory myself and run the command, it has the same first errors and says it's installing packages and that it succeeds, but there are only '.git' and 'node_modules' folders and no files, and node_modules is empty.

$ ng new tt2
error! tt2/src/app/app.component.html already exists.
error! tt2/src/app/app.component.spec.ts already exists.
error! tt2/src/app/app.component.ts already exists.
error! tt2/src/app/app.module.ts already exists.
Installing packages for tooling via npm.
npm WARN enoent ENOENT: no such file or directory, open 'C:\git\web\tt2\package.json'
npm WARN tt2 No description
npm WARN tt2 No repository field.
npm WARN tt2 No README data
npm WARN tt2 No license field.
Installed packages for tooling via npm.
Project 'tt2' successfully created.

This is a problem with trying to overwrite files in Schematics. It seems like some files were created twice and fixing a bug in validation actually uncovered the error. I'm working on a fix right now.

Thank you @hansl.

Hopefully fixed soon ...

(just need to release the devkit)

Same thing here, also tested with v1.5.5

Done. Can someone checks that it works? (It works locally).

Should I install the the latest? @hansl

~Just creating a new project should be sufficient.~

@hansl is correct... a new install is needed because it is the global CLI that handles new project creation.

@YAdelMehraban yes reinstall global CLI please.

Testing now @hansl

@hansl Just tried it, everything is working.

@hansl Can confirm working on mac os after reinstalling and creating new project. Thanks!

@hansl works now, thank you so much

Closing this issue as fixed. Thanks all!

wow, thanks :) literally just found this a few minutes ago.

Thanks for the fix Hansl!

I am completely new to this, can some one please give me some advice on how to apply the fix? Thanks in advance.

@cortez-scr npm install -g @angular/cli, ng new my-app

Oh ok, I understand . By re-executing npm install, i am downloading the fixes and automatically replacing them on my machine. Pretty cool! Thanks

Thanks @hansl

Shouldn't there be a publicly visible 1.6.1 release for this fix? I do not see it when I click on the Releases tab.

@fmorriso No, because it wasn't @angular/cli that had the issue. It was another package that @angular/cli depends on (angular/devkit package).

@yarrgh Thanks for the clarification. I was unaware this issue was caused by another package, much less that it was fixed, which is why I waited (in vain it turns out) for a patch release to appear.

May I make a suggestion? Whenever these situations exist and are fixed by some kind of "not visible to the general public" technique like was the case in this issue, can somebody make a public announcement (changelog.md ?, WiKi entry, etc.) so that it stands out? Otherwise, you have to search through the issues and hopefully notice that the issue was resolved, something I'm betting that not a lot of people will see.

Just my two cents worth.

Hey guys,

I'm having the same issue and I've done

npm uninstall -g @angular/cli
npm cache verify
npm i -g @angular/cli
ng new t

Yet still get the same errors, I'm on now 8.9 and angular cli 1.6.6...

I'm also having the same problem... =/

$ sudo ng new angular-src
Error: Path "/app/app.module.ts" does not exist.
Path "/app/app.module.ts" does not exist.

I'm using MacOs High Sierra 10.13.2

@seekheart try creating the project at some new path. this resolved the issue for me.

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