Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create www directory #117

Open
JasonGoemaat opened this issue Jul 21, 2024 · 2 comments
Open

Cannot create www directory #117

JasonGoemaat opened this issue Jul 21, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@JasonGoemaat
Copy link

Describe the Bug

Following the instructions in the book I'm getting this error:

jason@LAPTOP-KUS5B2I0 MINGW64 /c/git/rust/wasm-game-of-life (master)
$ npm init wasm-app www
npm error could not determine executable to run
npm error A complete log of this run can be found in: C:\Users\jason\scoop\persist\nodejs\cache\_logs\2024-07-21T23_46_03_815Z-debug-0.log

Versions:

$ node --version
v22.5.1

$ npm --version
10.8.2

$ cargo --version
cargo 1.79.0 (ffa9cf99a 2024-06-03)

$ rustup --version
rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.79.0 (129f3b996 2024-06-10)`

$ rustc --version
rustc 1.79.0 (129f3b996 2024-06-10)

Steps to Reproduce

  1. Follow the tutorial
cargo generate --git https://github.com/rustwasm/wasm-pack-template

# enter wasm-game-of-life

cd wasm-game-of-life

wasm-pack build

npm init wasm-app www

Expected Behavior

The www directory should be created with the web page project to use the output of the rust wasm build.

Actual Behavior

This error:

npm error could not determine executable to run
npm error A complete log of this run can be found in: C:\Users\jason\scoop\persist\nodejs\cache\_logs\2024-07-21T23_51_45_084Z-debug-0.log

Happens with these commands I tried

  • npm init wasm-app www
  • npm init wasm-app
  • npx create-wasm-app www
  • npx create-wasm-app
  • npm create wasm-app www

Additional Context

Using Windows 10 and tried with git bash and windows command prompt

@JasonGoemaat JasonGoemaat added the bug Something isn't working label Jul 21, 2024
@deanbear
Copy link

deanbear commented Jul 23, 2024

my solution (it's weird but works for me):

on your wasm-game-of-life directory,

  1. npm install -g create-wasm-app
  2. new a package.json file in root dir:
{
  "dependencies": {
    "create-wasm-app": "/usr/local/lib/node_modules/create-wasm-app"
  }
}
  1. npm install
  2. npm init wasm-app www
  3. 🦀 Rust + 🕸 Wasm = ❤

my environment:

npm verbose os Darwin 21.6.0
npm verbose node v22.5.1
npm verbose npm  v10.8.2

@gplanansky
Copy link

ditto error as reported by JasonGoemaat above

ditto, identical workaround solution as reported by deanbear above (thank you!)

environment:
macOS 13.6.7 arm64e
node v22.5.1
npm 10.8.2
cargo 1.79.0 (ffa9cf99a 2024-06-03)
cargo generate-generate 0.21.3
rustc 1.79.0 (129f3b996 2024-06-10)
rustup 1.27.1 (54dd3d00f 2024-04-24)
wasm-pack 0.13.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants