[ERROR] ng new failed on @angular/cli 1.6
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
Desired behavior
Mention any other details that might be useful (optional)
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 ...
this commit is the fix https://github.com/angular/devkit/pull/319/commits/bd25a1ff88f7c15fe3c5b4d863bd7be7b8a443c5
Will release in 5-10 minutes.
(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.