question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running ng commands when project is stored on shared/symlinked network drive

See original GitHub issue

Bug Report or Feature Request (mark with an x)

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

Command (mark with an x)

- [ ] new
- [x] build
- [x] serve
- [x] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [x] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

node -v v8.11.3

npm --version 6.3.0

ng --version Angular CLI: 6.1.3 Node: 8.11.3 OS: win32 x64 Angular: 5.2.11 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, router

Package Version ----------------------------------------------------------- @angular-devkit/architect 0.6.8 @angular-devkit/build-angular 0.6.8 @angular-devkit/build-optimizer 0.6.8 @angular-devkit/core 0.6.8 @angular-devkit/schematics 0.7.3 @angular/cli 6.1.3 @ngtools/webpack 6.0.8 @schematics/angular 0.7.3 @schematics/update 0.7.3 rxjs 5.5.11 typescript 2.5.3 webpack 4.8.3

Repro steps

Have a directory mapped to network drive. When ng command is run the directory path is resolved with ip of network drive so instead C:\Projects\AITeF\AITeF it is resolved to : C:\192.168.*.*\Projects_D2\AITeF\AITeF

The log given by the failure

image

Desired functionality

Mention any other details that might be useful

I moved my project to remote desktop on Windows 10. The local drive that project is on is symlinked to a network drive so all computers in my company have access to it. Unfortunately, when things are configured this way, I cannot run any ng command. They always give an error like this.

It’s because it tries to acces the project via 'C:\192.168..\Projects_D2\AITeF\AITeF while the path should look like this C:\Projects\AITeF\AITeF.

I tried adding “preserveSymlinks”: true in my angular.json file but this doesn’t work.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

4reactions
Muchaszewskicommented, Aug 22, 2018

I have a similar issue,

All symlinks on windows are being “resolved” instead of being interpreted. This is not an issue on the local machine symlinks. Like symlink C:\Foo -> real folder D:\Boo is always presented in logs as D:\Boo. This is not perfect but it works. but the problem starts with remote locations.

The drive letter is not removed from remote location path thus symlink target \\192.168.*.*\Foo symlink location C:/Foo -> real folder on remote machine D:/Boo is always presented in logs as C:\192.168.*.*\Boo which is not existing location as you might have noticed.

The desired result would be \\192.168.*.*\Foo if ng is supporting networking location or the most perfect would be not resolved at all C:\Foo.

This is huge issue for us, please advice.

1reaction
javihernandezcommented, Sep 4, 2020

Hi, I’m having a similar problem when trying to build an angular project that lives in a VirtualBox shared folder. From what I can see, the problem is that find-up is not finding the angular.json file due to the following while clause:

while (currentDir && currentDir !== root)

In my case, my angular project lives in my V: drive. That means that currentDir and root are exactly the same, and that’s why never gets into the while clause. I’m pretty new to angular and it’s unclear to me whether this is a wrong approach, but from what I can tell, I follow the same approach in many projects using different technologies, specially when you use vagrant boxes to work on different projects that require different set-ups/environments.

As a workaround, I updated my provisioning script to copy our angular project into a different folder (not a shared one) and build from there, but still, it’s a bit annoying. Is there any possibility to get this fixed? Let me know if you want me to provide more information that could help to get this fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular cli - Where does `ng serve` output files to?
It's correct that ng serve builds in memory. Angular CLI does not have support for running a server and writing to disk at...
Read more >
EPERM: operation not permitted, symlink... error
It seems that you are using network drive? ... Running ng commands when project is stored on shared/symlinked network drive.
Read more >
ng run
The CLI commands run Architect targets such as build , serve , test , and lint . Each named target has a default...
Read more >
Installing Angular CLI on Ubuntu
The Angular CLI is a command-line interface tool that you use to ... sudo npm install -g @angular/clisudo ng --version ... ng new...
Read more >
How to bundle an Angular app for production?
cd project-folder; Run ng build command in Angular CLI. ng build --prod. To get the preview of the application, run the following command:....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found