npx mrm lint-staged erroring out with 'Preset "default" not found." - prettier

Example of the issue:
❯ npx mrm lint-staged
npx: installed 298 in 9.141s
Preset “default” not found.
We’ve tried to load “mrm-preset-default” and “default” npm packages.
Can't run this command and I don't know why!

The problem is within mrm which is currently in version 3 that seems to be incompatible with lint-staged, to fix this you got to specify mrm version 2 by running npx mrm#2 lint-staged

Related

How to fix build error because Install pods using EAS build EXPO?

I'm trying to build an IOS app using EAS service expo, but when I try to build, there is an error while install pods on build details expo. And this is the error.
Unable to find a specification for `UMTaskManagerInterface` depended upon by `EXLocation`
I try to install pod by npm i pod-install but still get error. Is this because I build on Windows, or what should I do to fix this error? I also try to find the error in GitHub forum, and it's say adding path pod in ios/Podfile which I can't find it in my expo project. Where is ios/Podfile file located in expo project?
This is the full error
Installing pods
Using Expo modules
Auto-linking React Native modules for target `MMS`: RNCAsyncStorage, RNCCheckbox, RNDateTimePicker, RNGestureHandler, RNPermissions, RNReanimated, RNScreens, react-native-safe-area-context, and react-native-viewpager
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
CocoaPods 1.11.2 is available.
To update use: `sudo gem install cocoapods`
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.11.2
[!] Unable to find a specification for `UMTaskManagerInterface` depended upon by `EXLocation`
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
[stderr] [!] `<PBXResourcesBuildPhase UUID=`13B07F8E1A680F5B00A75B9A`>` attempted to initialize an object with an unknown UUID. `2EE81B3C866A4A13B6460929` for attribute: `files`. This can be the result of a merge and the unknown UUID is being discarded.
pod exited with non-zero code: 1
Edit*
i try using expo build:ios-> archive is working perfectly. why using eas build -p ios i got that error?

Error: Custom: Invalid blockhash when solana program deploy

Trying to deploy a program to solana devnet.
I was using
solana program deploy ./path/xxxx.so -u devnet
And I got multiple lines of
msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J
msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J
msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J
msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J
msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J
It gave me this error in the end
Error: Custom: Invalid blockhash
Tried search online but didn't get any useful informations
I was able to resolve this error by reverting to earlier versions of solana-cli and anchor-cli
solana-cli 1.8.0 (src:4a8ff62a; feat:1813598585)
anchor-cli 0.18.2
rustc 1.57.0 (f1edd0429 2021-11-29)
I also shared the above solution in this related github issue
One guess I have is that ExitStatus(unix_wait_status(256)) (which was in my error logs) could be a "time out error" from waiting too long due to slower deployment validation.
I did notice my deployments using later versions (solana-cli 1.9.1, anchor-cli 0.20.1) being significantly slower, especially for larger programs (my small program deployments were still working fine). These were the versions that showed similar "msg" logging as OP.
UPDATE:
Nowadays, my most fool proof solution is to run the snippet below before deployments
sh -c "$(curl -sSfL https://release.solana.com/v1.8.13/install)"
For deploying to devnet via Anchor, the error I got:
Error: Custom: Invalid blockhash
There was a problem deploying: Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "" }.
I have solved this:
Local npm package: #project-serum/anchor 0.20.1
Solana program dependencies: anchor-lang 0.20.1, anchor-spl 0.20.1, solana-program 1.9.4
deploy to devnet: failed
Local npm package: #project-serum/anchor 0.19.0
Solana program dependencies: anchor-lang 0.19.0, anchor-spl 0.19.0, solana-program 1.9.4
deploy to devnet: successful or failed
Local npm package: #project-serum/anchor 0.18.2
Solana program dependencies: anchor-lang 0.18.2, anchor-spl 0.18.2, solana-program 1.9.4
deploy to devnet: successful or failed
in all cases, the global environment is the same:
Rust 1.57.0
solana-cli 1.9.4
#project-serum/anchor-cli 0.20.1
it seems sometimes the transaction may fail and those transactions include program deployment. see reference: https://www.brianfriel.xyz/resending-dropped-transactions-on-solana/
This seems to be only because of anchor's version, I had the following versions installed:
Rust 1.59.0
solana-cli 1.9.6
anchor-lang 0.22.1
I couldn't deploy to devnet because of
Error: Custom: Invalid blockhash
There was a problem deploying: Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "" }.
So I just changed anchor-lang to 0.22.0 and all worked well.
That's very strange, and not the normal output that you should get while deploying a program. Have you tried updating to the latest Solana SDK, which is 1.9.2 at the time of writing? More docs at https://docs.solana.com/cli/install-solana-cli-tools#use-solanas-install-tool
I just tried this on devnet, and got the following output:
$ solana program deploy path/to/program.so -u devnet
Finding leader nodes...
[x/y] Transactions sent...
[x/y] Transactions confirmed. Retrying in z blocks.
Program Id: 6sxk3XpYapcRnpSwRKFS1nGK9MJpm8Jkb9aofnBcG1p8
For Mac M1,
Rust 1.57.0
solana-cli 1.8.0
#project-serum/anchor-cli 0.20.1
these tools' versions work.
I tried myself.
https://github.com/project-serum/anchor/issues/1157#issuecomment-1065828414
try solana cli 1.8.12 as 1.9.* seems to have issues deploying on devnet
I had similar error in chainlink contract github example. I changed this line in Execute Struct
pub system_program:Program<'info,System>,
to this:
#[account(address=system_program::ID)]
/// CHECK:
pub system_program:AccountInfo<'info>,
I had to import system_program
use anchor_lang::solana_program::system_program;
for me, to solve it my solana-cli version was 1.9.4 and I just updated with
solana-install update
and it's downgraded to 1.8.16 and deployed my program without any problem.
before this I can't deploy using anchor test(process) or solana program deploy.
Also, If you upgrade to one of the 1.10.X versions the issue will fix.

How to fix error "File "/.../google/cloud/storage/_http.py", line 33, in __init__ TypeError: __init__() takes 2 positional arguments but 3 were given"

The above mentioned error occurred while trying to run a cloud function in Google Cloud Platform. The error occurred in its main.py written in python in the line "storage_client=storage.Client()"
I have also checked the github repository for google-cloud-python/storage/google/cloud/storage/_http.py line 33 where it is showing error but I have done nothing with those variables anywhere, I reckon
Any help will be appreciated
I just experienced this same issue--
Short answer-- upgrade the google-cloud-core package: e.g. in my case I had
google-cloud-core==0.29.1
Upgrading to version 1.0.2 solved my issue:
pip3 install --upgrade google-cloud-core==1.0.2
For me, this arose from installing all my python packages from a requirements.txt file, which had explicit versions. Sometime later, I must have upgraded and the packages did not stay aligned.

File not found error while testing python impyla

I am trying to set up a connection between python and impala. Based on the instructions here I am trying to set up impyla.
I am on a vagrant ubuntu/xenial64 box with python 2.7.12. After reading about some issues with the latest thrift I downgraded to the specified version. After pip installing and setting up the environment variables, I am trying to run the test but it is failing with the file not found error, as follows:
ubuntu#ubuntu-xenial:~/.local/lib/python2.7/site-packages/impala$ py.test --connect impyla
======================================== test session starts ========================================
platform linux2 -- Python 2.7.12, pytest-2.8.7, py-1.4.31, pluggy-0.3.1
rootdir: /home/ubuntu/.local/lib/python2.7/site-packages/impala, inifile:
=================================== no tests ran in 0.00 seconds ====================================
ERROR: file not found: impyla
ubuntu#ubuntu-xenial:~/.local/lib/python2.7/site-packages/impala$
I think I am missing out on something very fundamental here. I have no previous experience with python tests. I would like to stick with python 2.7 because of some other dependencies.
PS:
Please note the latest version provided in the repo readme is 0.13.1 but with my pip install impyla it came out to be 0.14.0.
I am running the test from my site-package/impala directory as the readme says to be in the directory where impyla is.
There is no mention of any inifile in the readme (as far as I could see.)
EDIT 1:
When I run it from site-package directory without --connect I get the same error. But with the argument, it says that the argument is unrecognizable. The output is as follows:
ubuntu#ubuntu-xenial:~/.local/lib/python2.7/site-packages$ py.test --connect impyla
usage: py.test [options] [file_or_dir] [file_or_dir] [...]
py.test: error: unrecognized arguments: --connect
inifile: None
rootdir: /home/ubuntu/.local/lib/python2.7/site-packages
ubuntu#ubuntu-xenial:~/.local/lib/python2.7/site-packages$
Any help on how to troubleshoot this would be helpful.

Why doesn't my custom recipes run on AWS OpsWorks?

I've created a GitHub repo for my simple custom recipe:
my-cookbook/
|- recipes/
|- appsetup.rb
I've added the repo to Custom Chef Recipes as https://github.com/my-github-user/my-github-repo.git
I've added my-cookbook::appsetup to the Setup "cycle".
I know it's executed, because it fails to load if I mess up the syntax.
This is my appsetup.rb:
node[:deploy].each do |app_name, deploy|
script "install_composer" do
interpreter "bash"
user "root"
cwd "#{deploy[:deploy_to]}/current"
code "curl -sS https://getcomposer.org/installer | php && php composer.phar install --no-dev"
end
end
When I log into the instance by SSH with the ubuntu user, composer isn't installed.
I've also tried the following to no avail (A nodejs install):
node[:deploy].each do |app_name, deploy|
execute "installing node" do
command "add-apt-repository --yes ppa:chris-lea/node.js && apt-get update && sudo apt-get install python-software-properties python g++ make nodejs"
end
end
Node doesn't get installed, and there are no errors in the log. The only references to the cookbook in the log just says:
[2014-03-31T13:26:04+00:00] INFO: OpsWorks Custom Run List: ["opsworks_initial_setup", "ssh_host_keys", "ssh_users", "mysql::client", "dependencies", "ebs", "opsworks_ganglia::client", "opsworks_stack_state_sync", "mod_php5_apache2", "my-cookbook::appsetup", "deploy::default", "deploy::php", "test_suite", "opsworks_cleanup"]
...
2014-03-31T13:26:04+00:00] INFO: New Run List expands to ["opsworks_initial_setup", "ssh_host_keys", "ssh_users", "mysql::client", "dependencies", "ebs", "opsworks_ganglia::client", "opsworks_stack_state_sync", "mod_php5_apache2", "my-cookbook::appsetup", "deploy::default", "deploy::php", "test_suite", "opsworks_cleanup"]
...
[2014-03-31T13:26:05+00:00] DEBUG: Loading Recipe my-cookbook::appsetup via include_recipe
[2014-03-31T13:26:05+00:00] DEBUG: Found recipe appsetup in cookbook my-cookbook
Am I missing some critical step somewhere? The recipe is clearly recognized and loaded, but doesn't seem to be executed.
(The following are fictitious names: my-github-user, my-github-repo, my-cookbook)
I know you've abandoned the cookbook but I'm almost 100% sure it's because you don't have a metadata.rb file in the root of your cookbook.
Your cookbook name should not contain a dash. I had the same problem, replacing by '_' solved it for me.
If those commands are failing silently, it could be that your use of && is obscuring a failure.
As for add-apt-repository, that is an interactive command. Try using the "--yes" option to answer yes by default, making it no longer interactive.
If you do not execute your command successfully, you will not find the files in the current directory. Check inside the last release folder to see if it had been put there.
It maybe prudent to check if you got the right directory etc setup by changing the CWD to : /tmp