问:
EPERM: Operation not permitted - NPM Angular 7 on IIS with backend .Net Core 2.1
Hi guys i've made an angular 7 app with visual studio 2017.
So i got AWS machine on windows 10 with IIS.

When i loaded the app, i got this error:

AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the
  Angular CLI was listening for requests. The error output was: Error:
  EPERM: operation not permitted, mkdir
  'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'

TypeError: Cannot read property 'get' of undefined

So the image with the iis error return:

Complete text error:

```<code>   An unhandled exception occurred while processing the request.

AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'

TypeError: Cannot read property 'get' of undefined

at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22)
at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
at Array.forEach (<anonymous>)
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
at C:\Program Files\nodejs\node_modules\npm\node_modules\mkdirp\index.js:47:53
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205
if (npm.config.get('json')) {
^

TypeError: Cannot read property 'get' of undefined
at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
at process.emit (events.js:189:13)
at process._fatalException (internal/bootstrap/node.js:496:27)
Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'

TypeError: Cannot read property 'get' of undefined

at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22)
at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
at Array.forEach (<anonymous>)
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
at Conf.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:229:20)
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205

if (npm.config.get('json')) {

^

TypeError: Cannot read property 'get' of undefined

at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)

at process.emit (events.js:189:13)

at process._fatalException (internal/bootstrap/node.js:496:27)

))
System.Threading.Tasks.Task<TResult>.GetResultCore(bool waitCompletionNotification)

InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'

TypeError: Cannot read property 'get' of undefined

at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22)
at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
at Array.forEach (<anonymous>)
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
at C:\Program Files\nodejs\node_modules\npm\node_modules\mkdirp\index.js:47:53
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205
if (npm.config.get('json')) {
^

TypeError: Cannot read property 'get' of undefined
at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
at process.emit (events.js:189:13)
at process._fatalException (internal/bootstrap/node.js:496:27)
Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'

TypeError: Cannot read property 'get' of undefined

at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22)
at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
at Array.forEach (<anonymous>)
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
at Conf.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:229:20)
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205

if (npm.config.get('json')) {

^

TypeError: Cannot read property 'get' of undefined

at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)

at process.emit (events.js:189:13)

at process._fatalException (internal/bootstrap/node.js:496:27)

Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(string sourcePath, string npmScriptName, ILogger logger)

Stack Query Cookies Headers
AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'
 TypeError: Cannot read property 'get' of undefined
 at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18) at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20 at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22) at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24 at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7 at Array.forEach (<anonymous>) at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13 at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25) at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20) at C:\Program Files\nodejs\node_modules\npm\node_modules\mkdirp\index.js:47:53 C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205
 if (npm.config.get('json')) {
 ^

 TypeError: Cannot read property 'get' of undefined
 at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
 at process.emit (events.js:189:13)
 at process._fatalException (internal/bootstrap/node.js:496:27)
 Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'
 TypeError: Cannot read property 'get' of undefined
 at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18) at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20 at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22) at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24 at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7 at Array.forEach (<anonymous>) at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13 at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25) at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20) at Conf.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:229:20) C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205

 if (npm.config.get('json')) {

 ^

 TypeError: Cannot read property 'get' of undefined

 at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)

 at process.emit (events.js:189:13)

 at process._fatalException (internal/bootstrap/node.js:496:27)

 ))
System.Threading.Tasks.Task<TResult>.GetResultCore(bool waitCompletionNotification)
Microsoft.AspNetCore.SpaServices.Extensions.Util.TaskTimeoutExtensions.WithTimeout<T>(Task<T> task, TimeSpan timeoutDelay, string message)
Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.PerformProxyRequest(HttpContext context, HttpClient httpClient, Task<Uri> baseUriTask, CancellationToken applicationStoppingToken, bool proxy404s)
Microsoft.AspNetCore.Builder.SpaProxyingExtensions+<>c__DisplayClass2_0+<<UseProxyToSpaDevelopmentServer>b__0>d.MoveNext()
Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Show raw exception details
InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'
 TypeError: Cannot read property 'get' of undefined
 at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18) at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20 at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22) at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24 at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7 at Array.forEach (<anonymous>) at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13 at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25) at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20) at C:\Program Files\nodejs\node_modules\npm\node_modules\mkdirp\index.js:47:53 C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205
 if (npm.config.get('json')) {
 ^

 TypeError: Cannot read property 'get' of undefined
 at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
 at process.emit (events.js:189:13)
 at process._fatalException (internal/bootstrap/node.js:496:27)
 Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'
 TypeError: Cannot read property 'get' of undefined
 at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18) at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20 at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22) at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24 at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7 at Array.forEach (<anonymous>) at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13 at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25) at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20) at Conf.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:229:20) C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205

 if (npm.config.get('json')) {

 ^

 TypeError: Cannot read property 'get' of undefined

 at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)

 at process.emit (events.js:189:13)

 at process._fatalException (internal/bootstrap/node.js:496:27)

Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(string sourcePath, string npmScriptName, ILogger logger)

Show raw exception details
System.InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'

TypeError: Cannot read property 'get' of undefined

    at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
    at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
    at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22)
    at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24
    at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
    at Array.forEach (<anonymous>)
    at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
    at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
    at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
    at C:\Program Files\nodejs\node_modules\npm\node_modules\mkdirp\index.js:47:53
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205
  if (npm.config.get('json')) {
                 ^

TypeError: Cannot read property 'get' of undefined
    at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
    at process.emit (events.js:189:13)
    at process._fatalException (internal/bootstrap/node.js:496:27)
Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'

TypeError: Cannot read property 'get' of undefined

    at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
    at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
    at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22)
    at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24
    at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
    at Array.forEach (<anonymous>)
    at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
    at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
    at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
    at Conf.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:229:20)
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205

  if (npm.config.get('json')) {

                 ^

TypeError: Cannot read property 'get' of undefined

    at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)

    at process.emit (events.js:189:13)

    at process._fatalException (internal/bootstrap/node.js:496:27)

 ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
   at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
</code>```

Here Startup.cs

```<code>public class Startup
{
    public Startup(IConfiguration configuration)
    {
        Configuration = configuration;
    }

    public IConfiguration Configuration { get; }

    // This method gets called by the runtime. Use this method to add services to the container.
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

        // In production, the Angular files will be served from this directory
        services.AddSpaStaticFiles(configuration =>
        {
            configuration.RootPath = "ClientApp/dist";
        });
    }

    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }
        else
        {
            app.UseExceptionHandler("/Error");
            app.UseHsts();
        }

        app.UseHttpsRedirection();
        app.UseStaticFiles();
        app.UseSpaStaticFiles();

        app.UseMvc(routes =>
        {
            routes.MapRoute(
                name: "default",
                template: "{controller}/{action=Index}/{id?}");
        });

        app.UseSpa(spa =>
        {
            // To learn more about options for serving an Angular SPA from ASP.NET Core,
            // see https://go.microsoft.com/fwlink/?linkid=864501

            spa.Options.SourcePath = "ClientApp";

            if (env.IsDevelopment())
            {
                spa.UseAngularCliServer(npmScript: "start");
            }
        });
    }
}
</code>```

I've installed lates nodejs version on server.
Where i'm wrong ?

Thanks

答:
Try setting your environment to Production.  I think it has something to do with trying to do a NPM start  </p>

```<code><environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" />
</code>```

Body:
Hi guys i've made an angular 7 app with visual studio 2017.
So i got AWS machine on windows 10 with IIS.

When i loaded the app, i got this error:

AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the
  Angular CLI was listening for requests. The error output was: Error:
  EPERM: operation not permitted, mkdir
  'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'

TypeError: Cannot read property 'get' of undefined

So the image with the iis error return:

Complete text error:

   An unhandled exception occurred while processing the request.

AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'

TypeError: Cannot read property 'get' of undefined

at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22)
at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
at Array.forEach (<anonymous>)
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
at C:\Program Files\nodejs\node_modules\npm\node_modules\mkdirp\index.js:47:53
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205
if (npm.config.get('json')) {
^

TypeError: Cannot read property 'get' of undefined
at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
at process.emit (events.js:189:13)
at process._fatalException (internal/bootstrap/node.js:496:27)
Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'

TypeError: Cannot read property 'get' of undefined

at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22)
at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
at Array.forEach (<anonymous>)
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
at Conf.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:229:20)
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205

if (npm.config.get('json')) {

^

TypeError: Cannot read property 'get' of undefined

at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)

at process.emit (events.js:189:13)

at process._fatalException (internal/bootstrap/node.js:496:27)

))
System.Threading.Tasks.Task<TResult>.GetResultCore(bool waitCompletionNotification)

InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'

TypeError: Cannot read property 'get' of undefined

at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22)
at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
at Array.forEach (<anonymous>)
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
at C:\Program Files\nodejs\node_modules\npm\node_modules\mkdirp\index.js:47:53
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205
if (npm.config.get('json')) {
^

TypeError: Cannot read property 'get' of undefined
at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
at process.emit (events.js:189:13)
at process._fatalException (internal/bootstrap/node.js:496:27)
Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'

TypeError: Cannot read property 'get' of undefined

at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22)
at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
at Array.forEach (<anonymous>)
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
at Conf.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:229:20)
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205

if (npm.config.get('json')) {

^

TypeError: Cannot read property 'get' of undefined

at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)

at process.emit (events.js:189:13)

at process._fatalException (internal/bootstrap/node.js:496:27)

Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(string sourcePath, string npmScriptName, ILogger logger)

Stack Query Cookies Headers
AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'
 TypeError: Cannot read property 'get' of undefined
 at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18) at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20 at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22) at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24 at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7 at Array.forEach (<anonymous>) at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13 at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25) at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20) at C:\Program Files\nodejs\node_modules\npm\node_modules\mkdirp\index.js:47:53 C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205
 if (npm.config.get('json')) {
 ^

 TypeError: Cannot read property 'get' of undefined
 at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
 at process.emit (events.js:189:13)
 at process._fatalException (internal/bootstrap/node.js:496:27)
 Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'
 TypeError: Cannot read property 'get' of undefined
 at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18) at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20 at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22) at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24 at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7 at Array.forEach (<anonymous>) at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13 at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25) at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20) at Conf.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:229:20) C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205

 if (npm.config.get('json')) {

 ^

 TypeError: Cannot read property 'get' of undefined

 at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)

 at process.emit (events.js:189:13)

 at process._fatalException (internal/bootstrap/node.js:496:27)

 ))
System.Threading.Tasks.Task<TResult>.GetResultCore(bool waitCompletionNotification)
Microsoft.AspNetCore.SpaServices.Extensions.Util.TaskTimeoutExtensions.WithTimeout<T>(Task<T> task, TimeSpan timeoutDelay, string message)
Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.PerformProxyRequest(HttpContext context, HttpClient httpClient, Task<Uri> baseUriTask, CancellationToken applicationStoppingToken, bool proxy404s)
Microsoft.AspNetCore.Builder.SpaProxyingExtensions+<>c__DisplayClass2_0+<<UseProxyToSpaDevelopmentServer>b__0>d.MoveNext()
Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Show raw exception details
InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'
 TypeError: Cannot read property 'get' of undefined
 at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18) at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20 at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22) at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24 at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7 at Array.forEach (<anonymous>) at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13 at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25) at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20) at C:\Program Files\nodejs\node_modules\npm\node_modules\mkdirp\index.js:47:53 C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205
 if (npm.config.get('json')) {
 ^

 TypeError: Cannot read property 'get' of undefined
 at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
 at process.emit (events.js:189:13)
 at process._fatalException (internal/bootstrap/node.js:496:27)
 Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'
 TypeError: Cannot read property 'get' of undefined
 at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18) at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20 at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22) at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24 at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7 at Array.forEach (<anonymous>) at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13 at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25) at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20) at Conf.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:229:20) C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205

 if (npm.config.get('json')) {

 ^

 TypeError: Cannot read property 'get' of undefined

 at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)

 at process.emit (events.js:189:13)

 at process._fatalException (internal/bootstrap/node.js:496:27)

Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(string sourcePath, string npmScriptName, ILogger logger)

Show raw exception details
System.InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'

TypeError: Cannot read property 'get' of undefined

    at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
    at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
    at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22)
    at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24
    at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
    at Array.forEach (<anonymous>)
    at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
    at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
    at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
    at C:\Program Files\nodejs\node_modules\npm\node_modules\mkdirp\index.js:47:53
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205
  if (npm.config.get('json')) {
                 ^

TypeError: Cannot read property 'get' of undefined
    at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
    at process.emit (events.js:189:13)
    at process._fatalException (internal/bootstrap/node.js:496:27)
Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'

TypeError: Cannot read property 'get' of undefined

    at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
    at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
    at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22)
    at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24
    at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
    at Array.forEach (<anonymous>)
    at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
    at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
    at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
    at Conf.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:229:20)
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205

  if (npm.config.get('json')) {

                 ^

TypeError: Cannot read property 'get' of undefined

    at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)

    at process.emit (events.js:189:13)

    at process._fatalException (internal/bootstrap/node.js:496:27)

 ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
   at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)

Here Startup.cs

public class Startup
{
    public Startup(IConfiguration configuration)
    {
        Configuration = configuration;
    }

    public IConfiguration Configuration { get; }

    // This method gets called by the runtime. Use this method to add services to the container.
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

        // In production, the Angular files will be served from this directory
        services.AddSpaStaticFiles(configuration =>
        {
            configuration.RootPath = "ClientApp/dist";
        });
    }

    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }
        else
        {
            app.UseExceptionHandler("/Error");
            app.UseHsts();
        }

        app.UseHttpsRedirection();
        app.UseStaticFiles();
        app.UseSpaStaticFiles();

        app.UseMvc(routes =>
        {
            routes.MapRoute(
                name: "default",
                template: "{controller}/{action=Index}/{id?}");
        });

        app.UseSpa(spa =>
        {
            // To learn more about options for serving an Angular SPA from ASP.NET Core,
            // see https://go.microsoft.com/fwlink/?linkid=864501

            spa.Options.SourcePath = "ClientApp";

            if (env.IsDevelopment())
            {
                spa.UseAngularCliServer(npmScript: "start");
            }
        });
    }
}

I've installed lates nodejs version on server.
Where i'm wrong ?

Thanks

Body:
Try setting your environment to Production.  I think it has something to do with trying to do a NPM start

<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" />


来源: stackexchange

问:
What does this error mean: HPE_INVALID_CONSTANT?
I was receiving HPE_INVALID_CONSTANT when making HTTP requests with NodeJS the other day. They mysteriously stopped occurring recently, but I'm still baffled and curious what exactly HPE_INVALID_CONSTANT is trying to tell me.

My google search results are a bit slanted towards NodeJS, so I'm not picking up anything that describes more generally what this means. It looks like a system level error since it's all caps.

答:
I've had the same issue when used not decoded params in request URL.

Example:

Request to http://someaddress.com?query=something with whitespaces will cause an error

```<code>  Error: Parse Error
  at TLSSocket.socketOnData (_http_client.js:440:20)
  at emitOne (events.js:116:13)
  at TLSSocket.emit (events.js:211:7)
  at addChunk (_stream_readable.js:263:12)
  at readableAddChunk (_stream_readable.js:250:11)
  at TLSSocket.Readable.push (_stream_readable.js:208:10)
  at TLSWrap.onread (net.js:597:20)
bytesParsed: 0,
code: 'HPE_INVALID_CONSTANT',
</code>```

Request to http://someaddress.com?query=something%20encoded%20with%20whitespaces will work fine

ContentLicense: CC BY-SA 3.0

Body:
I've had the same issue when used not decoded params in request URL.

Example:

Request to http://someaddress.com?query=something with whitespaces will cause an error

  Error: Parse Error
  at TLSSocket.socketOnData (_http_client.js:440:20)
  at emitOne (events.js:116:13)
  at TLSSocket.emit (events.js:211:7)
  at addChunk (_stream_readable.js:263:12)
  at readableAddChunk (_stream_readable.js:250:11)
  at TLSSocket.Readable.push (_stream_readable.js:208:10)
  at TLSWrap.onread (net.js:597:20)
bytesParsed: 0,
code: 'HPE_INVALID_CONSTANT',

Request to http://someaddress.com?query=something%20encoded%20with%20whitespaces will work fine

ContentLicense: CC BY-SA 4.0


问:
Flutter Firestore causing D8: Cannot fit requested classes in a single dex file (# methods: 71610 > 65536) in Android Studio
I am attempting to use firestore with a Flutter app in latest version of Android Studio. I have followed these instructions exactly. https://www.youtube.com/watch?v=DqJ_KjFzL9I&list=PLjxrf2q8roU2HdJQDjJzOeO6J3FoFLWr2&index=9 I even got them to work last week with a different app. Now I get the following error when I attempt to run my new app after completing all the steps up to (and including) updating pubspec.yaml. Keep in mind, in this example, i am getting the error on a fresh flutter counter app with no other code changes but what you see here.

```<code>D8: Cannot fit requested classes in a single dex file (# methods: 71610 > 65536)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\2.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\3.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\4.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\5.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\6.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\7.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\8.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\9.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\10.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\11.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\12.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\13.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\14.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\15.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\16.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\17.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\18.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\19.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\20.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\21.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\22.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\23.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\24.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\25.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\26.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\27.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\28.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\29.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\30.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\31.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\32.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\33.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\34.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\35.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\36.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\37.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\38.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\39.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\40.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\41.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\42.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\43.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\44.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\45.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\46.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\47.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\48.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\49.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\50.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\51.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\52.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\53.jar
  The number of method references in a .dex file cannot exceed 64K.
  Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 21s
Finished with error: Gradle task assembleDebug failed with exit code 1
</code>```

Here is my pubspec file

```<code>name: bakery
description: A new Flutter application.

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:

  cloud_firestore:

  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2

dev_dependencies:
  flutter_test:
    sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  # assets:
  #  - images/a_dot_burr.jpeg
  #  - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.io/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.io/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.io/custom-fonts/#from-packages
</code>```

Here is my app level gradle file

```<code>def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.boody.sag.bakery"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

apply plugin: 'com.google.gms.google-services'
</code>```

Here is my android level gradle file

```<code>buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:3.2.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
</code>```

答:
By default, Flutter supports Android SDK v16 (Jelly Bean, released 2012), but multidex doesn't really work with Jelly Bean out of the box. There are two ways to fix this:

A) Change minimum target SDK

Open android/app/build.gradle, then find the line that says minSdkVersion 16.

Change that line to minSdkVersion 21.

Save the file.

B) Enable multidex.

If you want to support older Android versions you can use the multidex support library.

Open and modify project/app/build.gradle file to enable multidex and add the multidex library as a dependency, as shown here :

```<code>android {
    defaultConfig {
        ...
        multiDexEnabled true
    }
    ...
}

dependencies {
  implementation 'com.android.support:multidex:1.0.3'
}
</code>```

Official guide here

Body:
I am attempting to use firestore with a Flutter app in latest version of Android Studio. I have followed these instructions exactly. https://www.youtube.com/watch?v=DqJ_KjFzL9I&list=PLjxrf2q8roU2HdJQDjJzOeO6J3FoFLWr2&index=9 I even got them to work last week with a different app. Now I get the following error when I attempt to run my new app after completing all the steps up to (and including) updating pubspec.yaml. Keep in mind, in this example, i am getting the error on a fresh flutter counter app with no other code changes but what you see here.

D8: Cannot fit requested classes in a single dex file (# methods: 71610 > 65536)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\2.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\3.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\4.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\5.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\6.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\7.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\8.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\9.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\10.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\11.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\12.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\13.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\14.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\15.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\16.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\17.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\18.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\19.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\20.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\21.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\22.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\23.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\24.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\25.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\26.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\27.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\28.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\29.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\30.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\31.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\32.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\33.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\34.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\35.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\36.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\37.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\38.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\39.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\40.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\41.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\42.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\43.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\44.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\45.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\46.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\47.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\48.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\49.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\50.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\51.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\52.jar, C:\Users\DonBo\AndroidStudioProjects\don_flutter_projects\bakery\bakery\build\app\intermediates\transforms\dexBuilder\debug\53.jar
  The number of method references in a .dex file cannot exceed 64K.
  Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 21s
Finished with error: Gradle task assembleDebug failed with exit code 1

Here is my pubspec file

name: bakery
description: A new Flutter application.

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:

  cloud_firestore:

  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2

dev_dependencies:
  flutter_test:
    sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  # assets:
  #  - images/a_dot_burr.jpeg
  #  - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.io/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.io/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.io/custom-fonts/#from-packages

Here is my app level gradle file

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.boody.sag.bakery"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

apply plugin: 'com.google.gms.google-services'

Here is my android level gradle file

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:3.2.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Body:
By default, Flutter supports Android SDK v16 (Jelly Bean, released 2012), but multidex doesn't really work with Jelly Bean out of the box. There are two ways to fix this:

A) Change minimum target SDK

Open android/app/build.gradle, then find the line that says minSdkVersion 16.

Change that line to minSdkVersion 21.

Save the file.

B) Enable multidex.

If you want to support older Android versions you can use the multidex support library.

Open and modify project/app/build.gradle file to enable multidex and add the multidex library as a dependency, as shown here :

android {
    defaultConfig {
        ...
        multiDexEnabled true
    }
    ...
}

dependencies {
  implementation 'com.android.support:multidex:1.0.3'
}

Official guide here


问:
How to add a single file to GIT LFS?
How can I add just a single file to GIT LFS?

Most examples show adding a pattern that specifies which files to add to LFS. However, I wish to add single file. If, for example, I do

```<code>git lfs track "file.bin"
</code>```

this will track all files named file.bin regardless of what directory they are in.

I considered adding an exclusion filter (! pattern) to .gitattributes so exclude all directories but that is not supported.

The best I've done so far is to track the file pattern for the file I want to add, add the file and then remove the tracking of that file pattern. This is a little fiddly. Is there a better way?

I want to express the file pattern $ROOT_OF_GIT_REPO/file.bin but am lacking a way to express the $ROOT_OF_GIT_REPO part.

答: You can specify any filename or path in your repository. You aren't limited to using file extensions. You could also track a specific directory with git lfs track 'assets/*' or an entire directory tree with git lfs track 'assets/**/*'. You could also track individual files specifically with git lfs track path/to/file which will track only that file.</p>

Title: How to add a single file to GIT LFS?

Body:
How can I add just a single file to GIT LFS?

Most examples show adding a pattern that specifies which files to add to LFS. However, I wish to add single file. If, for example, I do

git lfs track "file.bin"

this will track all files named file.bin regardless of what directory they are in.

I considered adding an exclusion filter (! pattern) to .gitattributes so exclude all directories but that is not supported.

The best I've done so far is to track the file pattern for the file I want to add, add the file and then remove the tracking of that file pattern. This is a little fiddly. Is there a better way?

I want to express the file pattern $ROOT_OF_GIT_REPO/file.bin but am lacking a way to express the $ROOT_OF_GIT_REPO part.


问:
How to position a mpl_toolkits's "AnchoredSizeBar" outside its given axes
I am facing serious difficulties in placing a AnchoredSizeBar outside its given axes. From the AnchoredSizeBar reference, the loc attribute accepts only 'string' methods that are relative to the given axes used for the AnchoredSizeBar creation.

Therefore, if I wanted to set the AnchoredSizeBar position outside the given axes, the loc attribute wouldn't work. In fact, it would raise an error message.

Would someone knows a way to circumvent that problem?

If possible, I would like to create a AnchoredSizeBar, whose bar size is yet relative to a given axes in the figure, but the AnchoredSizeBar location can be placed anywhere inside the figure instance.

Here is a code snipped of what I would like:

```<code>import matplotlib.pyplot as plt

from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar

fig, ax = plt.subplots(figsize=(3, 3))

x_position = 0.15
y_position = 0.35

Figure_location = (x_position, y_position)    # figure xy locations relative to fig.transFigure.

axes_width_to_size_bar = 0.3

bar0 = AnchoredSizeBar(ax.transData, axes_width_to_size_bar, 'unfilled', loc=Figure_location, frameon=False, size_vertical=0.05, fill_bar=False)

ax.add_artist(bar0)

bar0_extent = bar0.get_extent()

fig.show()
</code>```

I thank you for your time. Sincerely yours,

Philipe Riskalla Leal

答:
AnchoredSizeBar subclasses matplotlib.offsetbox.AnchoredOffsetbox. Additional arguments are hence passed on to AnchoredOffsetbox. This provides arguments bbox_to_anchor and bbox_transform. Those are the same as you have for legends, so for explanations see any legend example, e.g. How to put the legend out of the plot.

For example, to put the AnchoredSizeBar in the upper right corner of the figure,

```<code>import matplotlib.pyplot as plt

def draw_sizebar(ax):
    from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar
    from matplotlib.transforms import Bbox
    asb = AnchoredSizeBar(ax.transData,
                          0.1,
                          "5 warp units",
                          loc='upper right',
                          pad=0.1, borderpad=0.5, sep=5,
                          frameon=False,
                          bbox_to_anchor=Bbox.from_bounds(0, 0, 1, 1),
                          bbox_transform=ax.figure.transFigure)
    ax.add_artist(asb)

fig, ax = plt.subplots()
draw_sizebar(ax)

plt.show()
</code>```

Body:
I am facing serious difficulties in placing a AnchoredSizeBar outside its given axes. From the AnchoredSizeBar reference, the loc attribute accepts only 'string' methods that are relative to the given axes used for the AnchoredSizeBar creation.

Therefore, if I wanted to set the AnchoredSizeBar position outside the given axes, the loc attribute wouldn't work. In fact, it would raise an error message.

Would someone knows a way to circumvent that problem?

If possible, I would like to create a AnchoredSizeBar, whose bar size is yet relative to a given axes in the figure, but the AnchoredSizeBar location can be placed anywhere inside the figure instance.

Here is a code snipped of what I would like:

import matplotlib.pyplot as plt

from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar

fig, ax = plt.subplots(figsize=(3, 3))

x_position = 0.15
y_position = 0.35

Figure_location = (x_position, y_position)    # figure xy locations relative to fig.transFigure.

axes_width_to_size_bar = 0.3

bar0 = AnchoredSizeBar(ax.transData, axes_width_to_size_bar, 'unfilled', loc=Figure_location, frameon=False, size_vertical=0.05, fill_bar=False)

ax.add_artist(bar0)

bar0_extent = bar0.get_extent()

fig.show()

I thank you for your time. Sincerely yours,

Philipe Riskalla Leal

Body:
AnchoredSizeBar subclasses matplotlib.offsetbox.AnchoredOffsetbox. Additional arguments are hence passed on to AnchoredOffsetbox. This provides arguments bbox_to_anchor and bbox_transform. Those are the same as you have for legends, so for explanations see any legend example, e.g. How to put the legend out of the plot.

For example, to put the AnchoredSizeBar in the upper right corner of the figure,

import matplotlib.pyplot as plt

def draw_sizebar(ax):
    from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar
    from matplotlib.transforms import Bbox
    asb = AnchoredSizeBar(ax.transData,
                          0.1,
                          "5 warp units",
                          loc='upper right',
                          pad=0.1, borderpad=0.5, sep=5,
                          frameon=False,
                          bbox_to_anchor=Bbox.from_bounds(0, 0, 1, 1),
                          bbox_transform=ax.figure.transFigure)
    ax.add_artist(asb)

fig, ax = plt.subplots()
draw_sizebar(ax)

plt.show()


问:
ASP.NET Impersonation is cleared on application deployment (but I don't want password in web.config)
So I'm using II7 on both my Windows 7 Ultimate box and a Windows 2008 server. Whenever I deploy my application (I'm just manually copying right now), ASP.NET Impersonation gets disabled. I have a special AD user setup that has permissions to the specific database tables I need to use.

I can just re-enable it every time and it keeps the username and password, but it gets annoying. I realize you can turn on <identity impersonate="true"/> in the web.config, but when I deploy an app this way, it removes the username/password from the IIS config and switches it back to "Authenticated User" instead of "Specific User" with the credentials I set earlier. I don't want to put the username and password in the web.config itself.

Is there any way to get IIS (through a web.config setting?) to keep ASP.NET Impersonation enabled and use the username/password I setup in the IIS7 management console?

答:
I've found the best solution has been to set <validation validateIntegratedModeConfiguration="false" /> under the system.webServer section in the web.config as well as setting <identity impersonate="true" /> in the system.web section.  </p>

<p>Then set the username and password in the basic settings of the application in the IIS7 manager. The authentication information is saved in the IIS7 settings/registry and will cascade down to the application level. </p>

ContentLicense: CC BY-SA 2.5

Body:
I've found the best solution has been to set <validation validateIntegratedModeConfiguration="false" /> under the system.webServer section in the web.config as well as setting <identity impersonate="true" /> in the system.web section.

Then set the username and password in the basic settings of the application in the IIS7 manager. The authentication information is saved in the IIS7 settings/registry and will cascade down to the application level.


问:
Maven resource filtering of json file
In my current project I have a submodule which is using the maven exec plugin to run a test service which pulls configuration files from a location outside of the resources/testResources folders.

I need to use filtering to inject an environment variable into a few of the configuration files.  This is working for one of the files, a .properties file, but not for another file which is a .json.  In the latter case it simply leaves the variable in the json file.  The two files are right next to each other in the filtered directory.

Here is the filtering snippet from the submodule:

```<code><build>
  <finalName>${artifactId}</finalName>
  <testResources>
    <testResource>
      <filtering>true</filtering>
      <directory>../etc</directory>
    </testResource>
  </testResources>
</code>```

json file:

```<code>{ "customMappings" :
    { "tag:example.com:/vagrant/" : "file:${VAGRANT_CWD}" }
}
</code>```

Abbreviated project structure:

project

etc

config.properties

config.json

submodule

pom.xml

The submodule is definitely loading both files, but only filtering the .properties file.

Is there something special about it being a json file that would prevent filtering from happening to it?  Anything that can be done about this?

答:
For what its worth, I did eventually get this to work. I found that I had to directly list the file for inclusion in order to get it to be processed (its been a long time so hopefully this is the correct solution):</p>

```<code><build>
  <finalName>${artifactId}</finalName>
  <testResources>
    <testResource>
      <filtering>true</filtering>
      <directory>../etc</directory>
      <includes>
        <include>config.json</include>
        <include>config.properties</include>
      </includes>
    </testResource>
  </testResources>
...
</code>```

Title: Maven resource filtering of json file

Body:
In my current project I have a submodule which is using the maven exec plugin to run a test service which pulls configuration files from a location outside of the resources/testResources folders.

I need to use filtering to inject an environment variable into a few of the configuration files.  This is working for one of the files, a .properties file, but not for another file which is a .json.  In the latter case it simply leaves the variable in the json file.  The two files are right next to each other in the filtered directory.

Here is the filtering snippet from the submodule:

<build>
  <finalName>${artifactId}</finalName>
  <testResources>
    <testResource>
      <filtering>true</filtering>
      <directory>../etc</directory>
    </testResource>
  </testResources>

json file:

{ "customMappings" :
    { "tag:example.com:/vagrant/" : "file:${VAGRANT_CWD}" }
}

Abbreviated project structure:

project

etc

config.properties

config.json

submodule

pom.xml

The submodule is definitely loading both files, but only filtering the .properties file.

Is there something special about it being a json file that would prevent filtering from happening to it?  Anything that can be done about this?

Body:
For what its worth, I did eventually get this to work. I found that I had to directly list the file for inclusion in order to get it to be processed (its been a long time so hopefully this is the correct solution):

<build>
  <finalName>${artifactId}</finalName>
  <testResources>
    <testResource>
      <filtering>true</filtering>
      <directory>../etc</directory>
      <includes>
        <include>config.json</include>
        <include>config.properties</include>
      </includes>
    </testResource>
  </testResources>
...


问:
NSStatusItem Button Title to the Right of the Image
I want an NSStatusItem’s button’s title to appear to the right of its image. Here’s an example, this is the OS X VPN menubar app:

If I set either the title or image for my NSStatusItem’s button, they render correctly. However if I set both, they get superimposed and are horizontally center-aligned.

Is there a way to achieve the side-by-side placement without creating a custom UIView?

答:
use</p>

```<code>button.imagePosition = NSControl.ImagePosition.imageLeft
</code>```

Body:
use

button.imagePosition = NSControl.ImagePosition.imageLeft


问:
Does it matter if you don't learn the latest verion of a Java?
At the moment I am learning Java 9, despite Java 12 being the latest version. Is this an issue?</p>

答:
No, not at all. There is no significant difference between Java 8,9,11 and 12.
Yes, there are some cool features in 12, for example local type inference and also some new collections api's, but really nothing that a beginner could benefit from.

Just try to learn Java 8 (or 9; basically the same) and then you can move on (or not) to newer releases.
Why I said "or not" is because newer versions of Java (starting w/ 11 if I'm not mistaken) do not have free support any more. That's right, Oracle is now charging to give you support and also you are not allowed to use it commercially without paying a huge fee.

Due to this reason, many companies still use Java 8 or 9, so you should be okay.


问:
access private class method from trait in PHP
I want to call a private class method from trait. If I do $this->privateMethod(); the call is made.

Since I want to only call that method if exists, I've implemented a isCallable() function; but this function is returning false when I was expecting  true.

I'm missing something about scopes, why is this happening and how can I get is_callable() to return true?

See this example code:

```<code><?php

function isCallable($obj, $method)
{
    //$test1 = method_exists($obj, $method);
    //var_dump($test1);
    //TRUE

    //$test2 = is_callable([$obj, $method]);
    //var_dump($test2);
    //FALSE

    return (method_exists($obj, $method) && is_callable([$obj, $method]));
}

trait helper
{
    public function show()
    {
        echo "show!";

        if(isCallable($this, "afterShow"))
        {
            $this->afterShow();
        }

        //$this->afterShow();

    }
}

class my_class
{
    use helper;

    private function afterShow()
    {
        echo "...then this.";
    }
}

$objMyClass = new my_class();

$objMyClass->show();
</code>```

答:
It seems the issue is that your global isCallable function will sometimes want to return false for a private method, but true in this case. It doesn't have a context that it's within the object's scope.

One workaround is to have an isCallable method in your trait:

```<code>trait helper
{
    public function show()
    {
        echo "show!";

        if($this->isCallable($this, "afterShow"))
        {
            $this->afterShow();
        }

    }
    private function isCallable($obj, $method)
    {
        return (method_exists($obj, $method) && is_callable([$obj, $method]));
    }
}
</code>```

If you prefer to use the public function, you can pass an optional parameter into it like so:

```<code>function isCallable($obj, $method, $syntax_only = false)
{
    $test1 = method_exists($obj, $method);
    var_dump($test1);
    //TRUE

    $test2 = is_callable([$obj, $method], $syntax_only);
    var_dump($test2);
    //FALSE

    return (method_exists($obj, $method) && is_callable([$obj, $method], $syntax_only));
}
</code>```

and then change your call to isCallable($this, "afterShow", true)

Body:
I want to call a private class method from trait. If I do $this->privateMethod(); the call is made.

Since I want to only call that method if exists, I've implemented a isCallable() function; but this function is returning false when I was expecting  true.

I'm missing something about scopes, why is this happening and how can I get is_callable() to return true?

See this example code:

<?php

function isCallable($obj, $method)
{
    //$test1 = method_exists($obj, $method);
    //var_dump($test1);
    //TRUE

    //$test2 = is_callable([$obj, $method]);
    //var_dump($test2);
    //FALSE

    return (method_exists($obj, $method) && is_callable([$obj, $method]));
}

trait helper
{
    public function show()
    {
        echo "show!";

        if(isCallable($this, "afterShow"))
        {
            $this->afterShow();
        }

        //$this->afterShow();

    }
}

class my_class
{
    use helper;

    private function afterShow()
    {
        echo "...then this.";
    }
}

$objMyClass = new my_class();

$objMyClass->show();

Body:
It seems the issue is that your global isCallable function will sometimes want to return false for a private method, but true in this case. It doesn't have a context that it's within the object's scope.

One workaround is to have an isCallable method in your trait:

trait helper
{
    public function show()
    {
        echo "show!";

        if($this->isCallable($this, "afterShow"))
        {
            $this->afterShow();
        }

    }
    private function isCallable($obj, $method)
    {
        return (method_exists($obj, $method) && is_callable([$obj, $method]));
    }
}

If you prefer to use the public function, you can pass an optional parameter into it like so:

function isCallable($obj, $method, $syntax_only = false)
{
    $test1 = method_exists($obj, $method);
    var_dump($test1);
    //TRUE

    $test2 = is_callable([$obj, $method], $syntax_only);
    var_dump($test2);
    //FALSE

    return (method_exists($obj, $method) && is_callable([$obj, $method], $syntax_only));
}

and then change your call to isCallable($this, "afterShow", true)


问:
How to extract #tags from string?
I would like to extract all #words from a string, for example if I have this string:

```<code>Hello #people how are you doing #today I am in #asia and weather is super #nice
</code>```

I need a PHP function that will return me these:

```<code>#people
#today
#asia
#nice
</code>```

答:
This is an example where I apply your request</p>

```<code>$string = "Hello #people how are you doing #today I am in #asia and weather is super #nice";
$regex = '~(#\w+)~';
if (preg_match_all($regex, $string, $matches, PREG_PATTERN_ORDER)) {
   foreach ($matches[1] as $word) {
      echo $word .'<br/>';
   }
}
</code>```

Title: How to extract #tags from string?

Body:
I would like to extract all #words from a string, for example if I have this string:

Hello #people how are you doing #today I am in #asia and weather is super #nice

I need a PHP function that will return me these:

#people
#today
#asia
#nice

Body:
This is an example where I apply your request

$string = "Hello #people how are you doing #today I am in #asia and weather is super #nice";
$regex = '~(#\w+)~';
if (preg_match_all($regex, $string, $matches, PREG_PATTERN_ORDER)) {
   foreach ($matches[1] as $word) {
      echo $word .'<br/>';
   }
}


问:
tf.data.Dataset: how to get the dataset size (number of elements in an epoch)?
Let's say I have defined a dataset in this way:

```<code>filename_dataset = tf.data.Dataset.list_files("{}/*.png".format(dataset))
</code>```

how can I get the number of elements that are inside the dataset (hence, the number of single elements that compose an epoch)?

I know that tf.data.Dataset already knows the dimension of the dataset, because the repeat() method allows repeating the input pipeline for a specified number of epochs. So it must be a way to get this information.

答: len(list(dataset)) works in eager mode, although that's obviously not a good general solution.

Body:
Let's say I have defined a dataset in this way:

filename_dataset = tf.data.Dataset.list_files("{}/*.png".format(dataset))

how can I get the number of elements that are inside the dataset (hence, the number of single elements that compose an epoch)?

I know that tf.data.Dataset already knows the dimension of the dataset, because the repeat() method allows repeating the input pipeline for a specified number of epochs. So it must be a way to get this information.


问:
Class not Registered Error on Visual Studio 2017 with MySQL
I am migrating my standalone VB.NET developed Windows Forms Application from SQL to MySQL and while doing that I am using an online database. Here is the scenario.

Application is developed in Visual Studio 2017 VB.NET and is a Windows Forms Application.

My database is hosted on Hostinger.

Now obviously, If I want to connect to MySQL from VS, I need two components.

MySQL for Visual Studio

Visual Studio MySQL Connector

And here the problem begins, I tried various versions of both components but still, I am getting the following error.

Now as per online forums and questions answered here, this error occurs when software component not installed on the machine. In this case, I am using MySQL references but either MySQL connector or MySQL for VS not installed. But that's not the case. I have both of these installed.

I tried to manually update diff version of MySQL.Data.DLL (v4.0 and v4.5) but nothing seems to solve the problem.

I tried the same project with VS 2015 Community but still not working.

Read different forums and tried multiple solutions. Posting question here is kind of my last resort.

I think for this to work, specific versions of both supporting software must be installed. If anyone has tried this before, working on this or have any workarounds, Let me know.

And just because, question title is somewhat common and mentioned many times on multiple posts, just don't duplicate it without having a proper solution.

Additional Problem: MySQL does not show in Server Explorer' server
  list. This is optional.

UPDATE :

Installing MySQL for VS 1.2.7 and MySQL Connector 6.10.5 will enable the option in Server Explorer' server list. Now I can Create New MySQL Connection using this. I have successfully created a remote MySQL connection and tested it but still having the above error when trying to run the project.

答:
That looks like a COM error. Those are always a joy to debug. Apparently, the MySQL .net provider is using COM under the hood, perhaps to talk to native code.

I don't have a solution, I have zero MySQL experience from .net, and I detest VB with a passion. So, I probably am not your savior, but here are some tips and advice that might help track down the COM error. These are kind of a last resort

Download and install DebugView and Process Monitor from Microsoft. Process Monitor allows you to snoop on file and registry access. DbgView captures log messages from OutputDebugString. If you are lucky, MySQL native code might be emitting debug strings.

Create a simple, bare bones console mode application that exhibits the problem.

Print a boot message as soon as your main method starts. Include the value of Environment.Is64BitProcess in the message (will explain why below)

Wait for the user to press a key via Console.ReadKey(). This is to give you time to setup process monitor

Try to connect to MySQL after the key press. Surround every statement with copious logging.

Configure Visual Studio to only target x64 code if you are on a 64 bit machine

Start DebugView

Run your app outside of the debugger (stick with Debug builds though)

While it is waiting for the key press, start Process Monitor and tell it to only log events from your application

Press a key in your test application and see if it blows up like your winforms app did

Assuming it crashes, look at Process Monitor to see what was going on at the moment of the crash. There will probably be a mountain of junk. You will have to filter down to registry and file access. Focus on operations that failed. Procmon will allow you to see the filename and registry keys that were accessed.

Look at the logging in DebugView and see if anything interesting popped up

Ok, so why force 64 bit and log proof that you are in 64 bit mode at runtime? A 64 bit windows machine has both a 64 registry and a 32 bit registry. It is possible for a COM library to be registered in one and not the other. You want to eliminate that headache from the equation. The Any CPU target combined with the Prefer 32-bit VS settings just add confusion to everything. Best to know for certain what CPU target you are running on while you debug this.

Another tip is to run in the debugger and force it to Break All when that error dialog appears. I don't know if that error box will appear when the console mode app fails, but if it does, the callstack might help point you in the right direction.

One last tip: configure VS for native debugging and tell it to break on all exception types, not just .NET exceptions.

Good luck


问:
Tab Bar not hiding using UIViewController
I am adding a UIViewController as PresentViewController using Tab Bar, then the view looks like:

After selecting any option, I need to hide the Tab Bar, but my screen looks like:

Kindly suggest me the solution for it. I am adding a view controller:

self.presentViewController(responseSelector, animated: true,
  completion: nil)

答:
I have used the line below in the ViewWillAppear() function:

```<code>self.tabBarController!.tabBar.isHidden = true
</code>```

And it works great.

Body:
I have used the line below in the ViewWillAppear() function:

self.tabBarController!.tabBar.isHidden = true

And it works great.


问:
Select and add column values from another dataframe based on if the index exists in both
I have two dataframes, let's call them A and B, with the same indexes (person IDs), but some IDs might be in A and not B, and vice versa. Additionally, the IDs are Non-Unique in B, while unique in dataframe A, so I want to

I want to check B to see if there exists certain IDs, then add a column of the max B-Label into A, for that specific ID.

I tried writing the function below as an argument to the pandas .apply() function.

```<code>def add_labels_to_dataframe(train_df,
                        id_col_name='person_id',
                        label_name="max_progress",
                        label_filepath=LABELS_SRC_FILE,
                        default_value=-1,
                        save=True):
"""
Add labels column to train_df

:param train_df: (DataFrame)
    the training dataframe that needs labels
:param id_col_name: (str)
    name of the ID column to use
:param label_name: (str)
    the column name of the label to use (score/progress/is_X/etc)
:param label_filepath: (str)
    filepath with IDs and associated labels
:param default_value: (int, or anything)
    The default label to give when a person_id has no associated label
:return: (DataFrame)
    updated dataframe with labels
"""
labels_df = pd.read_csv(label_filepath)

def get_max_score(row):
    """
    DataFrame function to select max score when multiple exist per ID

    :param row: (DataFrame)
        A single row of the dataframe being modified
    :return: (int)
        returns elements of a Series that becomes a new column of the DataFrame
    """
    # if person_id is in labels, then get max of labels
    pdb.set_trace()
    pid_labels_df = labels_df[row[id_col_name].isin(labels_df[id_col_name])]

    if not pid_labels_df.empty and not pd.isnull(pid_labels_df[label_name].max()):
        return 1 + pid_labels_df[label_name].max()

    return default_value

train_df[label_name] = train_df.apply(get_max_score, axis=1)

if save:
    train_df.to_csv(LABELED_TRAIN_DF_PATH)

return train_df
</code>```

ValueError: ('Can only compare identically-labeled Series objects', 'occurred at index 0')

I know I could just convert both dataframe indexes into Python lists, check if value exists, then create a new DataFrame mapping old rows to either labeled values or some default -1, but I'm trying to do this all within Pandas, in order to utilize the vectorization.

Can someone help me figure out a concise way to use only dataframe operations instead of casting to Python lists here?

答:
I think* you're going to be able to do this with a groupby transform:

```<code>df[label_name] = df.groupby("person_id").transform("max")
</code>```

* It's a little hard to read precisely what your code is attempting to do...

Body:
I have two dataframes, let's call them A and B, with the same indexes (person IDs), but some IDs might be in A and not B, and vice versa. Additionally, the IDs are Non-Unique in B, while unique in dataframe A, so I want to

I want to check B to see if there exists certain IDs, then add a column of the max B-Label into A, for that specific ID.

I tried writing the function below as an argument to the pandas .apply() function.

def add_labels_to_dataframe(train_df,
                        id_col_name='person_id',
                        label_name="max_progress",
                        label_filepath=LABELS_SRC_FILE,
                        default_value=-1,
                        save=True):
"""
Add labels column to train_df

:param train_df: (DataFrame)
    the training dataframe that needs labels
:param id_col_name: (str)
    name of the ID column to use
:param label_name: (str)
    the column name of the label to use (score/progress/is_X/etc)
:param label_filepath: (str)
    filepath with IDs and associated labels
:param default_value: (int, or anything)
    The default label to give when a person_id has no associated label
:return: (DataFrame)
    updated dataframe with labels
"""
labels_df = pd.read_csv(label_filepath)

def get_max_score(row):
    """
    DataFrame function to select max score when multiple exist per ID

    :param row: (DataFrame)
        A single row of the dataframe being modified
    :return: (int)
        returns elements of a Series that becomes a new column of the DataFrame
    """
    # if person_id is in labels, then get max of labels
    pdb.set_trace()
    pid_labels_df = labels_df[row[id_col_name].isin(labels_df[id_col_name])]

    if not pid_labels_df.empty and not pd.isnull(pid_labels_df[label_name].max()):
        return 1 + pid_labels_df[label_name].max()

    return default_value

train_df[label_name] = train_df.apply(get_max_score, axis=1)

if save:
    train_df.to_csv(LABELED_TRAIN_DF_PATH)

return train_df

ValueError: ('Can only compare identically-labeled Series objects', 'occurred at index 0')

I know I could just convert both dataframe indexes into Python lists, check if value exists, then create a new DataFrame mapping old rows to either labeled values or some default -1, but I'm trying to do this all within Pandas, in order to utilize the vectorization.

Can someone help me figure out a concise way to use only dataframe operations instead of casting to Python lists here?

Body:
I think* you're going to be able to do this with a groupby transform:

df[label_name] = df.groupby("person_id").transform("max")

* It's a little hard to read precisely what your code is attempting to do...


问:
Is there a way to fix an order on executing a script with multiple sections on Matlab?
I have a script with multiple sections and I was wondering if there was a way to fix an order of executing the sections. For example :
Section 1, 2 and 3 ==> sometimes I want section 2 to be executed before 1 or 3 before 1 or any other order.

The sections are independent, and there's way more than 3 sections, that's why I can't execute one by one.

Thanks in advance, and please accept my apologies if there's a trivial way because I am not an expert.

答: Perhaps this is an abuse of the test framework to fi your use case, but since they are independent you can leverage script based tests. This will allow you to create a test suite which is an array corresponding to each (test) section. You can then reorder that array to your hearts content and call run on the suite (or run it in parallel)</p>


问:
Can I run a VBA macro to run SQL queries I have saved in a MS Access database?
I spent alot of time to create 24 different separate MS Access queries that I have saved in the MS Access database.  They have to be run in a specific order.

I want to run a macro that will just execute them one after another.

I know I can do this using VBA but I have copy all the SQL into VBA one at a time.

is there a way I can just have VBA run the saved queries in the MS Access database without copying them into VBA?

I am very good with SQL. 15+ years doing Oracle work,  Code writing, DB Tuning, Data DBA work.

I am new to using SQL and VBA to run against MS Access DB.

答:
Here is another method if you don't have specific naming conventions utilizing an array for the query names in execution order:</p>

```<code>Public Sub RunMasterUpdate()

    Dim qryList As Variant
    Dim i As Long

    qryList = Array("QueryName1", "QueryName2", "QueryName3")

    For i = LBound(qryList) To UBound(qryList)
        CurrentDb.Execute qryList(i)
    Next

End Sub
</code>```

Body:
Here is another method if you don't have specific naming conventions utilizing an array for the query names in execution order:

Public Sub RunMasterUpdate()

    Dim qryList As Variant
    Dim i As Long

    qryList = Array("QueryName1", "QueryName2", "QueryName3")

    For i = LBound(qryList) To UBound(qryList)
        CurrentDb.Execute qryList(i)
    Next

End Sub