eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.22k stars 868 forks source link

please document how to set Yarn's npm registry #963

Open kenyee opened 3 years ago

kenyee commented 3 years ago

Do you want to request a feature or report a bug? feature/documentation

What is the current behavior? docs are insufficient to solve issue

If the current behavior is a bug, please provide the steps to reproduce. I've tried everything I could think of to get "yarn install" to use our internal artifactory registry w/o luck:

What is the expected behavior? running "yarn set config registry" as a command should have worked but it did not

Please mention your frontend-maven-plugin and operating system version. OSX Big Sur frontend-maven-plugin 1.11.3

eirslett commented 3 years ago

Idk, I don't use yarn... 🤷 maybe if somebody who uses yarn can help out, and also at the same time write some docs about it, that would be great!

Does it work for you if you run yarn directly, without the Maven plugin? Is it a problem with the Maven plugin, or a problem with yarn?

kenyee commented 3 years ago

I don't understand how the plugin calls yarn properly unfortunately. You mean run the yarn command directly from maven w/o the plugin?

eirslett commented 3 years ago

No, I mean call yarn directly without Maven.

paleite commented 3 years ago

Make sure your yarn.lock-file entries use your artifactory’s urls; yarn will fetch from the registry defined there.

Yarn will read .npmrc, so create it, if you haven’t already, and set your registry in there instead. I couldn’t get yarn to pick up registry settings in .yarnrc properly.

If you require authentication for your artifactory, also set ‘always-auth=true’

kenyee commented 3 years ago

Thanks @paleite, you're a lifesaver. The reason was indeed the yarn-lock file. I deleted it and added it to my .gitignore. yarn actually renamed their .yarnrc file FYI....it's now .yarnrc.yaml. I just ended up adding a yarn command to set the registry in my pom.xml instead.

Should I put up a PR w/ extra docs on the yarn setup piece of this? Feels like it could save people some pain... 😂

eirslett commented 3 years ago

Yes please! Some helper/debug/troubleshooting info under "Running Yarn" maybe.

kenyee commented 3 years ago

added https://github.com/eirslett/frontend-maven-plugin/pull/964

Hopefully that's clear enough?