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

ng build for a custom environment doesn't work on a pc but works on another with same config

Open Luca-Marantelli opened this issue 9 years ago • 6 comments

Bug Report or Feature Request (mark with an x)

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

ng build for a custom environment doesn't work on a pc but works on another with same cli

Versions.

@angular/cli: 1.1.3 node: 8.2.1 os: win32 x64 @angular/animations: 4.3.3 @angular/cdk: 2.0.0-beta.8 @angular/common: 4.3.3 @angular/compiler: 4.3.3 @angular/core: 4.3.3 @angular/forms: 4.3.3 @angular/http: 4.3.3 @angular/material: 2.0.0-beta.8 @angular/platform-browser: 4.3.3 @angular/platform-browser-dynamic: 4.3.3 @angular/platform-server: 4.3.3 @angular/router: 4.3.3 @angular/cli: 1.1.3 @angular/compiler-cli: 4.3.3 @angular/language-service: 4.3.3

Repro steps.

Execute: ng build --env=staging or ng build --environment=staging

The log given by the failure.

Build successfully

Desired functionality.

Should be build a "staging" version

Mention any other details that might be useful.

If I execute those command on a pc it works. A "staging" build is created with correct environment variables. But it doesn't work on another pc with same project and cli. A "dev" build is created instead of a "staging" buils. Configuration files for custom environment are ok and the same.

Can it be a cache problem? I tried also npm cache clean but this didn't solve my problem Thanks

Luca-Marantelli avatar Sep 02 '17 06:09 Luca-Marantelli

I have no idea why this would happen but there have been reports of such behaviour that I was never able to reproduce. Your report indicates that it might be a system problem, and that might be why I wasn't able to reproduce it.

I'd like to ask you to provide details about this. Can you tell me whatever you can about the two different machines? Could you also see if this happens on a brand new project between machines? Can you upload to github a repo where you see this happening?

Since I can't reproduce myself these details are extremely important. If I had to bet, it might be something in the paths... like uppercase letters which behave differently in Windows/OSX and Linux paths.

filipesilva avatar Sep 05 '17 09:09 filipesilva

Hi Filipe and thanks for your reply

Machine where it doesn't work: Windows 10 Pro 64 bit

Machine where it works: Windows 7 64 bit

Paths are exactly the same. Our project is on subversion so I can update or commit from everywhere. I will try to do a test on a new project as soon as possible.

Thanks

Luca-Marantelli avatar Sep 06 '17 13:09 Luca-Marantelli

@Gnorro , I had the same issue - build worked fine for me and didn't work for colleagues. For me the problem was that colleagues had 1.2.1 version of @angular/cli, when I had 1.1.1. Updating the version to 1.3.2 fixed it too. I hope this will help you too.

nedzvedz avatar Sep 08 '17 06:09 nedzvedz

Hi

Solved with: npm i [email protected]

Also build --prod didn't work Now prod and staging work ok

Thanks

Luca-Marantelli avatar Sep 11 '17 16:09 Luca-Marantelli

Glad to hear it's sorted, sounds like it was a dependency problem.

filipesilva avatar Sep 15 '17 16:09 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.