question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[docs] npm vs Yarn confusion and onboarding

See original GitHub issue

https://github.com/tauri-apps/tauri/wiki/04.-MS-Windows-Setup

The documentation makes it sound like tauri cannot function without Yarn, and that npm should not be used, which is completely backwards to everything in the Node.js ecosystem. Node ships with npm and only a small minority of projects use Yarn (let alone require it).

Further, for onboarding new users the ideal scenario would be:

  1. Install Node.js and npm
  2. npm install -g @tauri/cli
  3. tauri my-app-name
  4. cd my-app-name && npm start

But my expectations are that it at least be:

  1. Install Node.js and npm
  2. npm init -y
  3. npm install --save-dev tauri
  4. Edit your package.json to point the main to index.html
  5. Create an index.html
  6. npx tauri .

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
TheJaredWilcurtcommented, May 29, 2020

This is basically what you already have but simplified where possible.

  • Each step is numbered, since almost every step requires going to a new tab or running a command in another window, this makes keeping track of what step you were on easier.
  • Added in a note for WSL users so they know that their instructions are on another page. Not entirely sure if they should be on that page or not, but I haven’t read the Linux page yet, so I’ll assume that it is a good choice for now.
  • Build Tools
    • Used the correct name Build Tools for Visual Studio 2019 to match what the website you are linking to calls it so the user is not confused and knows to download the correct thing.
    • Added a reason for why they need that. (not sure if accurate)
    • Would be better if you could explain how to check if you already have the 2017 version.
    • Would also be nice if this could be automated via an npm install similar to Windows-Build-Tools. So you don’t need to go to a website and do it manually.
  • Removed stuff around nvm-windows. This isn’t a bad recommendation, it’s just out of scope for your project. Especially since, to install nvm on Windows without weird PATH/env conflicts you need to uninstall any existing Node versions first. There’s just many steps and caveats like “If you aren’t on Windows 10 you may need to install nodist instead” which has a different API. And nvm-windows does not support a nvm use latest, though I created an issue requesting this feature.
  • Removed Yarn and Scoop stuff. Not needed. Just use npm. This means that other pages that come after this would need to be updated similarly.
  • Simplified Rust instructions
  • Is there any way loopback could be automated? Maybe as part of the tauri-bundler install. This seems like a pretty silly step for each user to have to do by hand just for a Hello World.
  • I moved the DevTools to the optional section, but when competing against other modern XPDA tooling, not having dev tools built in is a big CON on the Pros/Cons list for Tauri. I’ve created an issue on the Edge Repo to get a non MS Store link, as that is another barrier of entry. However, not knowing what their response will be, or why the Edge DevTools specifically are needed, I’m curious if there is anyway you could get headless chrome remote devTools to work? Especially with Edge being Chromium-based now. There are many Node modules that automate downloading/setting up these dev tools. It would be much more preferable for devTools to come pre-packaged with Tauri. Even if that means your dev environment is in Chrome and the production runs on Edge. Since they’re both Chromium now, the differences between the two should be minor. Maybe have that as the default with an option you can set to run it in dev against Edge with the extra documentation around setting up the Edge DevTools.
  • There’s A LOT of stuff required right now for a simple hello world. Any efforts you can make on slimming down these prereqs will be effort well spent.

Setup for Windows

Note: For those using the Windows Subsystem for Linux (WSL) please refer to our Linux specific instructions instead.

Prerequisites

Note: “Run” means to type a command into a Command Prompt or Powershell running with administrative privileges.

  1. Install Build Tools for Visual Studio 2019
    • This is needed for when we build the native version of your app.
    • If you have the 2017 version installed, you may need to remove that first to avoid issues later when doing tauri build.
  2. Install Node.js and npm
    • npm comes with Node on Windows and OSX
  3. Install Rust
  4. Update Rust by running rustup update stable
  5. Enable Loopback. Microsoft disables the loopback interface by default. It is needed to use the dev-server.
    • Run
    CheckNetIsolation.exe LoopbackExempt -a -n="Microsoft.Win32WebViewHost_cw5n1h2txyewy"
    
  6. Close your command prompt/powershell and relaunch it
  7. Run cargo install tauri-bundler --force

Optional:

  1. If you want to debug the front-end you will have to download Microsoft Edge Devtools from the Microsoft store. This will allow you to attach to a running instance of your Tauri project! If you need help take a look at the devtools-guide.

This gets you down to 3 global installs and 3 commands. But doesn’t actually get you all the way to a Hello world. there will be files and lines of code, and these are all OS Specific instructions. Though the Node and Rust stuff could probably be moved out to a non-OS specific section.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NPM vs. Yarn: Which Package Manager Should You Choose?
We'll be comparing NPM vs. Yarn side by side so that you can make the right decision on the one to go for...
Read more >
Detect and prevent dependency confusion attacks on npm to ...
Learn about dependency confusion attacks, how they manifest for ... are using npm or yarn, you are vulnerable to this supply chain attack....
Read more >
What is the difference between yarn run and npm start?
It seems yarn run start is the equivalent of npm start , which runs the script inside the start field of the script...
Read more >
Yarn vs npm: Everything You Need to Know - SitePoint
Yarn stands for Yet Another Resource Negotiator. The Yarn package manager is an alternative to npm, released by Facebook in October 2016. The ......
Read more >
@splitmedialabs/devctl - npm
start docker-compose presets for easier onboarding and project switching; customize what to ... Node 8+; NPM or Yarn; Docker; Docker-Compose ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found