Error HH411: The library #hardhat/console.so, imported from contracts/NFTMarketplace.sol, is not installed. Try installing it using npm - blockchain

I have installed all devDependencies & dependencies.
Dependencies installed.
But while running the cmd (npx hardhat run scripts/deploy.js --network localhost) getting the Error,
Error
Error HH411: The library #hardhat/console.so, imported from contracts/NFTMarketcts/NFTMarketplace.sol, is not installed. Try installing it using npm.
Answers / Solutions of the Error

Related

AWS CodeBuild: ERROR: Could not build wheels for cmake, ninja

Running command pip install --no-binary ':all:' ddtrace cause i need to install arm64 version (cause default pkg uses binary code). On local system i got it installed correctly, but on AWS i got an error:
Failed to build cmake ninja
ERROR: Could not build wheels for cmake, ninja which use PEP 517 and cannot be installed directly
Python version - 3.9.6
PIP version - 21.1.3

Google Cloud Build fails due to missing CMake

I am trying to deploy a Flask/ML app to Google Cloud but encountering this issue;
When I try to run gcloud builds submit --tag gcr.io/project-name/index with a requirements.txt file, it throws CMake must be installed to build dlib. Since now, I didn't have any problems working with dlib (I have cmake and build-essential already installed) and when I connect Google Cloud Shell via ssh, I can see both build-essential and cmake is installed and up to date on there too.
I tried to build on Ubuntu and Windows machines, same error consists.
Solved! CMake needs to be built in Dockerfile, not locally or in cloud shell.
Adding RUN apt-get update && apt-get -y install cmake before RUN pip install -r requirements.txt in Dockerfile resolved the issue.

Windows 10 - vagrant plugin install vagrant-aws - The "libxml2" package isn't available. (RuntimeError)

Trying to install aws plugin for vagrant. Getting a dependency error.
Logs show...
find_executable: checking for xml2-config... -------------------- no
--------------------
"pkg-config --exists libxml2"
package configuration for libxml2 is not found
Console output:
C:\Users\jkittell\Documents\Schedule3> vagrant plugin install vagrant-aws
Installing the 'vagrant-aws' plugin. This can take a few minutes...
Building native extensions. This could take a while...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
ERROR: Failed to build gem native extension.
current directory: C:/Users/jkittell/.vagrant.d/gems/2.4.4/gems/ovirt-engine-sdk-4.2.4/ext/ovirtsdk4c
C:/HashiCorp/Vagrant/embedded/mingw64/bin/ruby.exe -r ./siteconf20181002-19764-xj4q7a.rb extconf.rb
checking for xml2-config... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/HashiCorp/Vagrant/embedded/mingw64/bin/$(RUBY_BASE_NAME)
--with-libxml2-config
--without-libxml2-config
--with-pkg-config
--without-pkg-config
extconf.rb:29:in `<main>': The "libxml2" package isn't available. (RuntimeError)
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Users/jkittell/.vagrant.d/gems/2.4.4/extensions/x64-mingw32/2.4.0/ovirt-engine-sdk-4.2.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/Users/jkittell/.vagrant.d/gems/2.4.4/gems/ovirt-engine-sdk-4.2.4 for inspection.
Results logged to C:/Users/jkittell/.vagrant.d/gems/2.4.4/extensions/x64-mingw32/2.4.0/ovirt-engine-sdk-4.2.4/gem_make.out
PS C:\Users\jkittell\Documents\Schedule3>
I did a google search and found a hotfix for this.
Gem file available here.
Just do a vagrant plugin install ~/PATH/TO/vagrant-aws-0.8.0.gem
I had to install fog-aws plugin first and then it worked.
vagrant plugin install fog-aws
Console output:
PS C:\Users\jkittell\Documents\Schedule3> vagrant plugin install ..\..\Downloads\vagrant-aws-0.8.0.gem
Installing the '..\..\Downloads\vagrant-aws-0.8.0.gem' plugin. This can take a few minutes...
Fetching: iniparse-1.4.4.gem (100%)
Fetching: fog-core-2.1.2.gem (100%)
Fetching: fog-aws-3.3.0.gem (100%)
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
conflicting dependencies fog-aws (= 2.0.1) and fog-aws (~> 3.0)
Activated fog-aws-3.3.0
which does not match conflicting dependency (= 2.0.1)
Conflicting dependency chains:
vagrant-aws (= 0.8.0), 0.8.0 activated, depends on
fog-aws (~> 3.0), 3.3.0 activated
versus:
fog-aws (= 2.0.1)
PS C:\Users\jkittell\Documents\Schedule3> vagrant plugin install fog-aws
Installing the 'fog-aws' plugin. This can take a few minutes...
Successfully uninstalled dry-inflector-0.1.2
Successfully uninstalled fog-aliyun-0.3.2
Successfully uninstalled fog-atmos-0.1.0
Successfully uninstalled fog-aws-2.0.1
Successfully uninstalled fog-brightbox-0.16.1
Successfully uninstalled fog-cloudatcost-0.1.2
Successfully uninstalled fog-core-1.45.0
Successfully uninstalled fog-digitalocean-0.4.0
Removing console
Removing setup
Successfully uninstalled fog-dnsimple-1.0.0
Successfully uninstalled fog-dynect-0.0.3
Successfully uninstalled fog-ecloud-0.3.0
Successfully uninstalled fog-google-0.1.0
Successfully uninstalled fog-internet-archive-0.0.1
Successfully uninstalled fog-joyent-0.0.1
Successfully uninstalled fog-local-0.6.0
Successfully uninstalled fog-openstack-0.3.6
Successfully uninstalled xml-simple-1.1.5
Installed the plugin 'fog-aws (3.3.0)'!
PS C:\Users\jkittell\Documents\Schedule3> vagrant plugin install ..\..\Downloads\vagrant-aws-0.8.0.gem
Installing the '..\..\Downloads\vagrant-aws-0.8.0.gem' plugin. This can take a few minutes...
Installed the plugin 'vagrant-aws (0.8.0)'!
PS C:\Users\jkittell\Documents\Schedule3> vagrant plugin install vagrant-aws
Installing the 'vagrant-aws' plugin. This can take a few minutes...
Installed the plugin 'vagrant-aws (0.8.0)'!
PS C:\Users\jkittell\Documents\Schedule3>
Try using:
vagrant plugin install fog-aws
vagrant plugin update
vagrant plugin install vagrant-aws
This should upgrade fog to a version 3.5 or greater

VSTS Bower not found

We are using Visual Studio Team Services for build and deployment of several sites. Some .NET and some are not. All working fine when using the hosted agent. Due to performance issues and long queue times for the hosted agent we need to use our own build agent.
Here comes the problem:
When running the VSTS builds we get an error when running bower:
******************************************************************************
Starting: bower install
******************************************************************************
C:\Program Files (x86)\nodejs\npm.cmd install -g bower
C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\npm\bower -> C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\npm\node_modules\bower\bin\bower
bower#1.7.9 C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\npm\node_modules\bower
Not found bower: null
******************************************************************************
Finishing: bower install
******************************************************************************
The problem is that bower is actually in that location:
And here are the actual bower build step:
How can we fix this Not found bower: null error?
There are known issues with tools installed into profile folders it has to do with permissions. It's easier to install the tool from an administrative console with the -g parameter. And ensure that the central NPM version is added to the service or system's %path% environment variable.
Or pass in a specific location by adding additional parameters to the call to npm: npm install --prefix "$(Agent.WorkFolder)" Bower Then specify the same location in the Advanced section of the Bower task.
Bower CLI location: $(Agent.WorkFolder)\node_modules\
(You'd need to check the exact location the package is installed to, I'm slightly guessing at the moment ;)).

Setting up Yesod on Ubuntu 13.10

After following the instructions on the QuickStart, I'm seeing some errors in Yesod when bringing up a webpage. The errors end in:
...
cannot satisfy -package-id wai-extra-1.3.4.6-62543d69d10941dae1d9b206c3eb3067:
wai-extra-1.3.4.6-62543d69d10941dae1d9b206c3eb3067 is unusable due to missing or recursive dependencies:
blaze-builder-conduit-1.0.0-1053545317cd68e3d51439dd9a0e622d zlib-conduit-1.0.0-b51dc7daf506ea4c5ecd031c5101d96a
(use -v for more information)
Build failure, pausing...
Hopefully related, the referenced tutorial has me run
cabal-dev install
on a fresh Yesod project, however that also gives me errors:
...
[1 of 1] Compiling Control.Monad.Logger ( Control/Monad/Logger.hs, dist/build/Control/Monad/Logger.o )
Control/Monad/Logger.hs:63:39:
Module System.Log.FastLogger' does not exportpushLogStr'
Control/Monad/Logger.hs:63:72:
Module System.Log.FastLogger' does not exportLoggerSet'
Control/Monad/Logger.hs:63:83:
Module System.Log.FastLogger' does not exportnewLoggerSet'
Control/Monad/Logger.hs:63:97:
Module System.Log.FastLogger' does not exportdefaultBufSize'
Failed to install monad-logger-0.3.3.0
...
On this later set of errors, I came across a page suggesting the issue has been fixed (SO won't let me post more than 2 links, but Google the error and it comes right up).
Any ideas?
Thanks in advance!
I'd suggest using cabal sandbox for each Yesod project, rather than installing the Yesod platform as part of your system libraries. Think of a cabal sandbox as a localized collection of Haskell packages in a single project, so you could have different versions of a package, say Data.Text, in 2 different cabal sandboxes. Using cabal sandbox takes longer time for compilation but it makes things simpler for dependency resolution (read more here: (read more here: http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html). cabal sandbox requires a cabal version of at least 1.18 if I'm not mistaken.
Alright, enough of the talk. Let's get started.
To get the latest cabal, it's easier if you have cabal installed through a package manager, even if the package manager installs a cabal without cabal sandbox. Since you are on Ubuntu, just:
sudo apt-get install cabal
Once you have some version of cabal installed, run:
cabal sandbox
If you see something along the lines of this:
cabal: Please specify a subcommand (see 'help sandbox')
Then congratulations, the version of cabal that you have supports cabal sandbox, just move on Once you have a Cabal with cabal sandbox section of the answer.
If instead you see something like:
cabal: unrecognised command: sandbox (try --help)
Then you will need a more modern version of cabal. Simply clone the cabal repository on github:
git clone https://github.com/haskell/cabal.git
Go to the directory, and checkout the branch Cabal-v1.18.1.2, like so:
git checkout Cabal-v1.18.1.2
Then execute:
cabal install Cabal/ cabal-install/
This should install cabal in the $HOME/.cabal/bin folder. Be sure to prepend $HOME/.cabal/bin to your PATH environment variable, before the folder where the system's cabal is located.
Once you have a Cabal with cabal sandbox
Based on what I read from the Yesod quick start guide, you will want to install the yesod-bin package. It's hackage page is here. Basically, yesod-bin provides you with a yesod binary that allows you to initialize a scaffolded site. The latest version of yesod-bin is 1.2.5.6, and that's what we're going to install.
Create a directory named yesod-bin:
mkdir yesod-bin
Go into that directory, and set up a cabal sandbox in that it, like so:
cabal sandbox init
Fetch the latest package list from hackage using:
cabal update
Now, we are going to install the latest version of yesod-bin, 1.2.5.6, in a cabal sandbox. However, yesod-bin has a dependency on the mmorph package, which defaults to install version 1.01, and trying to install mmorph-1.01 will result in an error message like the following:
src/Control/Monad/Morph.hs:76:8:
Could not find module `Control.Applicative.Backwards'
Use -v to see a list of the files searched for.
Failed to install mmorph-1.0.1
cabal: Error: some packages failed to install:
mmorph-1.0.1 failed during the building phase. The exception was:
ExitFailure 1
and installing yesod-bin without specifiy the mmorph package version defaults to installing mmorph-1.0.1, resulting in the following error:
cabal: Error: some packages failed to install:
base64-conduit-1.0.0 depends on mmorph-1.0.1 which failed to install.
blaze-builder-conduit-1.0.0 depends on mmorph-1.0.1 which failed to install.
conduit-1.0.10 depends on mmorph-1.0.1 which failed to install.
http-client-conduit-0.2.0.1 depends on mmorph-1.0.1 which failed to install.
http-conduit-2.0.0.3 depends on mmorph-1.0.1 which failed to install.
http-reverse-proxy-0.3.0 depends on mmorph-1.0.1 which failed to install.
mmorph-1.0.1 failed during the building phase. The exception was:
ExitFailure 1
network-conduit-1.0.1 depends on mmorph-1.0.1 which failed to install.
project-template-0.1.3.2 depends on mmorph-1.0.1 which failed to install.
resourcet-0.4.10 depends on mmorph-1.0.1 which failed to install.
wai-2.0.0 depends on mmorph-1.0.1 which failed to install.
wai-logger-2.1.1 depends on mmorph-1.0.1 which failed to install.
warp-2.0.2 depends on mmorph-1.0.1 which failed to install.
yaml-0.8.5.3 depends on mmorph-1.0.1 which failed to install.
yesod-bin-1.2.5.6 depends on mmorph-1.0.1 which failed to install.
which seems to be related to these 2 issues in the mmorph github repo:
https://github.com/Gabriel439/Haskell-MMorph-Library/issues/8
https://github.com/Gabriel439/Haskell-MMorph-Library/pull/10
However, mmorph version 1.0.0 works fine. As such, we will have to specify the version of mmorph to be 1.0.0 when we install yesod-bin, like this:
cabal install mmorph-1.0.0 yesod-bin-1.2.5.6
This will take quite some time. cabal sandbox creates a directory named .cabal-sandbox inside the yesod-bin directory, and the yesod binary (along with several other binaries from the yesod-bin package) can be found in the .cabal-sandbox/bin folder. Simply add that folder into your PATH, and you should be able to do the yesod init and yesod devel as seen at the end of the quick start.
As an quick update to #yanhan great answer, since I have tried to follow his guidelines on Ubuntu 14.04 LTS and get stuck a bit.
If you don't have cabal executable preinstalled, you can also do:
git clone https://github.com/haskell/cabal.git
Then of course:
git checkout Cabal-v1.20.0.2
And then you can use the bootstrap.sh script to install cabal executable and Cabal package:
cd cabal-install && ./bootstrap.sh
It will take some time, but soon after you can check the version of newly installed cabal executable:
$HOME/.cabal/bin/cabal --version