Adding Troubleshooting to the SPA instructions

Cesar De la Torre 2017-03-13 17:08:35 -07:00
parent 7c8566b615
commit f08919841e
2 changed files with 7 additions and 0 deletions

Binary file not shown.

@ -61,6 +61,13 @@ At this point, if you were originally following the eShopOnContainer setup for a
3. **CLI on Mac:** Build the .NET bits with the build-container based on dontnet CLI and Docker CLI, as explained in this page: https://github.com/dotnet/eShopOnContainers/wiki/04.-Setting-eShopOnContainer-solution-up-in-a-Mac,-VS-Code-and-CLI-environment--(dotnet-CLI,-Docker-CLI-and-VS-Code) 3. **CLI on Mac:** Build the .NET bits with the build-container based on dontnet CLI and Docker CLI, as explained in this page: https://github.com/dotnet/eShopOnContainers/wiki/04.-Setting-eShopOnContainer-solution-up-in-a-Mac,-VS-Code-and-CLI-environment--(dotnet-CLI,-Docker-CLI-and-VS-Code)
## Troubleshooting the SPA app when building from the CLI
The Docker image build could do npm install if needed, but this installs npm linux packages, not the windows ones. As the docker container used for build has a volume mapping with the source code, that means that the "node_modules" of the SPA web application ends having npm linux modules. In fact, windows & linux modules are the same (theyre node modules, so are in js) but windows modules have an additional .cmd file in the node_modules\.bin folder. This file is needed for all CLI-invokable modules (like webpack or rimraf). As linux modules do no have it, **if you build once with the docker image, and later do you want to build using the windows CLI you will get errors due to not having these files. Solution here is delete the "node_modules" folder and do an npm install (from Windows)**.
How to avoid having this issue?: doing an "npm install" from Windows BEFORE running the docker CI build, as documented here: https://github.com/dotnet/eShopOnContainers/wiki/03.-Setting-the-eShopOnContainers-solution-up-in-a-Windows-CLI-environment-(dotnet-CLI,-Docker-CLI-and-VS-Code)
Everytime you change from Linux based build (Docker) to a Windows based build (CLI) youll need to do “npm rebuild node-sass”. Our Docker compose ci.build file does it for you, but if you switch to windows, youll need to do it manually.
## Sending feedback and pull requests ## Sending feedback and pull requests
We'd appreciate to your feedback, improvements and ideas. We'd appreciate to your feedback, improvements and ideas.