angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

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

Open choucry13 opened this issue 8 years ago • 38 comments

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)

choucry13 avatar Dec 06 '17 22:12 choucry13

Same problem here :(

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

obenjiro avatar Dec 06 '17 22:12 obenjiro

Same here on Windows 7.

lukas-shawford avatar Dec 06 '17 22:12 lukas-shawford

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

JozefFlakus avatar Dec 06 '17 22:12 JozefFlakus

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.

wulfsberg avatar Dec 06 '17 22:12 wulfsberg

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

trevor-hackett avatar Dec 06 '17 22:12 trevor-hackett

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

chunghha avatar Dec 06 '17 22:12 chunghha

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

JozefFlakus avatar Dec 06 '17 22:12 JozefFlakus

Same error Windows 10:

Angular CLI: 1.6.0 Node: 9.2.0 OS: win32 x64

nicstrong avatar Dec 06 '17 22:12 nicstrong

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

hansl avatar Dec 06 '17 22:12 hansl

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.

JasonGoemaat avatar Dec 06 '17 22:12 JasonGoemaat

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.

hansl avatar Dec 06 '17 23:12 hansl

Thank you @hansl.

choucry13 avatar Dec 06 '17 23:12 choucry13

Hopefully fixed soon ...

ezrasandzerbell avatar Dec 06 '17 23:12 ezrasandzerbell

this commit is the fix https://github.com/angular/devkit/pull/319/commits/bd25a1ff88f7c15fe3c5b4d863bd7be7b8a443c5

Will release in 5-10 minutes.

hansl avatar Dec 06 '17 23:12 hansl

(just need to release the devkit)

hansl avatar Dec 06 '17 23:12 hansl

Same thing here, also tested with v1.5.5

yashints avatar Dec 06 '17 23:12 yashints

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

hansl avatar Dec 06 '17 23:12 hansl

Should I install the the latest? @hansl

yashints avatar Dec 06 '17 23:12 yashints

~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.

Brocco avatar Dec 06 '17 23:12 Brocco

@YAdelMehraban yes reinstall global CLI please.

hansl avatar Dec 06 '17 23:12 hansl