I was trying to install react-query. But it is not installed. How to solve it - react-query

Heading
yarn add v1.22.18
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies
caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/#tanstack%2freact-query: Not found".
info If you think this is a bug, please open a bug report with
the information provided in "G:\Projects\74\doctors-portal-client\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

As suggested by the error message, you can try to delete your package-lock.json file to get rid of the warning. As stated in the npm documentation, package-lock.json is automatically generated by npm for any operation that modifies the node_modules tree or package.json, so don't worry about breaking anything by removing this file, as it will be generated the next time you make some changes to your project.

Related

Magento 2.3.5 fresh installtion using composer results in error

I am trying to install Magento 2.3.5 using composer.
muk#muk:/var/www/html$ composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.3.5 magento23
Creating a "magento/project-community-edition" project at "./magento23"
Installing magento/project-community-edition (2.3.5-p1)
- Installing magento/project-community-edition (2.3.5-p1): Loading from cache
Created project in /var/www/html/magento23
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 463 installs, 0 updates, 0 removals
- Installing magento/magento-composer-installer (0.1.13): Loading from cache
- Installing laminas/laminas-dependency-plugin (1.0.3): Loading from cache
Plugin installation failed (include(/var/www/html/magento23/vendor/laminas/laminas-dependency-plugin/src/DependencyRewriterPlugin.php): failed to open stream: No such file or directory), rolling back
- Removing laminas/laminas-dependency-plugin (1.0.3)
[ErrorException]
include(/var/www/html/magento23/vendor/laminas/laminas-dependency-plugin/src/DependencyRewriterPlugin.php): failed to open stream: No such file or directory
create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--add-repository] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]
I am getting following error.
Plugin installation failed (include(/var/www/html/magento23/vendor/laminas/laminas-dependency-plugin/src/DependencyRewriterPlugin.php): failed to open stream: No such file or directory), rolling back
- Removing laminas/laminas-dependency-plugin (1.0.3)
My Composer version
muk#muk:/var/www/html$ composer --version
Composer version 1.10.5 2020-04-10 11:44:22
I am using VirtualBox with Shared folder.
How can I fix it?
Note: To fix it I stopped using shared folder. Now I keep the entire code in the VM and do not use shared folder. For file synching I am using mutagen.
if anyone runs into this issue, it looks to be a problem with virtualBox and shared folders. when unzipping files, they are not immediately available in the environment.
the solution is by rkamp and is also available here:
https://stackoverflow.com/a/66413857/1470145
in short, one needs to override unzip to add a brief delay after unzipping.
I thought I had the same issue, but turned out it was something else.
The upgrade went OK for me, for a sandbox/clean 2.3.4 install, and a client project running 2.3.4.
A few things:
This could possibly be an issue with your cache, try to clear your composer laminas cache (~/.composer/cache/files/laminas usually)
Although it would complain about that, you've possibly got unmet platform requirements (php version, etc.)
Try clearing your entire composer cache (~/.composer)
Double-check the repository URL (should it be 2.3.5 or 2.3.5-p1?)
Hope that helps

Error: [BABEL] /home/vsts/work/1/s/src/index.js: Cannot find module './src/data' [duplicate]

I created a project with vue-cli 4.1.1, and after running yarn serve, i got the following error
Error: [BABEL] C:\dev\vuestudy\src\main.js: Cannot find module './src/data' (While processing: "C:\\dev\\vuestudy\\node_modules\\#vue\\cli-plugin-babel\\preset.js")
Any tips on this?
Thanks in advance.
UPDATE:
Kousha and Dave are right,after waiting for the core-js package update, I created a new project, and now it's working.
It looks like there's been a bad build of npm package core-js-compat. This is a deep-down dependency of Babel. Lots of things will be affected, things that use Babel.
You will experience this problem if you have core-js-compat v.3.4.6. You can check this by doing npm list core-js-compat. The problem is apparently fixed by v.3.4.7, which was pushed out pretty quickly, about half-an-hour later, but unfortunately it takes a while to spread out through the repositories. You can either wait until an npm update gets you v.3.4.7 or you can go manually download v.3.4.7 if you want to get going right away.
This is a bug with core-js-compat v3.4.6, but already the fix has gone with v3.4.7. See https://github.com/zloirock/core-js/issues/712 for more detail.
You may be able to force install the not-broken version with
npm i core-js-compat#3.4.7 --save
It worked on my machineā„¢
With Vue / Nuxt, you can delete package-lock.json and node_modules and do an npm install to fix this issue.

Google Speech to Text iOS app example: could not build module 'googleapis'

Has anyone been able to successfully build Google's Speech to Text iOS example in Swift 4?
The swift project posted to the Github repo: GoogleCloudPlatform/ios-docs-samples does not seem to be well-maintained. When I open the workspace example, I immediately get 3 build errors in locating header files and "could not build module googleapis."
On installing googleapis
I looked up documentation on pod install for pod 'googleapis', :path=> "." but this produces the following error: [!] No podspec found for googleapis in . I found the googleapis.podspec and downloaded the .zip file and when I did a pod install, got this error:
[!] /bin/bash -c
set -e
Pods/!ProtoCompiler/protoc --plugin=protoc-gen-grpc=Pods/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin --objc_out=. --grpc_out=. -I . -I Pods/!ProtoCompiler google//.proto google////.proto google//.proto: No such file or directory
On $ npm install googleapis, I get errors:
npm WARN saveError ENOENT: no such file or directory, open '/Users/grehce/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/grehce/package.json'
npm WARN grehce No description
npm WARN grehce No repository field.
npm WARN grehce No README data
npm WARN grehce No license field.
On locating Header files
Even after pointing it to the correct path in Build Settings > Header Search Paths, the headers are still unable to be found.
missing header file even though it exists
added Header Search Paths
If someone can help correct those above 2 issues OR provide a working iOS example of the Google Speech to Text integrated .xcodeproj example, would be much appreciated!
Github: https://github.com/GoogleCloudPlatform/ios-docs-samples/issues/89
I had problems getting this sample to work as well until I realised that that you are supposed to run the script ./INSTALL-COCOAPODS instead of just doing a regular pod install. This fixes up some paths after installing the pods. Alternatively, you can follow the instructions in the BUILDFIXES file in the repo.
It's annoying that it doesn't just work like any other project, but at least, once you read the manual, it is an easy enough fix.
This is very annoying and bears better documentation from Google's part.
On installing googleapis
You must add the "google" folder from the iOS example project into the same folder as your xcodeproj (sort of alluded to here: https://github.com/GoogleCloudPlatform/ios-docs-samples/issues/19)
You must ignore the "Cannot load underlying module for googleapis" and force build after the googleapis pod install has succeeded. Apparently, "Cannot load underlying module for x" is an xcode bug (Cocoapods + Cannot load underlying module for 'x')
note:
pod 'googleapis', :path=> "."

IBM Cloud Node-RED Manage Palette doesn't install items

I'm on IBM Cloud trying to install node-red-node-smooth from the manage palette, and I'm getting an error. I've tried several other packages as well. The error that I get in my debug log shows:
npm WARN saveError ENOENT: no such file or directory, open '/home/vcap/app/.node-red/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/vcap/app/.node-red/package.json'
npm WARN .node-red No description
npm WARN .node-red No repository field.
npm WARN .node-red No README data
npm WARN .node-red No license field.
+ node-red-node-smooth#0.1.0
updated 1 package in 4.726s
npm ERR! Object.entries is not a function
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vcap/app/.npm/_logs/2018-05-10T15_01_53_296Z-debug.log
The log file has a stack trace that starts with this:
106 verbose stack TypeError: Object.entries is not a function
Is there something obvious that I'm doing wrong?
instances deployed in the last few days got npm 6.0.0. This version of npm contained a bug that caused the Object.entries is not a function error.
npm released 6.0.1 that fixed this issue today (Thursday May 10th 2018)
You have three possible ways to fix your instance:
deploy a new instance and copy your flows over
or, set the NPM_CONFIG_AUDIT environment variable* to false - which stops npm 6.0.0 going down the code path containing the bug.
or, set the NODE_MODULE_CACHE environment variable* to false and trigger a restage of your application - that will get npm 6.0.1 installed.
If you don't have much in the way of flows at this point, deleting and creating a new instance is the easiest option.
If you want to 'repair' your existing instance, option 2 is probably the easiest as it just requires an automatic restart of the app, rather than a restage which requires the cf command-line tool to trigger manually.
To set an environment variable within your IBM Cloud application, go to your application's dashboard page. Go to the Runtime section in the left-hand navigation. Select 'Environment Variables' in the tabs across the top and scroll down to the 'User defined' section of the page. Click 'Add' - enter the env var details and click 'Save'. Your app will be restarted with the variable set.

Unable to install package. Lock file has not changed, Skipping lock file write

I am trying to install System.ComponentModel.Annotations through VS 2017 package manager console.
Command:
Install-Package System.ComponentModel.Annotations -Version 4.3.0
Outcome
Restoring packages for
C:\MyTest.csproj...
Installing NuGet package System.ComponentModel.Annotations 4.3.0.
Committing restore... Writing lock file to disk. Path:
C:\MyTest\obj\project.assets.json
Restore completed in 816.43 ms for
C:\MyTest.csproj.
Restoring packages for
C:\MyTest.csproj...
Committing restore... Lock file has not changed. Skipping lock file
write. Path:
C:\MyTest\obj\project.assets.json
Restore completed in 2.03 sec for
C:\MyTest.csproj.
Executing nuget actions took 4.12 sec Time Elapsed: 00:00:05.2258592
Note:
I am using .NETCoreApp1.1 framework.
Unable to install package. Lock file has not changed, Skipping lock file write
I also got the same outcome in the output windows when I restore/update that package, but I found that package was already installed to the project after checking the project Dependencies and project file(.csproj). And the outcome did not tell the installation failed, just prompting skip lock file write:
Restoring packages for C:\MyTest.csproj... Committing restore... Lock file has not changed. Skipping lock file write.
So this message comes only if that package was already installed to the project. When you got that log, you should double check the project reference, make sure if the package already installed.
One should also check if there is a Directory.Build.targets file in some parent directory of the project that defines the version of the package. If this is the case (I had this problem), VS will ignore the version you install and will keep the version defined in the file, so you have to update the version there.