Wasm-pack: document npm link

Created on 8 Feb 2019  路  5Comments  路  Source: rustwasm/wasm-pack

At the beginning of the guide book, under chapter 1.2 it states that later in the tutorial, if you don't want to publish to npm ,you can use npm link to run your wasm code. I was wondering if that part just wasn't written yet or it was intentionally left out?

I don't know if it's appropriate to open the issue about the book here since I couldn't find the repository for it anywhere. I only found the rust wasm book.

Also where would I direct general questions about usage that are probably not important enough to be issues?

PR welcome help wanted

Most helpful comment

The tutorial now recommends referencing the package using file paths. That's much nicer than "npm link", the latter resulted in a lot of permission issues and did not work together with nvm.

I think this issue can be closed.

All 5 comments

Hello!

You are right to note that that portion of the docs is missing! You can learn more about npm link here in the npm docs: https://docs.npmjs.com/cli/link

We would welcome a PR that makes this more clear :)

Regarding questions about general usage that you believe are not worthy of issues:

  1. They are worthy of issues! Please don't worry about opening issues like these. We welcome them.
  2. You can reach us on the mozilla IRC #rust-wasm channel or the rust Discord channel #wasm-wg: https://discord.gg/BnxWJD

Feel free to reach out to me personally as @ag_dubs on IRC, Discord, or twitter!

How to use npm link can be found at this link https://rustwasm.github.io/book/game-of-life/hello-world.html under chapter 5.2 at the very bottom above Serving Locally. Would it be fine to reuse that? It seems some of those docs were meant to be part of the wasm-pack guide.

@lazypassion sorry for the delay in response! the working group has plans to deduplicate the documentation, but for the moment I think reusing that is a perfectly fine idea!

Is this still an issue? I think it can be closed:

The only where publishing to npm seems to be mentioned is: https://rustwasm.github.io/docs/book/game-of-life/publishing-to-npm.html?highlight=prere#prerequisites . And it seems like you just not run this step correct? Though npm link is "kind of" mentioned here, in a broken mardown link, but not enough I think to need to add additional documentation: https://github.com/rustwasm/wasm-pack/blob/master/docs/src/prerequisites/npm.md

If we decide this issue it still valid, I wouldn't mind trying to add docs on this. Thanks!

The tutorial now recommends referencing the package using file paths. That's much nicer than "npm link", the latter resulted in a lot of permission issues and did not work together with nvm.

I think this issue can be closed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ishitatsuyuki picture ishitatsuyuki  路  5Comments

marcoscaceres picture marcoscaceres  路  3Comments

Outpox picture Outpox  路  4Comments

grovesNL picture grovesNL  路  4Comments

netgusto picture netgusto  路  4Comments