geeklearningio / gl-vsts-tasks-yarn

Yarn Package Manager Visual Studio Team Services Build and Release Management extensions
MIT License
52 stars 18 forks source link

Error: ENOENT: no such file or directory, stat '../318.npmrc' #31

Closed IAMtheIAM closed 5 years ago

IAMtheIAM commented 6 years ago

I have .npmrc file in my repo at /frontend/.npmrc

// .npmrc

loglevel=error
color=true
registry=https://registry.npmjs.org/

I told the yarn task to use folder frontend

yarn_error

Then I get this error:

2017-10-06T17:07:39.9206165Z ##[section]Starting: Yarn Install (frontend)
2017-10-06T17:07:39.9206165Z ==============================================================================
2017-10-06T17:07:39.9206165Z Task         : Yarn task
2017-10-06T17:07:39.9206165Z Description  : Executes Yarn
2017-10-06T17:07:39.9206165Z Version      : 2.0.1002
2017-10-06T17:07:39.9206165Z Author       : Geek Learning
2017-10-06T17:07:39.9206165Z Help         : [More Information](https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Yarn) (Version 2.0.1002)
2017-10-06T17:07:39.9206165Z ==============================================================================
2017-10-06T17:07:40.8402446Z ##[warning]Resource file haven\'t set, can\'t find loc string for key: FoundLocalRegistries
2017-10-06T17:07:40.8402446Z ##[warning]Resource file haven\'t set, can\'t find loc string for key: SavingFile
2017-10-06T17:07:40.8402446Z ##[warning]generated npmrc is empty
2017-10-06T17:07:40.8412440Z ##[error]Error: ENOENT: no such file or directory, stat 'C:\dev\VSTS\CustomAgent01\_work\1\npm\318.npmrc'
2017-10-06T17:07:40.8572440Z ##[section]Finishing: Yarn Install (frontend)

What does it want me to do? Additionally, why do I have to set a registry in my npmrc? It should use the default

sandorfr commented 6 years ago

Yes I'm sadly aware of this one, I'm on it.

sandorfr commented 6 years ago

I've deployed a patch. Can you confirm it solved the issue for you as well?

IAMtheIAM commented 6 years ago

Ok, let me try it out...

IAMtheIAM commented 6 years ago

I just ran, and it does succeed to install the packages, but then my new script which uses those packages like 'webpack' or 'karma' fail, saying "karma is not recognized as an internal or external command". Normally I thought yarn should prepend node_modules to the path, like NPM does, so it is not needed to install globally.

In any case, I decided to install karma globally and then another error appears, mocha-clean is not a module. So there's is some problem with module resolution now, which didn't happen when using Yarn directly before, or when using NPM.

sandorfr commented 6 years ago

Good news that it's now restoring. Can you give me a bit more information on how you start your script and what kind of script it is (bash, cmd etc..)

IAMtheIAM commented 6 years ago

This is an example of my package.json

    "test": "npm run karma",
    "karma": "karma start",

npm run karma will run the script karma which then runs karma start

Same for webpack. So they are executed with the context of npm run and therefore expect node_modules to be appended to the path so that files in node_modules/.bin are available on the command line.

sandorfr commented 6 years ago

I have similar configurations for things such as angular cli and it work just fine. there must be something else messing with it in your build. If you can upload a sample repro somewhere I might be able to help

IAMtheIAM commented 6 years ago

OK I will try to narrow down and see whats going on.

Here is the full log output. Everything succeeds all the way until I get to my tslint script, which expects to be able to run from the node_modules/.bin folder. The same build script works fine If I use yarn directly instead of the task.

Initializing connection to Hosted Agent
 ##[section]Starting: Phase 1
 Current agent version: '2.123.0'
 ##[section]Starting: Initialize Job
 Prepare build directory.
 Set build variables.
 Download all required tasks.
 Downloading task: Npm
 Downloading task: YarnInstaller
 Downloading task: Yarn
 Downloading task: CopyFiles
 Downloading task: PublishBuildArtifacts
 ##[section]Finishing: Initialize Job
 ##[section]Starting: Get Sources
 Syncing repository: ss.Dashboard (TfsGit)
 Prepending Path environment variable with directory containing 'git.exe'.
 ##[command]git version
 git version 2.12.2.windows.3
 ##[command]git lfs version
 git-lfs/2.3.0 (GitHub; windows amd64; go 1.8.3; git 4dd2bf73)
 ##[command]git init "d:\a\1\s"
 Initialized empty Git repository in d:/a/1/s/.git/
 ##[command]git remote add origin https://ddev.visualstudio.com/ss/_git/ss.Dashboard
 ##[command]git config gc.auto 0
 ##[command]git config --get-all http.https://ddev.visualstudio.com/ss/_git/ss.Dashboard.extraheader
 ##[command]git config --get-all http.proxy
 ##[command]git -c http.extraheader="AUTHORIZATION: bearer ********" fetch --tags --prune --progress --no-recurse-submodules origin
 remote: 
 remote: vSTs 
 remote: vSTSVSTSv 
 remote: vSTSVSTSVST 
 remote: VSTS vSTSVSTSVSTSV 
 remote: VSTSVS vSTSVSTSV STSVS 
 remote: VSTSVSTSvsTSVSTSVS TSVST 
 remote: VS tSVSTSVSTSv STSVS 
 remote: VS tSVSTSVST SVSTS 
 remote: VS tSVSTSVSTSVSts VSTSV 
 remote: VSTSVST SVSTSVSTs VSTSV 
 remote: VSTSv STSVSTSVSTSVS 
 remote: VSTSVSTSVST 
 remote: VSTSVSTs 
 remote: VSTs (TM) 
 remote: 
 remote: Microsoft (R) Visual Studio (R) Team Services 
 remote: 
 remote: We noticed you're using an older version of Git. For the best experience, upgrade to a newer version. 
 remote: 
 remote: Found 9871 objects to send. (785 ms) 
 Receiving objects: 0% (1/9871) 
 Receiving objects: 1% (99/9871) 
 Receiving objects: 1% (105/9871), 12.36 MiB | 12.24 MiB/s 
 Receiving objects: 1% (105/9871), 41.68 MiB | 20.65 MiB/s 
 Receiving objects: 1% (141/9871), 51.67 MiB | 16.32 MiB/s 
 Receiving objects: 2% (198/9871), 65.80 MiB | 17.91 MiB/s 
 Receiving objects: 2% (203/9871), 65.80 MiB | 17.91 MiB/s 
 Receiving objects: 3% (297/9871), 65.80 MiB | 17.91 MiB/s 
 Receiving objects: 4% (395/9871), 65.80 MiB | 17.91 MiB/s 
 Receiving objects: 4% (424/9871), 74.23 MiB | 12.57 MiB/s 
 Receiving objects: 4% (427/9871), 89.10 MiB | 14.80 MiB/s 
 Receiving objects: 4% (427/9871), 117.97 MiB | 15.40 MiB/s 
 Receiving objects: 4% (428/9871), 126.84 MiB | 14.07 MiB/s 
 Receiving objects: 4% (476/9871), 134.65 MiB | 13.96 MiB/s 
 Receiving objects: 5% (494/9871), 134.65 MiB | 13.96 MiB/s 
 Receiving objects: 6% (593/9871), 134.65 MiB | 13.96 MiB/s 
 Receiving objects: 7% (691/9871), 140.52 MiB | 12.57 MiB/s 
 Receiving objects: 8% (790/9871), 140.52 MiB | 12.57 MiB/s 
 Receiving objects: 8% (873/9871), 140.52 MiB | 12.57 MiB/s 
 Receiving objects: 9% (889/9871), 146.08 MiB | 12.30 MiB/s 
 Receiving objects: 9% (952/9871), 151.64 MiB | 16.13 MiB/s 
 Receiving objects: 10% (988/9871), 151.64 MiB | 16.13 MiB/s 
 Receiving objects: 11% (1086/9871), 160.97 MiB | 15.00 MiB/s 
 Receiving objects: 12% (1185/9871), 160.97 MiB | 15.00 MiB/s 
 Receiving objects: 13% (1284/9871), 164.83 MiB | 12.57 MiB/s 
 Receiving objects: 14% (1382/9871), 164.83 MiB | 12.57 MiB/s 
 Receiving objects: 15% (1481/9871), 164.83 MiB | 12.57 MiB/s 
 Receiving objects: 16% (1580/9871), 164.83 MiB | 12.57 MiB/s 
 Receiving objects: 16% (1659/9871), 169.51 MiB | 10.53 MiB/s 
 Receiving objects: 17% (1679/9871), 169.51 MiB | 10.53 MiB/s 
 Receiving objects: 17% (1736/9871), 179.95 MiB | 10.82 MiB/s 
 Receiving objects: 18% (1777/9871), 179.95 MiB | 10.82 MiB/s 
 Receiving objects: 18% (1840/9871), 186.57 MiB | 11.22 MiB/s 
 Receiving objects: 19% (1876/9871), 194.13 MiB | 11.98 MiB/s 
 Receiving objects: 20% (1975/9871), 199.19 MiB | 11.82 MiB/s 
 Receiving objects: 20% (2039/9871), 206.63 MiB | 12.19 MiB/s 
 Receiving objects: 21% (2073/9871), 206.63 MiB | 12.19 MiB/s 
 Receiving objects: 22% (2172/9871), 206.63 MiB | 12.19 MiB/s 
 Receiving objects: 22% (2194/9871), 222.18 MiB | 11.31 MiB/s 
 Receiving objects: 23% (2271/9871), 222.18 MiB | 11.31 MiB/s 
 Receiving objects: 24% (2370/9871), 222.18 MiB | 11.31 MiB/s 
 Receiving objects: 25% (2468/9871), 222.18 MiB | 11.31 MiB/s 
 Receiving objects: 26% (2567/9871), 222.18 MiB | 11.31 MiB/s 
 Receiving objects: 26% (2605/9871), 222.18 MiB | 11.31 MiB/s 
 Receiving objects: 27% (2666/9871), 229.37 MiB | 11.79 MiB/s 
 Receiving objects: 28% (2764/9871), 234.99 MiB | 12.11 MiB/s 
 Receiving objects: 29% (2863/9871), 234.99 MiB | 12.11 MiB/s 
 Receiving objects: 30% (2962/9871), 234.99 MiB | 12.11 MiB/s 
 Receiving objects: 31% (3061/9871), 234.99 MiB | 12.11 MiB/s 
 Receiving objects: 32% (3159/9871), 234.99 MiB | 12.11 MiB/s 
 Receiving objects: 32% (3215/9871), 234.99 MiB | 12.11 MiB/s 
 Receiving objects: 33% (3258/9871), 234.99 MiB | 12.11 MiB/s 
 Receiving objects: 34% (3357/9871), 234.99 MiB | 12.11 MiB/s 
 Receiving objects: 35% (3455/9871), 239.93 MiB | 11.38 MiB/s 
 Receiving objects: 36% (3554/9871), 247.05 MiB | 11.54 MiB/s 
 Receiving objects: 36% (3618/9871), 247.05 MiB | 11.54 MiB/s 
 Receiving objects: 37% (3653/9871), 252.05 MiB | 11.06 MiB/s 
 Receiving objects: 38% (3751/9871), 252.05 MiB | 11.06 MiB/s 
 Receiving objects: 39% (3850/9871), 258.80 MiB | 11.32 MiB/s 
 Receiving objects: 39% (3860/9871), 258.80 MiB | 11.32 MiB/s 
 Receiving objects: 40% (3949/9871), 258.80 MiB | 11.32 MiB/s 
 Receiving objects: 41% (4048/9871), 266.04 MiB | 11.22 MiB/s 
 Receiving objects: 41% (4140/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 42% (4146/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 43% (4245/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 44% (4344/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 45% (4442/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 46% (4541/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 47% (4640/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 48% (4739/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 49% (4837/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 50% (4936/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 51% (5035/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 52% (5133/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 53% (5232/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 54% (5331/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 55% (5430/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 56% (5528/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 57% (5627/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 58% (5726/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 59% (5824/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 60% (5923/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 61% (6022/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 62% (6121/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 63% (6219/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 64% (6318/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 65% (6417/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 66% (6515/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 67% (6614/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 68% (6713/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 69% (6811/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 70% (6910/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 71% (7009/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 72% (7108/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 73% (7206/9871), 273.48 MiB | 12.79 MiB/s 
 Receiving objects: 74% (7305/9871), 281.23 MiB | 11.58 MiB/s 
 Receiving objects: 74% (7331/9871), 281.23 MiB | 11.58 MiB/s 
 Receiving objects: 75% (7404/9871), 288.54 MiB | 11.35 MiB/s 
 Receiving objects: 76% (7502/9871), 288.54 MiB | 11.35 MiB/s 
 Receiving objects: 76% (7510/9871), 296.16 MiB | 11.16 MiB/s 
 Receiving objects: 77% (7601/9871), 296.16 MiB | 11.16 MiB/s 
 Receiving objects: 77% (7645/9871), 303.84 MiB | 11.24 MiB/s 
 Receiving objects: 78% (7700/9871), 303.84 MiB | 11.24 MiB/s 
 Receiving objects: 78% (7775/9871), 315.47 MiB | 11.20 MiB/s 
 Receiving objects: 79% (7799/9871), 315.47 MiB | 11.20 MiB/s 
 Receiving objects: 80% (7897/9871), 322.03 MiB | 11.03 MiB/s 
 Receiving objects: 80% (7921/9871), 327.90 MiB | 10.95 MiB/s 
 Receiving objects: 81% (7996/9871), 327.90 MiB | 10.95 MiB/s 
 Receiving objects: 81% (8002/9871), 335.71 MiB | 8.73 MiB/s 
 Receiving objects: 81% (8030/9871), 363.97 MiB | 11.19 MiB/s 
 Receiving objects: 82% (8095/9871), 378.63 MiB | 12.73 MiB/s 
 Receiving objects: 83% (8193/9871), 378.63 MiB | 12.73 MiB/s 
 Receiving objects: 84% (8292/9871), 378.63 MiB | 12.73 MiB/s 
 Receiving objects: 85% (8391/9871), 378.63 MiB | 12.73 MiB/s 
 Receiving objects: 86% (8490/9871), 378.63 MiB | 12.73 MiB/s 
 Receiving objects: 87% (8588/9871), 378.63 MiB | 12.73 MiB/s 
 Receiving objects: 88% (8687/9871), 378.63 MiB | 12.73 MiB/s 
 Receiving objects: 89% (8786/9871), 378.63 MiB | 12.73 MiB/s 
 Receiving objects: 89% (8837/9871), 378.63 MiB | 12.73 MiB/s 
 Receiving objects: 90% (8884/9871), 383.63 MiB | 12.75 MiB/s 
 Receiving objects: 91% (8983/9871), 388.44 MiB | 12.43 MiB/s 
 Receiving objects: 91% (8998/9871), 388.44 MiB | 12.43 MiB/s 
 Receiving objects: 92% (9082/9871), 395.81 MiB | 12.79 MiB/s 
 Receiving objects: 92% (9172/9871), 402.56 MiB | 12.81 MiB/s 
 Receiving objects: 93% (9181/9871), 402.56 MiB | 12.81 MiB/s 
 Receiving objects: 93% (9204/9871), 409.31 MiB | 10.96 MiB/s 
 Receiving objects: 93% (9211/9871), 423.12 MiB | 14.93 MiB/s 
 Receiving objects: 93% (9211/9871), 449.36 MiB | 14.54 MiB/s 
 Receiving objects: 94% (9279/9871), 449.36 MiB | 14.54 MiB/s 
 Receiving objects: 95% (9378/9871), 449.36 MiB | 14.54 MiB/s 
 Receiving objects: 96% (9477/9871), 449.36 MiB | 14.54 MiB/s 
 Receiving objects: 97% (9575/9871), 449.36 MiB | 14.54 MiB/s 
 Receiving objects: 98% (9674/9871), 449.36 MiB | 14.54 MiB/s 
 Receiving objects: 99% (9773/9871), 449.36 MiB | 14.54 MiB/s 
 Receiving objects: 100% (9871/9871), 449.36 MiB | 14.54 MiB/s 
 Receiving objects: 100% (9871/9871), 458.43 MiB | 13.17 MiB/s, done.
 Resolving deltas: 0% (0/6130) 
 Resolving deltas: 1% (118/6130) 
 Resolving deltas: 2% (146/6130) 
 Resolving deltas: 3% (189/6130) 
 Resolving deltas: 4% (267/6130) 
 Resolving deltas: 5% (314/6130) 
 Resolving deltas: 6% (370/6130) 
 Resolving deltas: 7% (435/6130) 
 Resolving deltas: 8% (528/6130) 
 Resolving deltas: 9% (593/6130) 
 Resolving deltas: 10% (618/6130) 
 Resolving deltas: 11% (690/6130) 
 Resolving deltas: 12% (792/6130) 
 Resolving deltas: 13% (798/6130) 
 Resolving deltas: 14% (865/6130) 
 Resolving deltas: 15% (959/6130) 
 Resolving deltas: 16% (981/6130) 
 Resolving deltas: 17% (1063/6130) 
 Resolving deltas: 18% (1108/6130) 
 Resolving deltas: 19% (1183/6130) 
 Resolving deltas: 20% (1229/6130) 
 Resolving deltas: 21% (1288/6130) 
 Resolving deltas: 22% (1357/6130) 
 Resolving deltas: 23% (1421/6130) 
 Resolving deltas: 24% (1480/6130) 
 Resolving deltas: 25% (1539/6130) 
 Resolving deltas: 26% (1608/6130) 
 Resolving deltas: 27% (1665/6130) 
 Resolving deltas: 28% (1732/6130) 
 Resolving deltas: 29% (1778/6130) 
 Resolving deltas: 29% (1818/6130) 
 Resolving deltas: 30% (1842/6130) 
 Resolving deltas: 31% (1908/6130) 
 Resolving deltas: 32% (1968/6130) 
 Resolving deltas: 33% (2023/6130) 
 Resolving deltas: 34% (2086/6130) 
 Resolving deltas: 35% (2149/6130) 
 Resolving deltas: 36% (2242/6130) 
 Resolving deltas: 37% (2276/6130) 
 Resolving deltas: 38% (2330/6130) 
 Resolving deltas: 39% (2395/6130) 
 Resolving deltas: 40% (2457/6130) 
 Resolving deltas: 41% (2517/6130) 
 Resolving deltas: 42% (2575/6130) 
 Resolving deltas: 43% (2657/6130) 
 Resolving deltas: 44% (2711/6130) 
 Resolving deltas: 45% (2764/6130) 
 Resolving deltas: 46% (2821/6130) 
 Resolving deltas: 47% (2902/6130) 
 Resolving deltas: 48% (2945/6130) 
 Resolving deltas: 49% (3008/6130) 
 Resolving deltas: 50% (3066/6130) 
 Resolving deltas: 51% (3128/6130) 
 Resolving deltas: 53% (3298/6130) 
 Resolving deltas: 54% (3320/6130) 
 Resolving deltas: 56% (3473/6130) 
 Resolving deltas: 57% (3497/6130) 
 Resolving deltas: 58% (3599/6130) 
 Resolving deltas: 60% (3702/6130) 
 Resolving deltas: 62% (3829/6130) 
 Resolving deltas: 63% (3870/6130) 
 Resolving deltas: 64% (3937/6130) 
 Resolving deltas: 65% (4000/6130) 
 Resolving deltas: 66% (4047/6130) 
 Resolving deltas: 67% (4120/6130) 
 Resolving deltas: 68% (4174/6130) 
 Resolving deltas: 69% (4230/6130) 
 Resolving deltas: 70% (4291/6130) 
 Resolving deltas: 71% (4353/6130) 
 Resolving deltas: 72% (4415/6130) 
 Resolving deltas: 73% (4482/6130) 
 Resolving deltas: 74% (4545/6130) 
 Resolving deltas: 75% (4612/6130) 
 Resolving deltas: 76% (4716/6130) 
 Resolving deltas: 77% (4730/6130) 
 Resolving deltas: 78% (4785/6130) 
 Resolving deltas: 79% (4844/6130) 
 Resolving deltas: 80% (4906/6130) 
 Resolving deltas: 81% (4967/6130) 
 Resolving deltas: 82% (5028/6130) 
 Resolving deltas: 83% (5089/6130) 
 Resolving deltas: 84% (5151/6130) 
 Resolving deltas: 85% (5212/6130) 
 Resolving deltas: 86% (5277/6130) 
 Resolving deltas: 87% (5338/6130) 
 Resolving deltas: 87% (5375/6130) 
 Resolving deltas: 88% (5455/6130) 
 Resolving deltas: 89% (5496/6130) 
 Resolving deltas: 90% (5518/6130) 
 Resolving deltas: 91% (5581/6130) 
 Resolving deltas: 92% (5656/6130) 
 Resolving deltas: 93% (5702/6130) 
 Resolving deltas: 94% (5775/6130) 
 Resolving deltas: 95% (5824/6130) 
 Resolving deltas: 96% (5891/6130) 
 Resolving deltas: 97% (5958/6130) 
 Resolving deltas: 98% (6025/6130) 
 Resolving deltas: 99% (6076/6130) 
 Resolving deltas: 100% (6130/6130) 
 Resolving deltas: 100% (6130/6130), done.
 From https://ddev.visualstudio.com/ss/_git/ss.Dashboard
 * [new branch] dev -> origin/dev
 * [new branch] master -> origin/master
 ##[command]git checkout --progress --force 2a511815fb6b5e332791b9560f5c26965f745127
 Note: checking out '2a511815fb6b5e332791b9560f5c26965f745127'.

 You are in 'detached HEAD' state. You can look around, make experimental
 changes and commit them, and you can discard any commits you make in this
 state without impacting any branches by performing another checkout.

 If you want to create a new branch to retain commits you create, you may
 do so (now or later) by using -b with the checkout command again. Example:

 git checkout -b <new-branch-name>

 HEAD is now at 2a51181... Switch nodejs APIs to Header authorization instead of query params, remove post methods, update mockdata with latest, add getpackages route parameter method, update npm scripts
 ##[section]Finishing: Get Sources
 ##[section]Starting: npm run clean
 ==============================================================================
 Task : npm
 Description : Install and publish npm packages, or run an npm command. Supports npmjs.com and authenticated registries like Package Management.
 Version : 1.0.7
 Author : Microsoft Corporation
 Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613746)
 ==============================================================================
 [command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\nodejs\npm.cmd" config list"
 ; cli configs
 user-agent = "npm/3.10.10 node/v6.10.0 win32 x64"

 ; environment configs
 cache = "C:\\NPM\\Cache"
 prefix = "C:\\NPM\\Modules"
 userconfig = "d:\\a\\1\\npm\\534.npmrc"

 ; project config d:\a\1\s\frontend\.npmrc
 color = true
 loglevel = "error"
 registry = "https://registry.npmjs.org/"

 ; builtin config undefined

 ; node bin location = C:\Program Files\nodejs\node.exe
 ; cwd = d:\a\1\s\frontend
 ; HOME = C:\Users\buildguest
 ; "npm config ls -l" to show all defaults.

 [command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\nodejs\npm.cmd" run clean"

 > ui@2.6.0 clean d:\a\1\s\frontend
 > node rimraf.js -- compiled node_modules .cache ../backend-nodejs/node_modules ../backend-nodejs/wwwroot ../backend-nodejs/build

 ##[section]Finishing: npm run clean
 ##[section]Starting: Use Yarn 1.x
 ==============================================================================
 Task : Yarn Tool Installer
 Description : Installs a version of Yarn
 Version : 2.3.999
 Author : Geek Learning
 Help : [More Information](https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Yarn) (Version 2.3.999)
 ==============================================================================
 Caching tool: yarn 1.2.1 x64
 Prepending PATH environment variable with directory: d:\a\_tool\yarn\1.2.1\x64
 Prepending PATH environment variable with directory: d:\a\_tool\yarn\1.2.1\x64\yarn-v1.2.1\bin
 ##[section]Finishing: Use Yarn 1.x
 ##[section]Starting: npm run tfs:install:globals
 ==============================================================================
 Task : npm
 Description : Install and publish npm packages, or run an npm command. Supports npmjs.com and authenticated registries like Package Management.
 Version : 1.0.7
 Author : Microsoft Corporation
 Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613746)
 ==============================================================================
 [command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\nodejs\npm.cmd" config list"
 ; cli configs
 user-agent = "npm/3.10.10 node/v6.10.0 win32 x64"

 ; environment configs
 cache = "C:\\NPM\\Cache"
 prefix = "C:\\NPM\\Modules"
 userconfig = "d:\\a\\1\\npm\\534.npmrc"

 ; project config d:\a\1\s\frontend\.npmrc
 color = true
 loglevel = "error"
 registry = "https://registry.npmjs.org/"

 ; builtin config undefined

 ; node bin location = C:\Program Files\nodejs\node.exe
 ; cwd = d:\a\1\s\frontend
 ; HOME = C:\Users\buildguest
 ; "npm config ls -l" to show all defaults.

 [command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\nodejs\npm.cmd" run tfs:install:globals"

 > ss-ui@2.6.0 pretfs:install:globals d:\a\1\s\frontend
 > npm run install-msg:globals && npm config set python python2.7 && npm config set prefix %APPDATA%/npm && npm config set cache %APPDATA%/npm-cache && npm config set msvs_version 2017 --global

 > ss-ui@2.6.0 install-msg:globals d:\a\1\s\frontend
 > echo 

 ==============================================

 Installing Global NPM packages... 

 ==============================================

 ECHO is on.

 > ss-ui@2.6.0 tfs:install:globals d:\a\1\s\frontend
 > npm install yarn-install -g --no-optional --depth 0

 C:\NPM\Modules\yarn-install -> C:\NPM\Modules\node_modules\yarn-install\bin\yarn-install.js
 C:\NPM\Modules\yarn-remove -> C:\NPM\Modules\node_modules\yarn-install\bin\yarn-remove.js
 C:\NPM\Modules
 `-- yarn-install@0.5.1 

 ##[section]Finishing: npm run tfs:install:globals
 ##[section]Starting: Yarn Install (frontend)
 ==============================================================================
 Task : Yarn task
 Description : Executes Yarn
 Version : 2.3.999
 Author : Geek Learning
 Help : [More Information](https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Yarn) (Version 2.3.999). Dear Angular and Ember CLI users, please check our [known issues](https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Known-Issues)
 ==============================================================================
 [command]C:\Windows\system32\cmd.exe /D /S /C "d:\a\_tool\yarn\1.2.1\x64\yarn-v1.2.1\bin\yarn.cmd --production install"
 yarn install v1.2.1
 [1/5] Validating package.json...
 [2/5] Resolving packages...
 [3/5] Fetching packages...
 info fsevents@1.1.2: The platform "win32" is incompatible with this module.
 info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
 [4/5] Linking dependencies...
 [5/5] Building fresh packages...
 Done in 132.01s.
 ##[section]Finishing: Yarn Install (frontend)
 ##[section]Starting: Yarn Install (backend-nodejs)
 ==============================================================================
 Task : Yarn task
 Description : Executes Yarn
 Version : 2.3.999
 Author : Geek Learning
 Help : [More Information](https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Yarn) (Version 2.3.999). Dear Angular and Ember CLI users, please check our [known issues](https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Known-Issues)
 ==============================================================================
 [command]C:\Windows\system32\cmd.exe /D /S /C "d:\a\_tool\yarn\1.2.1\x64\yarn-v1.2.1\bin\yarn.cmd --production install"
 yarn install v1.2.1
 [1/5] Validating package.json...
 [2/5] Resolving packages...
 [3/5] Fetching packages...
 info fsevents@1.1.2: The platform "win32" is incompatible with this module.
 info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
 [4/5] Linking dependencies...
 [5/5] Building fresh packages...
 Done in 20.88s.
 ##[section]Finishing: Yarn Install (backend-nodejs)
 ##[section]Starting: npm run tfs:build:production
 ==============================================================================
 Task : npm
 Description : Install and publish npm packages, or run an npm command. Supports npmjs.com and authenticated registries like Package Management.
 Version : 1.0.7
 Author : Microsoft Corporation
 Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613746)
 ==============================================================================
 [command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\nodejs\npm.cmd" config list"
 ; cli configs
 user-agent = "npm/3.10.10 node/v6.10.0 win32 x64"

 ; environment configs
 cache = "C:\\NPM\\Cache"
 prefix = "C:\\NPM\\Modules"
 userconfig = "d:\\a\\1\\npm\\534.npmrc"

 ; project config d:\a\1\s\frontend\.npmrc
 color = true
 loglevel = "error"
 registry = "https://registry.npmjs.org/"

 ; globalconfig C:\NPM\Modules\etc\npmrc
 msvs_version = "2017"

 ; builtin config undefined

 ; node bin location = C:\Program Files\nodejs\node.exe
 ; cwd = d:\a\1\s\frontend
 ; HOME = C:\Users\buildguest
 ; "npm config ls -l" to show all defaults.

 [command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\nodejs\npm.cmd" run tfs:build:production"

 > ss-ui@2.6.0 tfs:build:production d:\a\1\s\frontend
 > npm run tfs-msg:welcome && npm run precommit-msg:lint && npm run lint && npm run tfs-msg:unit-tests && npm run karma && npm run compile-ngc:cli:build-production:aot && npm run make:zipdir

 > ss-ui@2.6.0 tfs-msg:welcome d:\a\1\s\frontend
 > echo 

 ==============================================

 Starting TFS Build process for Production... 

 ==============================================

 ECHO is on.

 > ss-ui@2.6.0 precommit-msg:lint d:\a\1\s\frontend
 > echo 

 ==============================================

 Running Linter... 

 ==============================================

 ECHO is on.

 > ss-ui@2.6.0 lint d:\a\1\s\frontend
 > npm run tslint && npm run eslint

 > ss-ui@2.6.0 tslint d:\a\1\s\frontend
 > tslint --exclude node_modules --fix "./src/**/*.ts" "./config/**/*.ts" "*.ts"

 'tslint' is not recognized as an internal or external command,
 operable program or batch file.

 npm ERR! Windows_NT 10.0.14393
 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "tslint"
 npm ERR! node v6.10.0
 npm ERR! npm v3.10.10
 npm ERR! code ELIFECYCLE
 npm ERR! ss-ui@2.6.0 tslint: `tslint --exclude node_modules --fix "./src/**/*.ts" "./config/**/*.ts" "*.ts"`
 npm ERR! Exit status 1
 npm ERR! 
 npm ERR! Failed at the ss-ui@2.6.0 tslint script 'tslint --exclude node_modules --fix "./src/**/*.ts" "./config/**/*.ts" "*.ts"'.
 npm ERR! Make sure you have the latest version of node.js and npm installed.
 npm ERR! If you do, this is most likely a problem with the ss-ui package,
 npm ERR! not with npm itself.
 npm ERR! Tell the author that this fails on your system:
 npm ERR! tslint --exclude node_modules --fix "./src/**/*.ts" "./config/**/*.ts" "*.ts"
 npm ERR! You can get information on how to open an issue for this project with:
 npm ERR! npm bugs ss-ui
 npm ERR! Or if that isn't available, you can get their info via:
 npm ERR! npm owner ls ss-ui
 npm ERR! There is likely additional logging output above.

 npm ERR! Please include the following file with any support request:
 npm ERR! d:\a\1\s\frontend\npm-debug.log

 npm ERR! Windows_NT 10.0.14393
 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "lint"
 npm ERR! node v6.10.0
 npm ERR! npm v3.10.10
 npm ERR! code ELIFECYCLE
 npm ERR! ss-ui@2.6.0 lint: `npm run tslint && npm run eslint`
 npm ERR! Exit status 1
 npm ERR! 
 npm ERR! Failed at the ss-ui@2.6.0 lint script 'npm run tslint && npm run eslint'.
 npm ERR! Make sure you have the latest version of node.js and npm installed.
 npm ERR! If you do, this is most likely a problem with the ss-ui package,
 npm ERR! not with npm itself.
 npm ERR! Tell the author that this fails on your system:
 npm ERR! npm run tslint && npm run eslint
 npm ERR! You can get information on how to open an issue for this project with:
 npm ERR! npm bugs ss-ui
 npm ERR! Or if that isn't available, you can get their info via:
 npm ERR! npm owner ls ss-ui
 npm ERR! There is likely additional logging output above.

 npm ERR! Please include the following file with any support request:
 npm ERR! d:\a\1\s\frontend\npm-debug.log

 npm ERR! Windows_NT 10.0.14393
 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "tfs:build:production"
 npm ERR! node v6.10.0
 npm ERR! npm v3.10.10
 npm ERR! code ELIFECYCLE
 npm ERR! ss-ui@2.6.0 tfs:build:production: `npm run tfs-msg:welcome && npm run precommit-msg:lint && npm run lint && npm run tfs-msg:unit-tests && npm run karma && npm run compile-ngc:cli:build-production:aot && npm run make:zipdir`
 npm ERR! Exit status 1
 npm ERR! 
 npm ERR! Failed at the ss-ui@2.6.0 tfs:build:production script 'npm run tfs-msg:welcome && npm run precommit-msg:lint && npm run lint && npm run tfs-msg:unit-tests && npm run karma && npm run compile-ngc:cli:build-production:aot && npm run make:zipdir'.
 npm ERR! Make sure you have the latest version of node.js and npm installed.
 npm ERR! If you do, this is most likely a problem with the ss-ui package,
 npm ERR! not with npm itself.
 npm ERR! Tell the author that this fails on your system:
 npm ERR! npm run tfs-msg:welcome && npm run precommit-msg:lint && npm run lint && npm run tfs-msg:unit-tests && npm run karma && npm run compile-ngc:cli:build-production:aot && npm run make:zipdir
 npm ERR! You can get information on how to open an issue for this project with:
 npm ERR! npm bugs ss-ui
 npm ERR! Or if that isn't available, you can get their info via:
 npm ERR! npm owner ls ss-ui
 npm ERR! There is likely additional logging output above.

 npm ERR! Please include the following file with any support request:
 npm ERR! d:\a\1\s\frontend\npm-debug.log
 Found npm debug log, make sure the path matches with the one in npm's output: d:\a\1\s\frontend\npm-debug.log
 0 info it worked if it ends with ok
 1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
 1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
 1 verbose cli 'run',
 1 verbose cli 'tfs:build:production' ]
 2 info using npm@3.10.10
 3 info using node@v6.10.0
 4 verbose run-script [ 'pretfs:build:production',
 4 verbose run-script 'tfs:build:production',
 4 verbose run-script 'posttfs:build:production' ]
 5 info lifecycle ss-ui@2.6.0~pretfs:build:production: ss-ui@2.6.0
 6 silly lifecycle ss-ui@2.6.0~pretfs:build:production: no script for pretfs:build:production, continuing
 7 info lifecycle ss-ui@2.6.0~tfs:build:production: ss-ui@2.6.0
 8 verbose lifecycle ss-ui@2.6.0~tfs:build:production: unsafe-perm in lifecycle true
 9 verbose lifecycle ss-ui@2.6.0~tfs:build:production: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;d:\a\1\s\frontend\node_modules\.bin;d:\a\_tool\yarn\1.2.1\x64\yarn-v1.2.1\bin;d:\a\_tool\yarn\1.2.1\x64;C:\LR\mms\Services\Mms\Provisioner\TaskAgent\agents\2.123.0\externals\git\cmd;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\Program Files\Microsoft MPI\Bin\;C:\Program Files (x86)\Python36-32\Scripts\;C:\Program Files (x86)\Python36-32\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\nodejs\;C:\Users\VssAdministrator\AppData\Local\Microsoft\WindowsApps;C:\NPM\Modules;C:\Program Files\Git LFS;C:\Program Files\CMake\bin;C:\java\ant\apache-ant-1.9.7\bin;C:\java\maven\apache-maven-3.2.2\bin;C:\Program Fi...
 10 verbose lifecycle ss-ui@2.6.0~tfs:build:production: CWD: d:\a\1\s\frontend
 11 silly lifecycle ss-ui@2.6.0~tfs:build:production: Args: [ '/d /s /c',
 11 silly lifecycle 'npm run tfs-msg:welcome && npm run precommit-msg:lint && npm run lint && npm run tfs-msg:unit-tests && npm run karma && npm run compile-ngc:cli:build-production:aot && npm run make:zipdir' ]
 12 silly lifecycle ss-ui@2.6.0~tfs:build:production: Returned: code: 1 signal: null
 13 info lifecycle ss-ui@2.6.0~tfs:build:production: Failed to exec tfs:build:production script
 14 verbose stack Error: ss-ui@2.6.0 tfs:build:production: `npm run tfs-msg:welcome && npm run precommit-msg:lint && npm run lint && npm run tfs-msg:unit-tests && npm run karma && npm run compile-ngc:cli:build-production:aot && npm run make:zipdir`
 14 verbose stack Exit status 1
 14 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
 14 verbose stack at emitTwo (events.js:106:13)
 14 verbose stack at EventEmitter.emit (events.js:191:7)
 14 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
 14 verbose stack at emitTwo (events.js:106:13)
 14 verbose stack at ChildProcess.emit (events.js:191:7)
 14 verbose stack at maybeClose (internal/child_process.js:877:16)
 14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
 15 verbose pkgid ss-ui@2.6.0
 16 verbose cwd d:\a\1\s\frontend
 17 error Windows_NT 10.0.14393
 18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "tfs:build:production"
 19 error node v6.10.0
 20 error npm v3.10.10
 21 error code ELIFECYCLE
 22 error ss-ui@2.6.0 tfs:build:production: `npm run tfs-msg:welcome && npm run precommit-msg:lint && npm run lint && npm run tfs-msg:unit-tests && npm run karma && npm run compile-ngc:cli:build-production:aot && npm run make:zipdir`
 22 error Exit status 1
 23 error Failed at the ss-ui@2.6.0 tfs:build:production script 'npm run tfs-msg:welcome && npm run precommit-msg:lint && npm run lint && npm run tfs-msg:unit-tests && npm run karma && npm run compile-ngc:cli:build-production:aot && npm run make:zipdir'.
 23 error Make sure you have the latest version of node.js and npm installed.
 23 error If you do, this is most likely a problem with the ss-ui package,
 23 error not with npm itself.
 23 error Tell the author that this fails on your system:
 23 error npm run tfs-msg:welcome && npm run precommit-msg:lint && npm run lint && npm run tfs-msg:unit-tests && npm run karma && npm run compile-ngc:cli:build-production:aot && npm run make:zipdir
 23 error You can get information on how to open an issue for this project with:
 23 error npm bugs ss-ui
 23 error Or if that isn't available, you can get their info via:
 23 error npm owner ls ss-ui
 23 error There is likely additional logging output above.
 24 verbose exit [ 1, true ]

 ##[error]Error: C:\Program Files\nodejs\npm.cmd failed with return code: 1
 ##[section]Finishing: npm run tfs:build:production
 ##[section]Starting: Post Job Cleanup
 Cleaning any cached credential from repository: ss.Dashboard (Git)
 ##[command]git remote set-url origin https://ddev.visualstudio.com/ss/_git/ss.Dashboard
 ##[command]git remote set-url --push origin https://ddev.visualstudio.com/ss/_git/ss.Dashboard
 ##[section]Finishing: Post Job Cleanup
 ##[section]Finishing: Phase 1
IAMtheIAM commented 6 years ago

Here is my NPM scripts, kind of a lot but maybe it will help.

 "scripts": {
    "devserver:jit": "cross-env NODE_ENV=development webpack-dev-server --profile --inline --hot --compress --progress --content-base wwwroot",
    "gulp": "gulp",
    "ios-webkit-debug-proxy": "ios_webkit_debug_proxy",
    "browser-sync:websever": "browser-sync start --proxy localhost:5000 --port 8000",
    "browser-sync:webpack-dev-server": "browser-sync start --proxy localhost:4000 --port 4001",
    "compile-ngc-msg": "echo \n\n==============================================\n\n Compiling Angular in AOT mode... \n\n==============================================\n\n",
    "compile-ngc:webpack:build-debug:aot": "npm run compile-ngc-msg && npm run clean:compile && npm run build:debug:aot:watch",
    "compile-ngc:webpack:build-production:aot": "npm run compile-ngc-msg && npm run clean:compile && npm run build:production:aot",
    "compile-ngc:cli:build-debug:aot": "npm run compile-ngc-msg && npm run clean:compile && npm run compile:aot && npm run build:debug:aot",
    "compile-ngc:cli:build-production:aot": "npm run compile-ngc-msg && npm run clean:compile && npm run compile:aot && npm run build:production:aot",
    "compile:aot": "./node_modules/.bin/ngc -p ./tsconfig.ngc.json",
    "compile:aot:ngc-webpack": "cross-env NODE_ENV=production ngc-w -p ./tsconfig.ngc.json --webpack ./webpack.config.ts",
    "build-msg:pre-build": "echo \n\n==============================================\n\n Running Webpack Build... \n\n==============================================\n\n",
    "build-msg:post-build": "echo \n\n==============================================\n\n Webpack Build Succeeded! \n\n==============================================\n\n",
    "build:debug": "npm run build-msg:pre-build && npm run clean:compile && npm run clean:wwwroot && cross-env NODE_ENV=debug webpack --hot --profile --colors --display-cached && npm run build-msg:post-build",
    "build:debug:aot": "npm run build-msg:pre-build && npm run clean:wwwroot && cross-env NODE_ENV=debug webpack --hot --profile --colors --display-cached && npm run build-msg:post-build",
    "build:debug:jit": "npm run build-msg:pre-build && npm run clean:wwwroot && cross-env NODE_ENV=debug webpack --hot --profile --colors --display-cached && npm run build-msg:post-build",
    "build:debug:aot:watch": "npm run build-msg:pre-build && npm run build:debug:aot -- --watch && npm run build-msg:post-build",
    "build:debug:jit:watch": "npm run build-msg:pre-build && npm run build:debug:jit -- --watch && npm run build-msg:post-build",
    "build:production": "npm run build-msg:pre-build && npm run clean:wwwroot && cross-env NODE_ENV=production webpack --profile --colors --display-cached --bail && npm run build-msg:post-build",
    "build:production:aot": "npm run build-msg:pre-build && npm run clean:wwwroot && cross-env NODE_ENV=production webpack --profile --colors --display-cached --bail && npm run build-msg:post-build",
    "build:production:jit": "npm run build-msg:pre-build && npm run build:production && npm run build-msg:post-build",
    "build:production:jit:watch": "npm run build-msg:pre-build && npm run build:production -- --watch && npm run build-msg:post-build",
    "build:stats:aot": "npm run build-msg:pre-build && cross-env STATS=true npm run build:production:aot && npm run build-msg:post-build",
    "build:stats:jit": "npm run build-msg:pre-build && cross-env STATS=true npm run devserver:jit && npm run build-msg:post-build",
    "precompile:aot": "npm run clean:compile",
    "clean:node_modules": "node rimraf.js -- frontend/node_modules/*",
    "clean": "node rimraf.js -- compiled node_modules .cache ../backend-nodejs/node_modules ../backend-nodejs/wwwroot ../backend-nodejs/build",
    "clean:cache": "node rimraf.js -- .cache",
    "preclean:install:globals": "npm run install:globals:all",
    "clean:install:globals": "npm run clean && npm run install:packages",
    "clean:install": "npm run clean && npm run install:packages",
    "clean:wwwroot": "node rimraf.js -- ../backend-nodejs/wwwroot/js ../backend-nodejs/wwwroot/assets ../backend-nodejs/wwwroot/css",
    "clean:wwwroot:dlls": "node rimraf.js -- ../backend-nodejs/wwwroot/dlls",
    "clean:tsccompile": "npm run clean:tsccompile:misc && npm run clean:tsccompile:js",
    "clean:tsccompile:misc": "cd ./src && del *.ngfactory.ts *.ngfactory.js *.js.map *.metadata.json *.ngfactory.json *.ngsummary.json *.ngsummary.ts /s",
    "clean:tsccompile:js": "cd ./src/app-components && del *.js /s",
    "clean:compile": "node rimraf.js -- compiled",
    "ci": "npm run lint && npm run test",
    "devserver": "npm run devserver:aot",
    "docs": "npm run typedoc -- --options typedoc.json --exclude '**/*.spec.ts' ./src/",
    "pree2e": "npm run webdriver:update -- --standalone",
    "e2e": "npm run protractor",
    "e2e:live": "npm run e2e -- --elementExplorer",
    "pree2e:server": "npm run webdriver:update -- --standalone && node spawner.js fork \"cd ../backend-nodejs && npm run server:production\" && cd ../frontend",
    "e2e:server": "npm run protractor",
    "eslint": "eslint --fix ./src/*.js ./config/*.js *.js ./src-examples/*.js",
    "install:packages": "npm run install-msg:packages && npm run install:packages:yarn",
    "install:packages:npm": "npm install --quiet",
    "postinstall:packages:npm": "cd ../backend-nodejs && npm install",
    "install:packages:yarn": "yarn-install --ignore-engines",
    "postinstall:packages:yarn": "cd ../backend-nodejs && yarn-install --ignore-engines",
    "install-msg:globals:scoop": "echo \n\n==============================================\n\n Installing Scoop and Scoop packages... \n\n==============================================\n\n",
    "install-msg:globals": "echo \n\n==============================================\n\n Installing Global NPM packages... \n\n==============================================\n\n",
    "install-msg:packages": "echo \n\n==============================================\n\n Installing Local NPM packages... \n\n==============================================\n\n",
    "install-msg:update:npm": "echo \n\n==============================================\n\n Updating NPM version to Latest... \n\n==============================================\n\n",
    "install:scoop:all": "npm run install:scoop && npm run install:yarn && npm run install-ios-webkit-debug-proxy",
    "install:scoop": "npm run install-msg:globals:scoop && npm run install:powershellscript:scoop",
    "preinstall:globals:all": "npm run install-msg:globals && npm config set python python2.7 && npm config set msvs_version 2017 --global",
    "install:globals:all": "npm install yarn-install nodemon rimraf -g  --no-optional --depth 0",
    "install-ios-webkit-debug-proxy": "scoop bucket add extras && scoop install ios-webkit-debug-proxy",
    "install:powershellscript:scoop": "node ./config/tools/PowerShell/install-scoop.js",
    "install:powershellscript:update-npm": "node ./config/tools/PowerShell/update-npm.js",
    "install:yarn": "scoop install yarn",
    "install:githook:pre-push": "node rimraf.js ../.git/hooks/pre-push && mklink /H \"../.git/hooks/pre-push\" \"config/git-hooks/pre-push.sh\"",
    "install:githook:pre-commit": "node rimraf.js ../.git/hooks/pre-commit && mklink /H \"../.git/hooks/pre-commit\" \"config/git-hooks/pre-commit.sh\"",
    "tfs:install": "npm run install:packages",
    "tfs:install:clean": "npm run clean:install",
    "pretfs:install:globals": "npm run install-msg:globals && npm config set python python2.7 && npm config set prefix %APPDATA%/npm && npm config set cache %APPDATA%/npm-cache && npm config set msvs_version 2017 --global",
    "tfs:install:globals": "npm install yarn-install -g --no-optional --depth 0",
    "tfs:build:production": "npm run tfs-msg:welcome && npm run precommit-msg:lint && npm run lint && npm run tfs-msg:unit-tests && npm run karma && npm run compile-ngc:cli:build-production:aot && npm run make:zipdir",
    "tfs-msg:unit-tests": "echo \n\n==============================================\n\n Running Karma Unit Tests... \n\n==============================================\n\n",
    "tfs-msg:welcome": "echo \n\n==============================================\n\n Starting TFS Build process for Production... \n\n==============================================\n\n",
    "karma": "karma start",
    "karma:browser": "karma start --browsers Chrome",
    "launch:Debug": "npm version",
    "launch:Release": "npm run tfs:build:production",
    "launch:~JIT.Dev-Webpack.Dev.Server": "node spawner.js fork \"npm run devserver:jit\"",
    "launch:~JIT.Dev-Build.Dev.Watch.Changes": "node spawner.js fork \"npm run build:debug:jit:watch\"",
    "launch:~JIT.Prod-Compile+Build.Prod.Watch.Changes": "node spawner.js fork \"npm run compile:build-production:jit:watch\"",
    "launch:~AOT.Prod-Compile+Build.Prod": "npm run compile-ngc:cli:build-production:aot",
    "launch:Tests-E2E": "start npm run e2e",
    "launch:Tests-Unit": "start npm run karma",
    "lint": "npm run tslint && npm run eslint",
    "postlint": "cd ../backend-nodejs && npm run lint",
    "onetimesetup": "npm run install:scoop:all && npm run install:globals:all && npm run install:packages && npm run compile-ngc:cli:build-debug:aot",
    "postonetimesetup": "npm run install:githook:pre-push && npm run install:githook:pre-commit",
    "preprotractor": "tsc -p ./tsconfig.test.json",
    "protractor": "protractor ./config/protractor.config.js",
    "postprotractor": "node rimraf ./config/protractor.config.js ./config/webpack-helpers.js",
    "rimraf:standalone": "node rimraf.js",
    "run-powershellscript-example": "node ../PowerShell/RunPowerShellScript.js",
    "server:all": "start npm run devserver:aot & npm run apiserver",
    "start": "gulp",
    "test": "npm run karma && npm run e2e:server",
    "test:browser": "npm run karma:browser && npm run e2e:server",
    "tslint": "tslint --exclude node_modules --fix \"./src/**/*.ts\" \"./config/**/*.ts\" \"*.ts\"",
    "typedoc": "typedoc",
    "watch": "start npm run watch:dev",
    "watch:dev": "start npm run build:debug:jit -- --watch",
    "watch:dev:hmr": "start npm run watch:dev -- --hot",
    "watch:Release": "start npm run build:production:aot -- --watch",
    "watch:test": "start npm run karma -- --auto-watch --no-single-run",
    "webdriver:start": "npm run webdriver-manager start",
    "webdriver:update": "webdriver-manager update",
    "webdriver-manager": "webdriver-manager",
    "webpack": "webpack",
    "webpack-dev-server": "webpack-dev-server",
    "stage:wwwroot": "npm run precommit-msg:staging:wwwroot && node ./config/tools/getCurrentDirectory.js && cd ../ && node ./frontend/config/tools/getCurrentDirectory.js && git add ./backend-nodejs/wwwroot",
    "stage:coverage": "node ./config/tools/getCurrentDirectory.js && cd ../ && node ./frontend/config/tools/getCurrentDirectory.js && git add ./frontend/coverage",
    "make:zipdir": "cd ../backend-nodejs && npm run precommit:backend && cd ../frontend",
    "prepush:disabled": "npm run precommit-msg:welcome && npm run precommit-msg:ci && npm run ci && npm run precommit-msg:stage:coverage && npm run stage:coverage && npm run precommit-msg:build-prod && npm run compile-ngc:cli:build-production:aot && npm run stage:wwwroot && npm run make:zipdir",
    "precommit": "npm run precommit-msg:welcome && npm run precommit-msg:lint && npm run lint && npm run precommit-msg:stage:coverage && npm run stage:coverage && npm run precommit-msg:build-debug && npm run compile-ngc:cli:build-debug:aot && npm run stage:wwwroot && npm run make:zipdir",
    "precommit-msg:welcome": "echo \n\n==============================================\n\n Starting Husky: Git hooks made easy... \n\n==============================================\n\n",
    "precommit-msg:ci": "echo \n\n==============================================\n\n Running CI tests... \n\n==============================================\n\n",
    "precommit-msg:lint": "echo \n\n==============================================\n\n Running Linter... \n\n==============================================\n\n",
    "precommit-msg:build-debug": "echo \n\n==============================================\n\n Running \"compile-ngc:cli:build-debug:aot\" to generate Angular App (AOT Debug Mode). The 'pre-commit' git hook is configured to run on any branch EXCEPT 'Master' \n\n==============================================\n\n",
    "precommit-msg:build-prod": "echo \n\n==============================================\n\n Running \"compile-ngc:cli:build-production:aot\" to generate Angular App (AOT Production Mode).  The 'pre-push' git hook is configured to run ONLY on the 'Master' branch. \n\n==============================================\n\n",
    "precommit-msg:staging:wwwroot": "echo \n\n==============================================\n\n Staging \"./backend-nodejs/wwwroot\" into current commit \n\n==============================================\n\n",
    "precommit-msg:stage:coverage": "echo \n\n==============================================\n\n Staging \"./frontend/coverage\" into current commit \n\n==============================================\n\n",
    "preupdate:npm": "npm run install-msg:update:npm",
    "update:npm:through:npm": "npm run install:powershellscript:update-npm",
    "update:npm:through:powershell": "powershell.exe $CurrentDir = $(get-location).Path; Start-Process powershell.exe \"-File `\"$CurrentDir/config/tools/PowerShell/update-npm.ps1`\"\" -Verb RunAs",
    "upgrade:npm": "ncu -u --packageFile package.json && npm update",
    "upgrade:yarn": "yarn upgrade-interactive"
  },

If you think a repo would still help then I'll have to spend some time uploading the project to github and removing any sensitive info, which I can do if needed.

sandorfr commented 6 years ago

Thanks for the detailed logs and scripts it indeed gives me a bit more understanding. I think there is something going on with how cwd is transmitted to subprocesses. Since Yarn is supposed to be in path at all times since the introduction of the tool installer, I think I can tweak that and see if it helps you.

That said looking at your script I'm not entirely surprised you are running into some issue. because you do npm run calls (which switches you back to npm execution) and also are using && which is no very reliable (as consistent accross platform). Have you considered using npm-run-all which addresses both issues? https://www.npmjs.com/package/npm-run-all

IAMtheIAM commented 6 years ago

Excellent tip with npm-run-all! I will begin to refactor my scripts to use that. Much cleaner to reason about.

Let me know when you get the tweaks in and I'll try again.

IAMtheIAM commented 6 years ago

Did you get a chance to make any updates yet?

sandorfr commented 6 years ago

I made a change but haven’t had the time to test the change properly so haven’t published it yet

IAMtheIAM commented 6 years ago

OK, I'll wait for your word to test again.

sandorfr commented 6 years ago

Hi,

I've pushed an update including the tweak on yarn invocation. Let me know if it helps.

sandorfr commented 6 years ago

@IAMtheIAM did it help you?

IAMtheIAM commented 6 years ago

I just saw your update. I'll give it a try and see what happens.

IAMtheIAM commented 6 years ago
******************************************************************************
Finishing: Yarn Install (frontend)
******************************************************************************
******************************************************************************
Starting: Yarn Install (backend-nodejs)
******************************************************************************
==============================================================================
Task         : Yarn task
Description  : Executes Yarn
Version      : 2.4.999
Author       : Geek Learning
Help         : [More Information](https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Yarn) (Version 2.4.999).

Dear Angular and Ember CLI users, please check our [known issues](https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Known-Issues)
==============================================================================
C:\Windows\system32\cmd.exe /D /S /C "d:\a\_tool\yarn\1.3.2\x64\yarn-v1.3.2\bin\yarn.cmd --production install"
yarn install v1.3.2
 Validating package.json...
 Resolving packages...
 Fetching packages...
info fsevents@1.1.2: The platform "win32" is incompatible with this module.
info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
 Linking dependencies...
 Building fresh packages...
success Saved lockfile.
Done in 12.61s.
******************************************************************************
Finishing: Yarn Install (backend-nodejs)
******************************************************************************
******************************************************************************
Starting: npm run tfs:build:production
******************************************************************************
==============================================================================
Task         : npm
Description  : Install and publish npm packages, or run an npm command. Supports npmjs.com and authenticated registries like Package Management.
Version      : 1.0.8
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613746)
==============================================================================
C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\nodejs\npm.cmd" config list"
; cli configs
user-agent = "npm/3.10.10 node/v6.11.5 win32 x64"
; environment configs
cache = "C:\\npm\\cache"
prefix = "C:\\npm\\prefix"
userconfig = "d:\\a\\1\\npm\\957.npmrc"
; project config d:\a\1\s\frontend\.npmrc
color = true
loglevel = "error"
registry = "https://registry.npmjs.org/"
; globalconfig C:\npm\prefix\etc\npmrc
msvs_version = "2017"
; builtin config undefined
; node bin location = C:\Program Files\nodejs\node.exe
; cwd = d:\a\1\s\frontend
; HOME = C:\Users\VssAdministrator
; "npm config ls -l" to show all defaults.
C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\nodejs\npm.cmd" run tfs:build:production"
> app-ui@2.6.0 tfs:build:production d:\a\1\s\frontend
> run-s tfs-msg:welcome precommit-msg:lint lint unit-tests-msg karma compile-ngc:cli:build-production:aot make:zipdir
> app-ui@2.6.0 tfs-msg:welcome d:\a\1\s\frontend
> echo 
==============================================
 Starting TFS Build process for Production... 
==============================================
ECHO is on.
> app-ui@2.6.0 precommit-msg:lint d:\a\1\s\frontend
> echo 
==============================================
 Running Linter... 
==============================================
ECHO is on.
> app-ui@2.6.0 lint d:\a\1\s\frontend
> run-s tslint eslint
> app-ui@2.6.0 tslint d:\a\1\s\frontend
> tslint --exclude node_modules --fix "./src/**/*.ts" "./config/**/*.ts" "*.ts"
'tslint' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 10.0.14393

still stuck with tslint not recognized.

sandorfr commented 6 years ago

do you mind sharing your full package.json?

IAMtheIAM commented 6 years ago

Also, can you put a flag for ignore-engines? I have to lower my node version in package.json to 6.11.0 because Hosted Agent 2017 doesn't have the 8.9.3 that my app would normally use. If not, I just temporarily lowered the version in package.json. Otherwise it wont do a yarn install with the incorrect node version.

sandorfr commented 6 years ago

If you need a specific version of node the right approach is to rather use the Node tool installer: https://docs.microsoft.com/en-us/vsts/build-release/tasks/tool/node-js

IAMtheIAM commented 6 years ago

OK, I have 2.

frontend package.json (angular app)

{
  "name": "app-ui",
  "version": "2.6.0",
  "description": "A complete starter kit for building Single Page Apps featuring Angular 2, Typescript, Webpack, Authentication, NPM Scripts, Unit Tests, and E2E Tests. Includes .NET Core 1.0 integration for working with a C# backend and Continuous Integration scripts for using source control on a TFS build server.",
  "author": "",
  "license": "MIT",
  "scripts": {
    "devserver:jit": "run-s clean:webpack-manifests && cross-env NODE_ENV=development JIT=true webpack-dev-server --profile --inline --hot --compress --content-base wwwroot",
    "devserver:jit:remote-debugging": "run-s clean:webpack-manifests && cross-env NODE_ENV=development JIT=true REMOTE_DEBUGGING=true webpack-dev-server --profile --inline --hot --compress --content-base wwwroot",
    "gulp": "run-s clean:webpack-manifests && gulp",
    "ios-webkit-debug-proxy": "ios_webkit_debug_proxy",
    "browser-sync:websever": "browser-sync start --proxy localhost:5000 --port 8000",
    "browser-sync:webpack-dev-server": "browser-sync start --proxy localhost:4000 --port 4001",
    "compile-ngc-msg": "echo \n\n==============================================\n\n Compiling Angular in AOT mode... \n\n==============================================\n\n",
    "compile-ngc:cli:build-debug:aot": "run-s compile-ngc-msg clean:compile compile:aot build:debug:aot",
    "compile-ngc:cli:build-production:aot": "run-s compile-ngc-msg clean:compile compile:aot build:production:aot",
    "compile:aot": "./node_modules/.bin/ngc -p ./tsconfig.json",
    "compile:aot:ngc-webpack": "cross-env NODE_ENV=production ngc-w -p ./tsconfig.json --webpack ./webpack.config.ts",
    "build-msg:pre-build": "echo \n\n==============================================\n\n Running Webpack Build... \n\n==============================================\n\n",
    "build-msg:post-build": "echo \n\n==============================================\n\n Webpack Build Succeeded! \n\n==============================================\n\n",
    "build:debug:aot": "run-s build-msg:pre-build clean:wwwroot && cross-env NODE_ENV=debug AOT=true webpack --hot --profile --colors --display-cached && run-s build-msg:post-build",
    "build:debug:aot:watch": "run-s build-msg:pre-build clean:wwwroot && cross-env NODE_ENV=debug AOT=true webpack --hot --profile --colors --display-cached --watch && run-s build-msg:post-build",
    "build:debug:jit:watch": "run-s build-msg:pre-build clean:wwwroot && cross-env NODE_ENV=debug JIT=true webpack --hot --profile --colors --display-cached --watch && run-s build-msg:post-build",
    "build:production:aot": "run-s build-msg:pre-build clean:wwwroot && cross-env NODE_ENV=production AOT=true webpack --profile --colors --display-cached --bail && run-s build-msg:post-build",
    "build:production:jit": "run-s build-msg:pre-build clean:wwwroot && cross-env NODE_ENV=production JIT=true webpack --profile --colors --display-cached --bail && run-s build-msg:post-build",
    "build:stats:aot:prod": "run-s build-msg:pre-build && cross-env AOT=true STATS=true run-s build:production:aot build-msg:post-build",
    "build:stats:aot:debug": "run-s build-msg:pre-build && cross-env AOT=true STATS=true run-s build:debug:aot build-msg:post-build",
    "build:stats:jit": "run-s build-msg:pre-build && cross-env JIT=true STATS=true run-s devserver:jit build-msg:post-build",
    "clean:node_modules": "node rimraf.js -- frontend/node_modules/*",
    "clean": "node rimraf.js -- compiled node_modules .cache ../backend-nodejs/node_modules ../backend-nodejs/wwwroot ../backend-nodejs/build",
    "clean:cache": "node rimraf.js -- .cache",
    "clean:install:globals": "run-s clean install:globals:all install:packages build:debug:aot",
    "clean:install": "run-s clean install:packages install:githook:pre-commit install:githook:pre-push build:debug:aot",
    "clean:wwwroot": "node rimraf.js -- ../backend-nodejs/wwwroot/*",
    "clean:webpack-manifests": "node rimraf.js -- ../backend-nodejs/wwwroot/*.json",
    "clean:tsccompile": "run-s clean:tsccompile:misc clean:tsccompile:js",
    "clean:tsccompile:misc": "cd ./src && del *.ngfactory.ts *.ngfactory.js *.js.map *.metadata.json *.ngfactory.json *.ngsummary.json *.ngsummary.ts /s",
    "clean:tsccompile:js": "cd ./src/app-components && del *.js /s",
    "clean:compile": "node rimraf.js -- compiled",
    "ci": "run-s lint test",
    "docs": "run-s typedoc -- --options typedoc.json --exclude '**/*.spec.ts' ./src/",
    "pree2e": "run-s webdriver:update -- --standalone",
    "e2e": "run-s protractor",
    "e2e:live": "run-s e2e -- --elementExplorer",
    "pree2e:server": "run-s webdriver:update -- --standalone && node spawner.js fork \"cd ../backend-nodejs && run-s server:production\" && cd ../frontend",
    "e2e:server": "run-s protractor",
    "eslint": "eslint --fix ./src/*.js ./config/*.js *.js ./src-examples/*.js",
    "install:packages": "run-s install:packages:npm",
    "install:packages:npm": "run-s install-msg:packages && npm install --quiet",
    "postinstall:packages:npm": "cd ../backend-nodejs && npm install",
    "install:packages:yarn": "run-s install-msg:packages && yarn-install --ignore-engines",
    "postinstall:packages:yarn": "cd ../backend-nodejs && yarn-install --ignore-engines",
    "install-msg:globals:scoop": "echo \n\n==============================================\n\n Installing Scoop and Scoop packages... \n\n==============================================\n\n",
    "install-msg:globals": "echo \n\n==============================================\n\n Installing Global NPM packages... \n\n==============================================\n\n",
    "install-msg:packages": "echo \n\n==============================================\n\n Installing Local NPM packages... \n\n==============================================\n\n",
    "install-msg:update:npm": "echo \n\n==============================================\n\n Updating NPM version to Latest... \n\n==============================================\n\n",
    "install:scoop:all": "run-s install:scoop install:yarn install-ios-webkit-debug-proxy",
    "install:scoop": "run-s install-msg:globals:scoop install:powershellscript:scoop",
    "preinstall:globals:all": "npm run install-msg:globals && npm config set python python2.7 && npm config set msvs_version 2017 --global",
    "install:globals:all": "npm install yarn-install nodemon rimraf vorlon npm-run-all remotedebug-ios-webkit-adapter -g  --no-optional --depth 0",
    "install-ios-webkit-debug-proxy": "scoop bucket add extras && scoop install ios-webkit-debug-proxy",
    "install:powershellscript:scoop": "node ./config/tools/PowerShell/install-scoop.js",
    "install:powershellscript:update-npm": "node ./config/tools/PowerShell/update-npm.js",
    "install:yarn": "scoop install yarn",
    "install:git-hooks": "run-s install:githook:pre-push install:githook:pre-commit",
    "install:githook:pre-push": "node rimraf.js ../.git/hooks/pre-push && mklink /H \"../.git/hooks/pre-push\" \"config/git-hooks/pre-push.sh\"",
    "install:githook:pre-commit": "node rimraf.js ../.git/hooks/pre-commit && mklink /H \"../.git/hooks/pre-commit\" \"config/git-hooks/pre-commit.sh\"",
    "tfs:install": "run-s install:packages:npm",
    "tfs:install:clean": "run-s clean:install",
    "pretfs:install:globals": "npm run install-msg:globals && npm config set python python2.7 && npm config set prefix %APPDATA%/npm && npm config set cache %APPDATA%/npm-cache && npm config set msvs_version 2017 --global",
    "tfs:install:globals": "npm install yarn-install npm-run-all -g --no-optional --depth 0",
    "tfs:build:production": "run-s tfs-msg:welcome precommit-msg:lint lint unit-tests-msg karma compile-ngc:cli:build-production:aot make:zipdir",
    "tfs-msg:welcome": "echo \n\n==============================================\n\n Starting TFS Build process for Production... \n\n==============================================\n\n",
    "unit-tests-msg": "echo \n\n==============================================\n\n Running Karma Unit Tests... \n\n==============================================\n\n",
    "karma": "karma start",
    "karma:browser": "karma start --browsers Chrome",
    "launch:Debug": "npm version",
    "launch:Release": "run-s tfs:build:production",
    "launch:~JIT.Dev-Webpack.Dev.Server": "node spawner.js fork \"run-s devserver:jit\"",
    "launch:~JIT.Dev-Build.Dev.Watch.Changes": "node spawner.js fork \"run-s build:debug:jit:watch\"",
    "launch:~JIT.Prod-Compile+Build.Prod.Watch.Changes": "node spawner.js fork \"run-s compile:build-production:jit:watch\"",
    "launch:~AOT.Prod-Compile+Build.Prod": "run-s compile-ngc:cli:build-production:aot",
    "launch:Tests-E2E": "start run-s e2e",
    "launch:Tests-Unit": "start run-s karma",
    "lint": "run-s tslint eslint",
    "postlint": "cd ../backend-nodejs && run-s lint",
    "onetimesetup": "run-s install:scoop:all update:npm:through:npm install:globals:all install:packages build:debug:aot",
    "postonetimesetup": "run-s install:git-hooks",
    "preprotractor": "tsc -p ./tsconfig.test.json",
    "protractor": "protractor ./config/protractor.config.js",
    "postprotractor": "node rimraf ./config/protractor.config.js ./config/webpack-helpers.js",
    "rimraf:standalone": "node rimraf.js",
    "run-powershellscript-example": "node ../PowerShell/RunPowerShellScript.js",
    "start": "gulp",
    "test": "run-s karma e2e:server",
    "test:browser": "run-s karma:browser e2e:server",
    "tslint": "tslint --exclude node_modules --fix \"./src/**/*.ts\" \"./config/**/*.ts\" \"*.ts\"",
    "typedoc": "typedoc",
    "watch": "start run-s watch:dev",
    "watch:dev": "start run-s build:debug:jit:watch",
    "watch:dev:hmr": "start run-s watch:dev -- --hot",
    "watch:Release": "start run-s build:production:aot -- --watch",
    "watch:test": "start run-s karma -- --auto-watch --no-single-run",
    "webdriver:start": "run-s webdriver-manager start",
    "webdriver:update": "webdriver-manager update",
    "webdriver-manager": "webdriver-manager",
    "webpack": "webpack",
    "webpack-dev-server": "webpack-dev-server",
    "stage:wwwroot": "run-s precommit-msg:staging:wwwroot && node ./config/tools/getCurrentDirectory.js && cd ../ && node ./frontend/config/tools/getCurrentDirectory.js && git add ./backend-nodejs/wwwroot",
    "stage:coverage": "node ./config/tools/getCurrentDirectory.js && cd ../ && node ./frontend/config/tools/getCurrentDirectory.js && git add ./frontend/coverage",
    "make:zipdir": "cd ../backend-nodejs && run-s precommit:backend && cd ../frontend",
    "prepush:disabled": "run-s precommit-msg:welcome precommit-msg:ci ci precommit-msg:stage:coverage stage:coverage precommit-msg:build-prod compile-ngc:cli:build-production:aot make:zipdir",
    "precommit": "run-s precommit-msg:welcome precommit-msg:lint lint unit-tests-msg karma precommit-msg:build-debug build:debug:aot make:zipdir",
    "precommit-msg:welcome": "echo \n\n==============================================\n\n Starting Husky: Git hooks made easy... \n\n==============================================\n\n",
    "precommit-msg:ci": "echo \n\n==============================================\n\n Running CI tests... \n\n==============================================\n\n",
    "precommit-msg:lint": "echo \n\n==============================================\n\n Running Linter... \n\n==============================================\n\n",
    "precommit-msg:build-debug": "echo \n\n==============================================\n\n Running \"build:debug:aot\" to generate Angular App (AOT Debug Mode). The 'pre-commit' git hook is configured to run on any branch EXCEPT 'Master' \n\n==============================================\n\n",
    "precommit-msg:build-prod": "echo \n\n==============================================\n\n Running \"compile-ngc:cli:build-production:aot\" to generate Angular App (AOT Production Mode).  The 'pre-push' git hook is configured to run ONLY on the 'Master' branch. \n\n==============================================\n\n",
    "precommit-msg:staging:wwwroot": "echo \n\n==============================================\n\n Staging \"./backend-nodejs/wwwroot\" into current commit \n\n==============================================\n\n",
    "precommit-msg:stage:coverage": "echo \n\n==============================================\n\n Staging \"./frontend/coverage\" into current commit \n\n==============================================\n\n",
    "preupdate:npm": "run-s install-msg:update:npm",
    "update:npm": "run-s install:powershellscript:update-npm",
    "upgrade:npm": "ncu -u --packageFile package.json && npm update",
    "upgrade:yarn": "yarn upgrade --latest"
  },
  "dependencies": {
    "@angular-devkit/build-optimizer": "0.0.36",
    "@angular/animations": "5.1.1",
    "@angular/cdk": "5.0.1",
    "@angular/common": "5.1.1",
    "@angular/compiler": "5.1.1",
    "@angular/compiler-cli": "5.1.1",
    "@angular/core": "5.1.1",
    "@angular/forms": "5.1.1",
    "@angular/http": "5.1.1",
    "@angular/material": "5.0.1",
    "@angular/platform-browser": "5.1.1",
    "@angular/platform-browser-dynamic": "5.1.1",
    "@angular/platform-server": "5.1.1",
    "@angular/router": "5.1.1",
    "@angular/tsc-wrapped": "4.4.6",
    "@angularclass/conventions-loader": "1.0.13",
    "@angularclass/hmr": "2.1.3",
    "@angularclass/hmr-loader": "3.0.4",
    "@angularclass/resolve-angular-routes": "1.0.9",
    "@markpieszak/ng-application-insights": "2.4.2",
    "@ng-bootstrap/ng-bootstrap": "1.0.0-beta.7",
    "@ngui/map": "0.20.0",
    "angular2-jwt": "0.2.3",
    "angular2gridster": "1.1.0",
    "bourbon": "5.0.0-beta.7",
    "breakpoint-sass": "2.7.1",
    "classlist.js": "1.1.20150312",
    "core-js": "2.5.3",
    "express": "4.16.2",
    "extract-text-webpack-plugin": "3.0.2",
    "hard-source-webpack-plugin": "0.5.6",
    "http-server": "0.10.0",
    "ie-shim": "0.1.0",
    "jquery": "3.2.1",
    "json-formatter-js": "2.2.0",
    "jwt-decode": "2.2.0",
    "lg-autoplay.js": "1.0.0",
    "lg-fullscreen.js": "1.0.0",
    "lg-hash.js": "1.0.0",
    "lg-pager.js": "1.0.0",
    "lg-share.js": "1.0.0",
    "lg-thumbnail.js": "1.0.0",
    "lg-zoom.js": "1.0.1",
    "lightgallery.js": "1.0.1",
    "materialize-css": "^0.100.2",
    "mdi": "2.1.19",
    "ng2-materialize": "1.8.0-beta.0",
    "ngx-bootstrap": "2.0.0-rc.0",
    "node-windows": "0.1.14",
    "npmlog": "4.1.2",
    "reflect-metadata": "0.1.10",
    "rxjs": "5.5.5",
    "scriptjs": "2.5.8",
    "susy": "3.0.1",
    "toastr": "2.1.4",
    "underscore": "1.8.3",
    "web-animations-js": "2.3.1",
    "zone.js": "0.8.18"
  },
  "devDependencies": {
    "@angular/language-service": "5.1.1",
    "@epegzz/sass-vars-loader": "^3.2.0",
    "@ngtools/webpack": "1.9.1",
    "@types/core-js": "0.9.43",
    "@types/googlemaps": "3.30.2",
    "@types/hammerjs": "2.0.35",
    "@types/jasmine": "2.8.2",
    "@types/jquery": "3.2.17",
    "@types/jwt-decode": "2.2.1",
    "@types/kendo-ui": "2017.3.1",
    "@types/lodash": "4.14.90",
    "@types/materialize-css": "^0.100.3",
    "@types/node": "8.5.1",
    "@types/requirejs": "2.1.31",
    "@types/source-map": "0.5.2",
    "@types/toastr": "2.1.35",
    "@types/uglify-js": "2.6.29",
    "@types/webpack": "3.8.1",
    "@types/webpack-env": "1.13.3",
    "add-asset-html-webpack-plugin": "2.1.2",
    "angular-named-lazy-chunks-webpack-plugin": "1.0.1",
    "angular-router-loader": "0.8.0",
    "angular2-load-children-loader": "0.2.1",
    "angular2-template-loader": "0.6.2",
    "assets-webpack-plugin": "git+https://github.com/IAMtheIAM/assets-webpack-plugin.git",
    "autoprefixer": "7.2.3",
    "awesome-typescript-loader": "3.4.1",
    "babel-core": "6.26.0",
    "babel-loader": "7.1.2",
    "babel-minify-webpack-plugin": "0.2.0",
    "babel-preset-es2015-native-modules": "6.9.4",
    "bootstrap-loader": "2.2.0",
    "browser-sync": "2.18.13",
    "bundle-loader": "0.5.5",
    "cache-loader": "1.2.0",
    "chalk": "2.3.0",
    "chunk-manifest-webpack-plugin": "1.1.2",
    "codelyzer": "4.0.2",
    "compression-webpack-plugin": "1.1.2",
    "copy-webpack-plugin": "4.3.0",
    "cross-env": "5.1.1",
    "css-loader": "0.28.7",
    "css-sourcemaps-webpack-plugin": "1.0.3",
    "enhanced-resolve": "4.0.0-beta.2",
    "es6-promise": "4.1.1",
    "es6-promise-loader": "1.0.2",
    "eslint": "4.13.1",
    "exports-loader": "0.6.4",
    "expose-loader": "0.7.4",
    "file-loader": "1.1.5",
    "find-remove": "1.2.0",
    "fork-ts-checker-webpack-plugin": "0.2.9",
    "glob": "7.1.2",
    "gulp": "3.9.1",
    "gulp-help": "1.6.1",
    "gulp-shell": "0.6.3",
    "gulp-util": "3.0.8",
    "happypack": "4.0.0",
    "html-webpack-plugin": "2.30.1",
    "husky": "0.14.3",
    "image-webpack-loader": "3.4.2",
    "imports-loader": "0.7.1",
    "istanbul-instrumenter-loader": "3.0.0",
    "jasmine-core": "2.8.0",
    "json-loader": "0.5.7",
    "karma": "1.7.1",
    "karma-chrome-launcher": "2.2.0",
    "karma-coverage": "1.1.1",
    "karma-jasmine": "1.1.1",
    "karma-mocha-reporter": "2.2.5",
    "karma-phantomjs-launcher": "1.0.4",
    "karma-remap-coverage": "0.1.4",
    "karma-sourcemap-loader": "0.3.7",
    "karma-webpack": "2.0.9",
    "lodash": "4.17.4",
    "make-runnable": "1.3.6",
    "mocha": "4.0.1",
    "mocha-clean": "1.0.0",
    "mongoose": "4.13.7",
    "my-local-ip": "1.0.0",
    "ng-router-loader": "2.1.0",
    "ngc-webpack": "4.1.2",
    "ngrok": "2.2.24",
    "ngx-typeahead": "0.0.4",
    "node-ios-webkit-debug-proxy": "1.0.1",
    "node-powershell": "3.3.1",
    "node-sass": "4.7.2",
    "npm-check-updates": "2.13.0",
    "optimize-js-plugin": "0.0.4",
    "parse5": "3.0.3",
    "path": "0.12.7",
    "postcss": "6.0.14",
    "postcss-loader": "2.0.9",
    "progress-bar-webpack-plugin": "1.10.0",
    "protractor": "5.2.2",
    "purify-css": "1.2.5",
    "purifycss-webpack": "0.7",
    "querystring": "0.2.0",
    "raw-loader": "0.5.1",
    "resolve-url-loader": "2.2.1",
    "sass-loader": "6.0.6",
    "sass-resources-loader": "1.3.1",
    "script-loader": "0.7.2",
    "source-map-loader": "0.2.3",
    "string-replace-loader": "1.3.0",
    "style-loader": "0.19.1",
    "thread-loader": "1.1.2",
    "to-string-loader": "1.1.5",
    "ts-loader": "3.2.0",
    "ts-node": "4.0.1",
    "ts-promise": "1.0.0",
    "tslib": "1.8.1",
    "tslint": "5.8.0",
    "tslint-loader": "3.5.3",
    "typescript": "2.6.2",
    "uglifyjs-webpack-plugin": "1.1.4",
    "url-loader": "0.6.2",
    "webpack": "3.10.0",
    "webpack-append": "0.1.2",
    "webpack-bundle-analyzer": "2.9.1",
    "webpack-dev-middleware": "2.0.1",
    "webpack-dev-server": "2.9.7",
    "webpack-dll-bundles-plugin": "1.0.0-beta.5",
    "webpack-md5-hash": "0.0.6",
    "webpack-merge": "4.1.1",
    "webpack-sources": "1.1.0",
    "webpack-stats-plugin": "0.1.5",
    "webpack-visualizer-plugin": "0.1.11",
    "write-file-webpack-plugin": "4.2.0"
  },
  "engines": {
       "node": "8.9.3",
        "npm": "5.5.1"
  }
}

backend package.json (node app)

{
    "name": "backend-nodejs",
    "description": "A lightweight typescript-based NodeJS web server for hosting web APIs and web apps.",
    "version": "1.0.0",
    "private": true,
    "scripts": {
        "debug": "./node_modules/.bin/ts-node --inpect-brk --project tsconfig.json app/server.ts",
        "nodemon:dev": "cross-env NODE_ENV=localhost nodemon --config nodemon.json app/server.ts",
        "nodemon:debug": "cross-env NODE_ENV=debug nodemon --config nodemon.json app/server.ts",
        "nodemon:qa": "cross-env NODE_ENV=qa nodemon --config nodemon.json app/server.ts",
        "nodemon:production": "cross-env NODE_ENV=production nodemon --config nodemon.json app/server.ts",
        "server:production": "./node_modules/.bin/ts-node app/server.ts",
        "devserver": "cross-env NODE_ENV=development NODE_ENV=development webpack-dev-server --profile --inline --hot --compress --content-base wwwroot",
        "build:debug:webpack:watch": "run-s clean:build && cross-env NODE_ENV=debug webpack --hot --profile --colors --display-cached --watch",
        "build:production:webpack": "run-s clean:build && cross-env NODE_ENV=production webpack --profile --colors --display-cached --bail",
        "build:production": "run-s clean:build copy:pugtemplates && tsc",
        "clean": "node rimraf.js -- node_modules doc coverage typings wwwroot/* build ../cache",
        "clean:build": "node rimraf.js -- build/*",
        "clean:wwwroot": "node rimraf.js -- wwwroot/js wwwroot/assets wwwroot/css",
        "clean:install": "node rimraf.js -- node_modules ../.git/hooks/pre-commit && run-s npm:install",
        "clean:githooks": "node rimraf.js -- ../.git/hooks/pre-commit",
        "clean:azure-deploy": "node rimraf.js -- Azure-Deploy.zip",
        "copy:pugtemplates": "cpr app build --filter=\\.ts$",
        "copy:phantomjs-prebuilt-custom": "node rimraf.js node_modules/phantomjs-2.1.1-windows && ncp config/tools/phantomjs-2.1.1-windows node_modules/phantomjs-prebuilt",
        "gulp": "gulp",
        "install:globals:all": "npm install cross-env node-gyp nodemon npm-check-updates npm-run-all typescript -g --no-optional --depth 0",
        "install:globals:production": "npm install cross-env node-gyp npm-run-all typescript -g --no-optional --depth 0",
        "lint": "run-s tslint eslint",
        "tslint": "tslint --exclude node_modules --fix \"./src/**/*.ts\" \"./config/**/*.ts\"",
        "eslint": "eslint --fix ./app/*.js ./config/*.js *.js",
        "npm:install": "npm install --quiet --no-optional",
        "postnpm:install": "cd ../frontend && run-s install:git-hooks",
        "postinstall:pre-commit": "echo This is not currently in use && run-s clean:githooks && cd ./config/tools && elevate.exe -c mkdir \"../../../.git/hooks\" & mklink /H \"../../../.git/hooks/pre-commit\" \"../git-hooks/hook-custom\"",
        "prestart": "run-s build:production clean:azure-deploy",
        "start": "node build/server.js",
        "setup": "npm run install:globals:production",
        "run:zipdir": "node zipdir.js && run-s precommit:stage:zipdir",
        "precommit": "echo WARNING: This script should not execute. Make sure Husky is NOT installed in this ./backend-nodejs/package.json file. Check ../frontend/package.json for precommit scripts being used by Husky, and make sure Husky is installed as a dependency there.",
        "precommit:backend": "run-s precommit-msg:build:production build:production precommit-msg:zipdir run:zipdir",
        "precommit-msg:welcome": "echo \n\n==============================================\n\n Starting Husky: Git hooks made easy... \n\n==============================================\n\n",
        "precommit-msg:build:production": "echo \n\n==============================================\n\n Running \"build:production\" to compile NodeJS app \n\n==============================================\n\n",
        "precommit-msg:zipdir": "echo \n\n==============================================\n\n Running \"node zipdir.js\" to generate Azure-Deploy.zip \n\n==============================================\n\n",
        "precommit-msg:staging:zipdir": "echo \n\n==============================================\n\n Staging \"./backend-nodejs/Azure-Deploy.zip\" into current commit \n\n==============================================\n\n",
        "precommit-msg:staging:build": "echo \n\n==============================================\n\n Staging \"./backend-nodejs/build\" into current commit \n\n==============================================\n\n",
        "precommit:stage:zipdir": "run-s precommit-msg:staging:zipdir && node ./config/tools/getCurrentDirectory.js && cd ../ && node ./backend-nodejs/config/tools/getCurrentDirectory.js && git add ./backend-nodejs/Azure-Deploy.zip",
        "precommit:stage:build": "run-s precommit-msg:staging:build && node ./config/tools/getCurrentDirectory.js && cd ../ && node ./backend-nodejs/config/tools/getCurrentDirectory.js && git add ./backend-nodejs/build",
        "upgrade:npm": "ncu -u --packageFile package.json && npm update",
        "upgrade:yarn": "yarn upgrade --latest"
    },
    "dependencies": {
        "body-parser": "1.18.2",
        "chalk": "^2.3.0",
        "cookie-parser": "1.4.3",
        "cors": "2.8.4",
        "cpr": "^3.0.1",
        "cross-env": "^5.1.1",
        "express": "4.16.2",
        "fs": "0.0.1-security",
        "glob": "7.1.2",
        "my-local-ip": "1.0.0",
        "ncp": "2.0.0",
        "nodemon": "^1.12.5",
        "numeral": "^2.0.6",
        "path": "0.12.7",
        "pug": "2.0.0-rc.4",
        "reflect-metadata": "0.1.10",
        "request": "2.83.0",
        "request-promise": "4.2.2",
        "routing-controllers": "0.7.6",
        "source-map-support": "0.5.0",
        "throw.js": "3.0.1",
        "tslib": "^1.8.1",
        "typedi": "^0.6.0"
    },
    "devDependencies": {
        "@types/body-parser": "1.16.8",
        "@types/express": "4.0.39",
        "@types/multer": "1.3.6",
        "@types/node": "8.0.57",
        "@types/webpack": "3.8.1",
        "ts-loader": "3.2.0",
        "ts-node": "3.3.0",
        "typescript": "2.6.2",
        "zip-dir": "1.0.2"
    },
    "engines": {
       "node": "8.9.3",
        "npm": "5.5.1"
    }
}
IAMtheIAM commented 6 years ago

Oh thanks, that's great, I didn't know there was a node installer tool. It works ;-)

sandorfr commented 6 years ago

if you really need the flag just append it to the arguments field ;)

IAMtheIAM commented 6 years ago

Good idea lol. Let me know if you see anything wrong with the package json. I switched to using run-s which is cross platform instead of npm run

sandorfr commented 6 years ago

I'll have to do more digging around this one. A minimalist repro repository would help me doing so if you can do that.

sandorfr commented 6 years ago

it looks fine. I'd try to not call the task tslint though

IAMtheIAM commented 6 years ago
==============================================
 Running Karma Unit Tests... 
==============================================
ECHO is on.
> app-ui@2.6.0 karma d:\a\1\s\frontend
> karma start
'karma' is not recognized as an internal or external command,

the problem is that none of the globally installed npm programs are being registered. I removed tslint and then it cant run karma. if I remove karma then it cant run webpack. and so on.

The global npm scripts is a task installed before this runs

If I do an npm install then it can find the global packages that were installed. But the yarn install can't seem to find them.

with npm install

==============================================
 Running Linter... 
==============================================
ECHO is on.
> app-ui@2.6.0 lint d:\a\1\s\frontend
> run-s tslint eslint
> app-ui@2.6.0 tslint d:\a\1\s\frontend
> tslint --exclude node_modules --fix "./src/**/*.ts" "./config/**/*.ts" "*.ts"
> app-ui@2.6.0 eslint d:\a\1\s\frontend
> eslint --fix ./src/*.js ./config/*.js *.js ./src-examples/*.js
> app-ui@2.6.0 postlint d:\a\1\s\frontend
> cd ../backend-nodejs && run-s lint
> backend-nodejs@1.0.0 lint d:\a\1\s\backend-nodejs
> run-s tslint eslint
> backend-nodejs@1.0.0 tslint d:\a\1\s\backend-nodejs
> tslint --exclude node_modules --fix "./src/**/*.ts" "./config/**/*.ts"
> backend-nodejs@1.0.0 eslint d:\a\1\s\backend-nodejs
> eslint --fix ./app/*.js ./config/*.js *.js
> app-ui@2.6.0 unit-tests-msg d:\a\1\s\frontend
> echo 
==============================================
 Running Karma Unit Tests... 
==============================================
ECHO is on.
> app-ui@2.6.0 karma d:\a\1\s\frontend
> karma start
10.1.0.4

==================================================
            Building for: test
            isDevServer: false
            AOT: false
            isProduction: false
            isDLLs: false
            isStats: false
            ENVlc: karma
            outputDir: d:\a\1\s\backend-nodejs\wwwroot\
==================================================

START:
  CheckoutComponent
    √ should be readily initialized
    √ should log ngOnInit
    √ should not be logged in
  OrderCompleteComponent
    √ should be readily initialized
    √ should log ngOnInit
    √ should not be logged in
  PackageSelectionComponent
    √ should be readily initialized
    √ should log ngOnInit
    √ should not be logged in
  DashboardComponent
    √ should be readily initialized
    √ should log ngOnInit
    √ should not be logged in
sandorfr commented 6 years ago

ah, you are installing package globally with npm? you should commit to one tool npm or yarn. if you want to use yarn you should use yarn global add instead of npm install -g. I may actually be your issue.

IAMtheIAM commented 6 years ago

OK, I read somewhere that yarn global add is not reliable. To be honest, yarn install has not reliable whether global or local in my recent experiences, it always corrupts the packages every time I do yarn add X, especially the packagenpmlog gets corrupted. But I will try your suggestion.

IAMtheIAM commented 6 years ago

Actually I just noticed that I am not installing karma or tslint via global npm anymore, actually they are invoked using the path in /node_modules/.bin/karma. Npm automatically prepends this node_modules to the PATH before each npm run, so it does not need to be installed globally if it exists locally. Then it could be invoked using karma on the CLI. It seems the yarn install task is not registering the node_modules/.bin folder to the for npm to later hook into and run command line programs.

The reason for using local install is to specify a version, since as far as I know, global install defaults to the latest version on npm.

sandorfr commented 6 years ago

I'm actually using local dependencies in a lot of project without any kind of issues. I'll need a minimal repro project If you wish me to help you.