Truffle Pet Store migration.sol compile error - truffle

I'm trying to run the Truffle Petshop example: http://truffleframework.com/tutorials/pet-shop
But either the Migrations.sol won't compile or the writing artifacts fails. I can't determine which from the error. The output indicates that Adoption.sol compiles, then Migrations.sol, which was provided in the project template, does not compile. Clearly, the project template is correct, so what would cause the error?
I'm running PowerShell with elevated rights on Windows 7.0.
Thanks in advance
Output:
PS C:\Users\username\Documents\Code\BlockChainCode\pet-shop-box-master> truffle compile
Compiling .\contracts\Adoption.sol...
Compiling .\contracts\Migrations.sol...
5
truffle : 5
At line:1 char:1
+ truffle compile
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (5:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\wrapper.js:48
throw e;
^
abort(5) at Error
at jsStackTrace (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:1:19718)
at stackTrace (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:1:19901)
at abort (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:19:15285)
at Array.dXb (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:11:585101)
at Array.tX (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:8:557453)
at Array.eea (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:6:495332)
at Object.wOb [as dynCall_ii] (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:11:540050)
at invoke_ii (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:1:1275129)
at Array.ixa (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:7:494308)
at Object.bVb [as dynCall_viii] (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:11:577232)

I upgraded Truffle version and it solved the problem.

Related

NGCC failed error in Angular 11.x app when running npm run

I have an Angular 11.x app that I run using npm run start - this has worked fine for months but all of a sudden it is no longer running the command and I am getting the following errors, can anyone suggest how I fix this? I have tried the obvious ideas of deleting node_modules and reinstalling them using npm install but with no joy.
Below is the error I get after running npm run start - what have I done to break this :(
Compiling #angular/core : es2015 as esm2015
Error: Error on worker #1: TypeError: Cannot read property 'map' of undefined
at injectDependencies (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler/bundles/compiler.umd.js:6960:21)
at compileFactoryFunction (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler/bundles/compiler.umd.js:6888:61)
at Object.compileInjector (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler/bundles/compiler.umd.js:8106:22)
at NgModuleDecoratorHandler.compileFull (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/src/ngtsc/annotations/src/ng_module.js:427:44)
at _loop_2 (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/src/ngtsc/transform/src/compilation.js:595:39)
at NgccTraitCompiler.TraitCompiler.compile (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/src/ngtsc/transform/src/compilation.js:626:21)
at DecorationAnalyzer.compileFile (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/analysis/decoration_analyzer.js:225:53)
at DecorationAnalyzer.analyzeProgram (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/analysis/decoration_analyzer.js:164:45)
at Transformer.analyzeProgram (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/packages/transformer.js:135:57)
at Transformer.transform (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/packages/transformer.js:77:27)
at ClusterMaster.onWorkerMessage (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/execution/cluster/master.js:195:27)
at /Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/execution/cluster/master.js:55:95
at ClusterMaster.<anonymous> (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/execution/cluster/master.js:293:57)
at step (/Users/zabius/Sites/abc-ui-ng4/node_modules/tslib/tslib.js:143:27)
at Object.next (/Users/zabius/Sites/abc-ui-ng4/node_modules/tslib/tslib.js:124:57)
at /Users/zabius/Sites/abc-ui-ng4/node_modules/tslib/tslib.js:117:75
at new Promise (<anonymous>)
at Object.__awaiter (/Users/zabius/Sites/abc-ui-ng4/node_modules/tslib/tslib.js:113:16)
at EventEmitter.<anonymous> (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/execution/cluster/master.js:287:32)
at EventEmitter.emit (events.js:315:20)
An unhandled exception occurred: NGCC failed.
See "/private/var/folders/b2/1zfdxz293d944p_lxk9_ypz40000gn/T/ng-XQcM3b/angular-errors.log" for further details.
The error in the angular-errors.log file is as follows -
[error] Error: NGCC failed.
at NgccProcessor.process (/Users/zabius/Sites/abc-ui-ng4/node_modules/#ngtools/webpack/src/ngcc_processor.js:129:19)
at /Users/zabius/Sites/abc-ui-ng4/node_modules/#ngtools/webpack/src/angular_compiler_plugin.js:593:31
at SyncHook.eval [as call] (eval at create (/Users/zabius/Sites/abc-ui-ng4/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10$
at SyncHook.lazyCompileHook (/Users/zabius/Sites/abc-ui-ng4/node_modules/webpack/node_modules/tapable/lib/Hook.js:154:20)
at Object.webpack [as webpackFactory] (/Users/zabius/Sites/abc-ui-ng4/node_modules/webpack/lib/webpack.js:55:30)
at createWebpack (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular-devkit/build-webpack/src/webpack-dev-server/index.js:21:36)
at Object.runWebpackDevServer (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular-devkit/build-webpack/src/webpack-dev-server/index.js:47:12)
at SwitchMapSubscriber.project (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular-devkit/build-angular/src/dev-server/index.js:209:32)
at SwitchMapSubscriber._next (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular-devkit/build-angular/node_modules/rxjs/internal/operators/swit$
at SwitchMapSubscriber.Subscriber.next (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular-devkit/build-angular/node_modules/rxjs/internal/Subs$
at /Users/zabius/Sites/abc-ui-ng4/node_modules/#angular-devkit/build-angular/node_modules/rxjs/internal/util/subscribeToPromise.js:7:24
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Versions :
npm -v 8.1.0
node -v 14.15.4
Using MacOS BigSur 11.5.2

cordova installation error -Command failed: powershell (Get-CimInstance -ClassName Win32_OperatingSystem).caption The term 'Get-CimInstance' is not re

I tried to install cordova with " npm install -g cordova"
When I run the command "cordova -v" or "cordova -V" or "cordova --version"
I am getting this error.
Please help to resolve the issue
C:\Users\Admin>cordova -v
C:\Users\Admin\AppData\Roaming\npm\node_modules\cordova\node_modules\windows-release\node_modules\execa\index.js:347
throw err;
^
Error: Command failed: powershell (Get-CimInstance -ClassName Win32_OperatingSystem).caption
The term 'Get-CimInstance' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At line:1 char:17
+ (Get-CimInstance <<<< -ClassName Win32_OperatingSystem).caption
+ CategoryInfo : ObjectNotFound: (Get-CimInstance:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
at makeError (C:\Users\Admin\AppData\Roaming\npm\node_modules\←[4mcordova←[24m\node_modules\←[4mwindows-release←[24m\node_modules\←[4mexeca←[24m\ind
ex.js:174:9)
at Function.module.exports.sync (C:\Users\Admin\AppData\Roaming\npm\node_modules\←[4mcordova←[24m\node_modules\←[4mwindows-release←[24m\node_modules
\←[4mexeca←[24m\index.js:338:15)
at windowsRelease (C:\Users\Admin\AppData\Roaming\npm\node_modules\←[4mcordova←[24m\node_modules\←[4mwindows-release←[24m\index.js:39:19)
at osName (C:\Users\Admin\AppData\Roaming\npm\node_modules\←[4mcordova←[24m\node_modules\←[4mos-name←[24m\index.js:39:18)
at new Insight (C:\Users\Admin\AppData\Roaming\npm\node_modules\←[4mcordova←[24m\node_modules\←[4minsight←[24m\lib\index.js:37:13)
at new RelentlessInsight (C:\Users\Admin\AppData\Roaming\npm\node_modules\←[4mcordova←[24m\src\telemetry.js:31:1)
at Object.<anonymous> (C:\Users\Admin\AppData\Roaming\npm\node_modules\←[4mcordova←[24m\src\telemetry.js:39:15)
←[90m at Module._compile (internal/modules/cjs/loader.js:1118:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:982:32)←[39m {
code: ←[33m1←[39m,
stdout: ←[32m''←[39m,
stderr: ←[32m"The term 'Get-CimInstance' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if\r\n"←[39m +
←[32m' a path was included, verify that the path is correct and try again.\r\n'←[39m +
←[32m'At line:1 char:17\r\n'←[39m +
←[32m'+ (Get-CimInstance <<<< -ClassName Win32_OperatingSystem).caption\r\n'←[39m +
←[32m' + CategoryInfo : ObjectNotFound: (Get-CimInstance:String) [], CommandNotFoundException\r\n'←[39m +
←[32m' + FullyQualifiedErrorId : CommandNotFoundException\r\n'←[39m +
←[32m' \r\n'←[39m,
failed: ←[33mtrue←[39m,
signal: ←[1mnull←[22m,
cmd: ←[32m'powershell (Get-CimInstance -ClassName Win32_OperatingSystem).caption'←[39m,
timedOut: ←[33mfalse←[39m
}
C:\Users\Admin>
Get-CimInstance was introduced in Powershell v3. It was not available previously.
The rough equivalent in Powershell v2 is Get-WmiObject, but be advised that that command was superseded and deprecated by the Get-Cim* commands. As of Powershell v6, Get-WmiObject no longer exists.
Both Powershell v2 and Windows 7 are at end of life (as of January 2020), and should be considered insecure and inappropriate for contemporary usage. That said, Windows 7 does support Powershell v5 through Windows Management Framework 5.1, although Microsoft is no longer under any obligation to host that file for Windows 7 so it may not remain available.

Couldn't find CB.Core version for flavor 'GeneralPublic' in version.json

While opening pfgold source depo, I am getting below error -
** Warning ** Desired/Active release is unknown for package [DevConsole.Bootstrapper]
E:\CxCache.A\CloudBuild.OnCorext.WwXYpYMGs_mH5zBvjOHtUA\linkpackages.ps1
: Couldn't find CB.Core version for flavor 'GeneralPublic' in
version.json At line:1 char:1
+ E:\CxCache.A\CloudBuild.OnCorext.WwXYpYMGs_mH5zBvjOHtUA\linkpackages
...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,linkpackages.ps1
Issue seems related to Cb.core version. But I dont know what steps to take?
You can upgrade the CloudBuild.OnCorext to version 4.0.2, which resolve my problems.
if you don't want to upgrade the CloudBuild.OnCorext, you can check whether the value of environment variable CloudbuildToolsFlavor is GeneralPublic. If so, you can set CloudbuildToolsFlavor as dogfood or empty.

Automating AD using Azure Resource Manager

I tried to automate AD by following this link :
https://blogs.technet.microsoft.com/markrenoden/2016/07/26/deploying-a-dc-to-azure-iaas-with-arm-and-dsc/
I have tried using templates that are available but I have a problem there. There are being deployed successfully, but the roles are not visible. Only Group Policy Management is visible, not all. So, I am following this.
This is the error I face:
16:17:11 - [ERROR] Get-AzureRmEnvironment : The term 'Get-AzureRmEnvironment' is not recognized
16:17:11 - [ERROR] as the name of a cmdlet, function, script file, or operable program. Check the
16:17:11 - [ERROR] spelling of the name, or if a path was included, verify that the path is
16:17:11 - [ERROR] correct and try again.
16:17:11 - [ERROR] At line:1 char:171
16:17:11 - [ERROR] + ... re_PS_Data_Collection = 'true' }; if ((Get-AzureRmEnvironment -Name ' ...
16:17:11 - [ERROR] + ~~~~~~~~~~~~~~~~~~~~~~
16:17:11 - [ERROR] + CategoryInfo : ObjectNotFound: (Get-AzureRmEnvironment:String)
16:17:11 - [ERROR] [], CommandNotFoundException
16:17:11 - [ERROR] + FullyQualifiedErrorId : CommandNotFoundException
16:17:11 - [ERROR]
16:17:11 - [ERROR] Get-AzureRmEnvironment : The term 'Get-AzureRmEnvironment' is not recognized
16:17:11 - [ERROR] as the name of a cmdlet, function, script file, or operable program. Check the
16:17:11 - [ERROR] spelling of the name, or if a path was included, verify that the path is
16:17:11 - [ERROR] correct and try again.
16:17:11 - [ERROR] At line:1 char:2323
16:17:11 - [ERROR] + ... 'asrsnraju#hotmail.com' -Environment (Get-AzureRmEnvironment -Name ' ...
16:17:11 - [ERROR] + ~~~~~~~~~~~~~~~~~~~~~~
16:17:11 - [ERROR] + CategoryInfo : ObjectNotFound: (Get-AzureRmEnvironment:String)
16:17:11 - [ERROR] [], CommandNotFoundException
16:17:11 - [ERROR] + FullyQualifiedErrorId : CommandNotFoundException
16:17:11 - [ERROR]
16:17:11 - [ERROR] & : The script 'Deploy-AzureResourceGroup.ps1' cannot be run because the
16:17:11 - [ERROR] following modules that are specified by the "#requires" statements of the
16:17:11 - [ERROR] script are missing: AzureRM.Resources.
16:17:11 - [ERROR] At line:1 char:2369
16:17:11 - [ERROR] + ... eCloud')));&'C:\Users\admin\Documents\Visual Studio 2015\Projects\MyD ...
16:17:11 - [ERROR] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16:17:11 - [ERROR] + CategoryInfo : ResourceUnavailable: (Deploy-AzureResourceGroup.
16:17:11 - [ERROR] ps1:String) [], ScriptRequiresException
16:17:11 - [ERROR] + FullyQualifiedErrorId : ScriptRequiresMissingModules
16:17:11 - [ERROR]
16:17:11 -
16:17:11 - Deploying template using PowerShell script failed.
Then, I have done this to my powershell to try and solve it . But nothing changed :
Add-AzureRmAccount -Environment (Get-AzureRmEnvironment -Name AzureUSGovernment)
Do I need to add something to my powershell??
So for anyone else coming across this, I hit the same issue trying out an Azure quickstart and it was because I didn't have the Azure PowerShell cmdlets installed. Steps are detailed here and are:
Make sure you have PowerShellGet installed, requires Powershell 5.x, if on a lower version you need the PackageManagement modules
Install the Azure PowerShell tools (from within an elevated PowerShell window):
Install-Module AzureRM
Make sure to restart Visual Studio, then retry your Azure script

Connecting to Azure Service Fabric cluster from Azure VM

I am trying to connect to my Azure Service Fabric cluster from a new Azure virtual machine I just set up. But when I use the Connect-ServiceFabricCluster cmdlet is get the following error message:
Connect-ServiceFabricCluster : An error occurred during this operation. Please check the trace logs for more details.
At line:1 char:1
+ Connect-ServiceFabricCluster -ConnectionEndpoint ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Connect-ServiceFabricCluster], FabricException
+ FullyQualifiedErrorId : CreateClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.ConnectCluster
The command I am using in powershell is (values are obfuscated):
Connect-ServiceFabricCluster -ConnectionEndpoint {ENDPOINT ADDRESS} -FindType FindByThumbprint -FindValue {THUMBPRINT} -X509Credential -ServerCertThumbprint {THUMBPRINT} -StoreLocation CurrentUser -StoreName My
When I use the exact same command on my development PC it is working just fine. Any suggestions on what is going wrong and how I might debug this is welcome!
Ensure that you have your client certificate installed on the VM at the location indicated in the parameters to the Connect-ServiceFabricCluster cmdlet.

Resources