yarn add not working - yarnpkg

I can't install a forked git repository. I want to install version #0.31.0.
yarn add https://github.com/Goldjan/material-components-web.git#v0.31.0
I get the following error:
C:\Users\qjan8\Websites\XXXXXX>yarn add https://github.com/Goldjan/material-components-web.git#v0.31.0
yarn add v1.7.0
[1/4] Resolving packages...
error Can't add undefined: invalid package version undefined.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Does this have to be a name for the package.json?

I had a similar issue, the repo I was trying to add as a dependency didn't have a version field in the package.json. Adding that fixed the issue.

Related

Yarn encounters 404 error installing local and remote packages for specific project folder

I'm encountering the following message when installing packages:
YN0001: │ HTTPError: Response code 404 (Not Found)
at se.<anonymous> (C:\Code\.yarn\releases\yarn-berry.cjs:23:10082)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
This happens for both a local package using yarn add ../my-package or remote package (testing using yarn add lodash).
When I'm in another project on the same computer, the package is installed fine. What could be causing this?
This could be that a yarn link has been deleted. When making the symlink using yarn link, a resolutions field is added in package.json. Just having this link however is not adequate.

Use yarn global install,An unexpected error occurred: "ENOENT: no such file or directory, chmod '/usr/local/opt/nvm/versions/node/v10.15.0/bin/umi'"

When I use yarn global install packages ,I will see the error "An unexpected error occurred: "ENOENT: no such file or directory, chmod '/usr/local/opt/nvm/versions/node/v10.15.0/bin/umi'". Now,I use nvm to control my node version.
My system is MacOs 10.15.3 and node version is v10.15.0.
Now,I use nvm to control node version.
yarn global add umi
# show error
yarn global v1.22.4
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Installed "umi#3.2.10" with binaries:
- umi
error An unexpected error occurred: "ENOENT: no such file or directory, chmod '/usr/local/opt/nvm/versions/node/v10.15.0/bin/umi'".
info If you think this is a bug, please open a bug report with the information provided in "/Users/jokky/.config/yarn/global/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
I solved this problem.
first ,I open the file .yarnrc.
add next line text
prefix "/path/.config/yarn"
this path is your yarn download path

error Couldn't find package "create-vuepress" on the "npm" registry

Based on this guide:
https://vuepress.vuejs.org/guide/getting-started.html#quick-start
I am trying to create a new vuepress project with:
$ yarn create vuepress sample-docs
But I get:
$ yarn create vuepress sample-docs
yarn create v1.22.4
[1/4] Resolving packages...
error Couldn't find package "create-vuepress" on the "npm" registry.
No hits on google for that error. Any suggestions?

error Couldn't find package "#icons/material#^0.2.4" required by "react-color#^2.13.8" on the "npm" registry

When i do 'yarn install' i get this below error:
Error message:
yarn install v1.12.3
info No lockfile found.
[1/4] Resolving packages...
warning Resolution field "react#16.4.1" is incompatible with requested version "react#15"
**error Couldn't find package "#icons/material#^0.2.4" required by "react-color#^2.13.8" on the "npm" registry.**
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Doing this resolved my issue:
npm config set #icons:registry https://registry.npmjs.org/
Check if you have any other .npmrc or .yarnrc file in your root folders. It might override your project's configurations when you do a yarn install. Worked for me when I removed these files from my other directories

Install go package with dependencies

I had some issues with gopath configuration. I was able to resolve the go path issue. But getting this error...
[root#localhost mysqlbeat]# go get github.com/adibendahan/mysqlbeat
# github.com/adibendahan/mysqlbeat/beater
/root/go/src/src/github.com/adibendahan/mysqlbeat/beater/mysqlbeat.go:289:7: b.Events undefined (type *beat.Beat has no field or method Events)
/root/go/src/src/github.com/adibendahan/mysqlbeat/beater/mysqlbeat.go:303:7: b.Events undefined (type *beat.Beat has no field or method Events)
/root/go/src/src/github.com/adibendahan/mysqlbeat/beater/mysqlbeat.go:326:5: b.Events undefined (type *beat.Beat has no field or method Events)
How do I correctly install go package along with all it's dependencies?
Update:
I downloaded the package and tried to run it.Different error this time...
[root#localhost mysqlbeat]# make
go build
can't load package: /root/go/src/src/github.com/adibendahan/mysqlbeat/main.go:8:2: non-standard import "github.com/adibendahan/mysqlbeat/beater" in standard package "src/github.com/adibendahan/mysqlbeat"
make: *** [build] Error 1
Check out the How to Build section on README.md on mysqlbeat.
mysqlbeat uses Glide for dependency management. Check this for installing glide.
After installing Glide, clone the mysqlbeat repository and run:
$ glide update --no-recursive
$ make
If you still want to import this repository by go get, clone the repo and then run go get ./... from its root directory.

Resources