Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng add @nrwl/schematics throws - Error: ENOENT: no such file or directory, stat 'src/favicon.ico' #543

Closed
matthewharwood opened this issue May 30, 2018 · 8 comments
Assignees
Labels
blocked: retry with latest Retry with latest release or head. outdated

Comments

@matthewharwood
Copy link

matthewharwood commented May 30, 2018

Recreation:

ng new universalproject
cd universalproject
ng g universal --client-project universalproject // optional
ng add @nrwl/schematics
ng serve --project=universalproject

Throws this error:

Error: ENOENT: no such file or directory, stat '/Users/matty/dev/morningharwood/src/favicon.ico'
    at Object.fs.statSync (fs.js:946:3)
    at Observable.rxjs_1.Observable.obs [as _subscribe] (/Users/matty/dev/morningharwood/node_modules/@angular/cli/node_modules/@angular-devkit/core/node/host.js:222:25)
    at Observable.subscribe (/Users/matty/dev/morningharwood/node_modules/rxjs/internal/Observable.js:162:69)
    at MapOperator.call (/Users/matty/dev/morningharwood/node_modules/rxjs/internal/operators/map.js:62:23)
    at Observable.subscribe (/Users/matty/dev/morningharwood/node_modules/rxjs/internal/Observable.js:159:22)
    at CatchOperator.call (/Users/matty/dev/morningharwood/node_modules/rxjs/internal/operators/catchError.js:28:23)
    at Observable.subscribe (/Users/matty/dev/morningharwood/node_modules/rxjs/internal/Observable.js:159:22)
    at MapOperator.call (/Users/matty/dev/morningharwood/node_modules/rxjs/internal/operators/map.js:62:23)
    at Observable.subscribe (/Users/matty/dev/morningharwood/node_modules/rxjs/internal/Observable.js:159:22)
    at /Users/matty/dev/morningharwood/node_modules/rxjs/internal/util/subscribeTo.js:22:31
    at Object.subscribeToResult (/Users/matty/dev/morningharwood/node_modules/rxjs/internal/util/subscribeToResult.js:7:45)
    at new ForkJoinSubscriber (/Users/matty/dev/morningharwood/node_modules/rxjs/internal/observable/forkJoin.js:165:57)
    at Observable._subscribe (/Users/matty/dev/morningharwood/node_modules/rxjs/internal/observable/forkJoin.js:145:16)
    at Observable.subscribe (/Users/matty/dev/morningharwood/node_modules/rxjs/internal/Observable.js:162:69)
    at /Users/matty/dev/morningharwood/node_modules/rxjs/internal/util/subscribeTo.js:22:31
    at Object.subscribeToResult (/Users/matty/dev/morningharwood/node_modules/rxjs/internal/util/subscribeToResult.js:7:45)

If I try to change the paths to match in the angular.json

"options": {
            "outputPath": "dist/apps/universalproject",
            "index": "apps/universalproject/src/index.html",
            "main": "apps/universalproject/src/main.ts",
            "polyfills": "apps/universalproject/src/polyfills.ts",
            "tsConfig": "apps/universalproject/src/tsconfig.app.json",
            "assets": [
              "apps/universalproject/src/favicon.ico",
              "apps/universalproject/src/assets"
            ],
            "styles": [
              "apps/universalproject/src/styles.css"
            ],
            "scripts": []
          },

I get an error:
`ng serve --project=universalproject

The apps/universalproject/src/favicon.ico asset path must start with the project source root.
Error: The apps/universalproject/src/favicon.ico asset path must start with the project source root.
    at assetPatterns.map.assetPattern (/Users/matty/dev/universalproject/node_modules/@angular-devkit/build-angular/src/utils/normalize-asset-patterns.js:37:23)
    at Array.map (<anonymous>)
    at Object.normalizeAssetPatterns (/Users/matty/dev/universalproject/node_modules/@angular-devkit/build-angular/src/utils/normalize-asset-patterns.js:30:10)
    at MergeMapSubscriber.check_port_1.checkPort.pipe.operators_1.concatMap [as project] (/Users/matty/dev/universalproject/node_modules/@angular-devkit/build-angular/src/dev-server/index.js:34:372)
    at MergeMapSubscriber._tryNext (/Users/matty/dev/universalproject/node_modules/rxjs/internal/operators/mergeMap.js:122:27)
    at MergeMapSubscriber._next (/Users/matty/dev/universalproject/node_modules/rxjs/internal/operators/mergeMap.js:112:18)
    at MergeMapSubscriber.Subscriber.next (/Users/matty/dev/universalproject/node_modules/rxjs/internal/Subscriber.js:103:18)
    at MergeMapSubscriber.notifyNext (/Users/matty/dev/universalproject/node_modules/rxjs/internal/operators/mergeMap.js:141:26)
    at InnerSubscriber._next (/Users/matty/dev/universalproject/node_modules/rxjs/internal/InnerSubscriber.js:30:21)
    at InnerSubscriber.Subscriber.next (/Users/matty/dev/universalproject/node_modules/rxjs/internal/Subscriber.js:103:18)
    at /Users/matty/dev/universalproject/node_modules/rxjs/internal/util/subscribeTo.js:17:28
    at Object.subscribeToResult (/Users/matty/dev/universalproject/node_modules/rxjs/internal/util/subscribeToResult.js:7:45)
    at MergeMapSubscriber._innerSub (/Users/matty/dev/universalproject/node_modules/rxjs/internal/operators/mergeMap.js:132:38)
    at MergeMapSubscriber._tryNext (/Users/matty/dev/universalproject/node_modules/rxjs/internal/operators/mergeMap.js:129:14)
    at MergeMapSubscriber._next (/Users/matty/dev/universalproject/node_modules/rxjs/internal/operators/mergeMap.js:112:18)
    at MergeMapSubscriber.Subscriber.next (/Users/matty/dev/universalproject/node_modules/rxjs/internal/Subscriber.js:103:18)
@FrozenPandaz
Copy link
Collaborator

Was there an error when doing ng add @nrwl/schematics?

@FrozenPandaz FrozenPandaz self-assigned this May 30, 2018
@matthewharwood
Copy link
Author

Yeah I'm getting a EISDIR: illegal operation on a directory, read on ng add @nrwl/schematics

I tried this on my windows and osx machines:

matth@DESKTOP-PUQ7U15 MINGW64 ~/workspace/universalproject (master)

$ nvm ls
  * 8.11.1 (Currently using 64-bit executable)

matth@DESKTOP-PUQ7U15 MINGW64 ~/workspace/universalproject (master)
$ npm --version
5.6.0
matth@DESKTOP-PUQ7U15 MINGW64 ~/workspace
$ ng new universalproject
CREATE universalproject/angular.json (3638 bytes)
CREATE universalproject/package.json (1320 bytes)
CREATE universalproject/README.md (1033 bytes)
CREATE universalproject/tsconfig.json (384 bytes)
CREATE universalproject/tslint.json (2805 bytes)
CREATE universalproject/.editorconfig (245 bytes)
CREATE universalproject/.gitignore (503 bytes)
CREATE universalproject/src/environments/environment.prod.ts (51 bytes)
CREATE universalproject/src/environments/environment.ts (631 bytes)
CREATE universalproject/src/favicon.ico (5430 bytes)
CREATE universalproject/src/index.html (303 bytes)
CREATE universalproject/src/main.ts (370 bytes)
CREATE universalproject/src/polyfills.ts (3194 bytes)
CREATE universalproject/src/test.ts (642 bytes)
CREATE universalproject/src/assets/.gitkeep (0 bytes)
CREATE universalproject/src/styles.css (80 bytes)
CREATE universalproject/src/browserslist (375 bytes)
CREATE universalproject/src/karma.conf.js (964 bytes)
CREATE universalproject/src/tsconfig.app.json (194 bytes)
CREATE universalproject/src/tsconfig.spec.json (282 bytes)
CREATE universalproject/src/tslint.json (314 bytes)
CREATE universalproject/src/app/app.module.ts (314 bytes)
CREATE universalproject/src/app/app.component.html (1141 bytes)
CREATE universalproject/src/app/app.component.spec.ts (999 bytes)
CREATE universalproject/src/app/app.component.ts (207 bytes)
CREATE universalproject/src/app/app.component.css (0 bytes)
CREATE universalproject/e2e/protractor.conf.js (752 bytes)
CREATE universalproject/e2e/src/app.e2e-spec.ts (312 bytes)
CREATE universalproject/e2e/src/app.po.ts (208 bytes)
matth@DESKTOP-PUQ7U15 MINGW64 ~/workspace
$ cd universalproject/
matth@DESKTOP-PUQ7U15 MINGW64 ~/workspace/universalproject (master)
$ ng add @nrwl/schematics
Installing packages for tooling via yarn.
yarn add v1.7.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 28 new dependencies.
info Direct dependencies
└─ @nrwl/[email protected]
info All dependencies
├─ @ngrx/[email protected]
├─ @nrwl/[email protected]
├─ @schematics/[email protected]
├─ @types/[email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
Done in 9.41s.
Installed packages for tooling via yarn.
EISDIR: illegal operation on a directory, read
matth@DESKTOP-PUQ7U15 MINGW64 ~/workspace/universalproject (master)
$ ng serve --project=universalproject
fs.js:948
  binding.stat(pathModule._makeLong(path));
          ^

Error: ENOENT: no such file or directory, stat 'C:\Users\matth\workspace\universalproject\src\favicon.ico'
    at Object.fs.statSync (fs.js:948:11)
    at Observable.rxjs_1.Observable.obs [as _subscribe] (C:\Users\matth\workspace\universalproject\node_modules\@angular-devkit\core\node\host.js:222:25)
    at Observable.subscribe (C:\Users\matth\workspace\universalproject\node_modules\rxjs\internal\Observable.js:162:69)
    at MapOperator.call (C:\Users\matth\workspace\universalproject\node_modules\rxjs\internal\operators\map.js:62:23)
    at Observable.subscribe (C:\Users\matth\workspace\universalproject\node_modules\rxjs\internal\Observable.js:159:22)
    at CatchOperator.call (C:\Users\matth\workspace\universalproject\node_modules\rxjs\internal\operators\catchError.js:28:23)
    at Observable.subscribe (C:\Users\matth\workspace\universalproject\node_modules\rxjs\internal\Observable.js:159:22)
    at MapOperator.call (C:\Users\matth\workspace\universalproject\node_modules\rxjs\internal\operators\map.js:62:23)
    at Observable.subscribe (C:\Users\matth\workspace\universalproject\node_modules\rxjs\internal\Observable.js:159:22)
    at C:\Users\matth\workspace\universalproject\node_modules\rxjs\internal\util\subscribeTo.js:22:31
    at Object.subscribeToResult (C:\Users\matth\workspace\universalproject\node_modules\rxjs\internal\util\subscribeToResult.js:7:45)
    at new ForkJoinSubscriber (C:\Users\matth\workspace\universalproject\node_modules\rxjs\internal\observable\forkJoin.js:165:57)
    at Observable._subscribe (C:\Users\matth\workspace\universalproject\node_modules\rxjs\internal\observable\forkJoin.js:145:16)
    at Observable.subscribe (C:\Users\matth\workspace\universalproject\node_modules\rxjs\internal\Observable.js:162:69)
    at C:\Users\matth\workspace\universalproject\node_modules\rxjs\internal\util\subscribeTo.js:22:31
    at Object.subscribeToResult (C:\Users\matth\workspace\universalproject\node_modules\rxjs\internal\util\subscribeToResult.js:7:45)

@FrozenPandaz
Copy link
Collaborator

Ah yeah, you're affected by this issue which has been fixed, but not published

EISDIR: illegal operation on a directory, read

#513

@FrozenPandaz FrozenPandaz added the blocked: retry with latest Retry with latest release or head. label May 31, 2018
@shabbirdesap
Copy link

shabbirdesap commented May 31, 2018

I am facing the same issue .

@matthewharwood
Copy link
Author

matthewharwood commented Jun 1, 2018

@FrozenPandaz Retry'd with latest.

The EISDIR: illegal operation on a directory, read #513

Has been resolved but now when running ng serve --project=universalproject

But now I get an ngrx error:

ERROR in node_modules/@ngrx/effects/src/actions.d.ts(2,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@ngrx/effects/src/actions.d.ts(3,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/Operator"' has no exported member 'Operator'.
node_modules/@ngrx/effects/src/effect_notification.d.ts(1,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@ngrx/effects/src/effect_notification.d.ts(2,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/Notification"' has no exported member 'Notification'.
node_modules/@ngrx/effects/src/effect_sources.d.ts(1,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@ngrx/effects/src/effects_resolver.d.ts(1,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@ngrx/effects/src/on_run_effects.d.ts(1,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@ngrx/store/src/actions_subject.d.ts(2,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/BehaviorSubject"' has no exported member 'BehaviorSubject'.
node_modules/@ngrx/store/src/reducer_manager.d.ts(2,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/BehaviorSubject"' has no exported member 'BehaviorSubject'.
node_modules/@ngrx/store/src/reducer_manager.d.ts(3,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@ngrx/store/src/scanned_actions_subject.d.ts(2,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@ngrx/store/src/state.d.ts(2,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/BehaviorSubject"' has no exported member 'BehaviorSubject'.
node_modules/@ngrx/store/src/state.d.ts(3,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@ngrx/store/src/store.d.ts(2,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/Observer"' has no exported member 'Observer'.
node_modules/@ngrx/store/src/store.d.ts(3,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@ngrx/store/src/store.d.ts(4,10): error TS2305: Module '"/Users/matty/dev/universalproject/node_modules/rxjs/Operator"' has no exported member 'Operator'.
node_modules/rxjs/BehaviorSubject.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/BehaviorSubject'.
node_modules/rxjs/Notification.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Notification'.
node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.
node_modules/rxjs/Observer.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observer'.
node_modules/rxjs/Operator.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Operator'.
node_modules/rxjs/Subject.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Subject'.

ℹ 「wdm」: Failed to compile.

@matthewharwood
Copy link
Author

It would seem that this:
#164
now points to the next universal bug:

This functionality broke recently. After extending @ngrx/schematics.This should be fixed in @ngrx/[email protected]? But we can add a fix to extend it.
-- FrozenPandaz

@FrozenPandaz
Copy link
Collaborator

Yes there is a fix for that in this PR. Sorry about that. To resolve the rxjs-compat issues you can install rxjs-compat in your workspace.

#164 Is still an issue, I fixed adding Nx to a Angular CLI Universal project, but.. not Universal to a Nx project lol. Do not fear, I will get to it :)

I'm going to close this issue for now as the original issue is resolved. For the rxjs-compat issue, you could create an issue and I will refer to it in my PR.

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked: retry with latest Retry with latest release or head. outdated
Projects
None yet
Development

No branches or pull requests

3 participants