devkit icon indicating copy to clipboard operation
devkit copied to clipboard

schematics-cli on Windows 10 "No such file or directory" error when attempting to create a new schematics project

Open glenngr opened this issue 8 years ago • 2 comments

Bug Report or Feature Request (mark with an x)

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

Area

- [ ] devkit
- [x] schematics

Versions

Node: v8.9.4
Npm: 5.6.0
Windows:  Windows 10 Version 1709 (OS BUILD 16299.248)
[email protected]
@angular-devkit/[email protected]
@schematics/[email protected]
@angular-devkit/[email protected]

Repro steps

  • Open a command line
  • Create a directory and cd into it
  • Run schematics @schematics/schematics:schematic --name my-angular-schematics

The log given by the failure

C:\>mkdir tmp

C:\>cd tmp

C:\tmp>schematics @schematics/schematics:schematic --name my-angular-schematics
CREATE /my-angular-schematics/package.json (538 bytes)
CREATE /my-angular-schematics/README.md (635 bytes)
CREATE /my-angular-schematics/src/collection.json (1698 bytes)
CREATE /my-angular-schematics/src/my-full-schematic/index.ts (2455 bytes)
CREATE /my-angular-schematics/src/my-full-schematic/index_spec.ts (864 bytes)
CREATE /my-angular-schematics/src/my-full-schematic/schema.json (306 bytes)
CREATE /my-angular-schematics/src/my-other-schematic/index.ts (1346 bytes)
CREATE /my-angular-schematics/src/my-other-schematic/index_spec.ts (509 bytes)
CREATE /my-angular-schematics/src/my-schematic/index.ts (1458 bytes)
CREATE /my-angular-schematics/src/my-schematic/index_spec.ts (482 bytes)
CREATE /my-angular-schematics/tsconfig.json (631 bytes)
CREATE /my-angular-schematics/.gitignore (191 bytes)
CREATE /my-angular-schematics/src/my-full-schematic/files/test2 (127 bytes)
CREATE /my-angular-schematics/src/my-full-schematic/files/test__INDEX__ (29 bytes)
ENOENT: no such file or directory, mkdir 'C:\C\tmp\my-angular-schematics'

C:\tmp>

Desired functionality

I expect the schematics-cli to work on windows. It looks like it has issues with accessing the folder using the correct path.

Mention any other details that might be useful

I get the same result if I use git bash (on windows)

Workaround

I currently use this workaround.

C:\>mklink /J c c:\
Junction created for c <<===>> c:\

C:\>cd tmp

C:\tmp>schematics @schematics/schematics:schematic --name my-angular-schematics
CREATE /my-angular-schematics/package.json (538 bytes)
CREATE /my-angular-schematics/README.md (635 bytes)
CREATE /my-angular-schematics/src/collection.json (1698 bytes)
CREATE /my-angular-schematics/src/my-full-schematic/index.ts (2455 bytes)
CREATE /my-angular-schematics/src/my-full-schematic/index_spec.ts (864 bytes)
CREATE /my-angular-schematics/src/my-full-schematic/schema.json (306 bytes)
CREATE /my-angular-schematics/src/my-other-schematic/index.ts (1346 bytes)
CREATE /my-angular-schematics/src/my-other-schematic/index_spec.ts (509 bytes)
CREATE /my-angular-schematics/src/my-schematic/index.ts (1458 bytes)
CREATE /my-angular-schematics/src/my-schematic/index_spec.ts (482 bytes)
CREATE /my-angular-schematics/tsconfig.json (631 bytes)
CREATE /my-angular-schematics/.gitignore (191 bytes)
CREATE /my-angular-schematics/src/my-full-schematic/files/test2 (127 bytes)
CREATE /my-angular-schematics/src/my-full-schematic/files/test__INDEX__ (29 bytes)

C:\tmp>

glenngr avatar Feb 21 '18 09:02 glenngr

I'm facing the same error.

Another workaround is to create folders manually and to run the command after that. :)

mnicic avatar Feb 21 '18 12:02 mnicic

This issue was moved to angular/angular-cli#12145

alexeagle avatar Sep 04 '18 23:09 alexeagle