rustwasm / book

The Rust and WebAssembly Book
https://rustwasm.github.io/docs/book/
MIT License
1.75k stars 211 forks source link

Running `wasm-pack build` doesn't create package.json in `pkg` directory #254

Open ev-rvs opened 3 years ago

ev-rvs commented 3 years ago

Describe the bug Stepping through the steps in the book and when I run the command wasm-pack build and the pkg directory gets created with all the appropriate files except the package.json, which is missing and I have to manually create it.

To Reproduce Specs:

Expected behavior Copied from book: pkg/ ├── package.json ├── README.md ├── wasm_game_of_life_bg.wasm ├── wasm_game_of_life.d.ts └── wasm_game_of_life.js

Screenshots

Screen Shot 2021-03-16 at 3 43 18 PM

Additional context There may also be a bug related to a named project and importing the dependency for ../pkg and npm install, the package is still named wasm-game-of-life in the node_modules.

darknoon commented 2 years ago

Had the same issue, did you find a good workaround?

ev-rvs commented 2 years ago

I believe I generated one myself using npm init -y, but it's been a while ago. I then pieced together the packages and applied it to the package.json. I was hoping a bug would be created for this issue. Sorry you experienced this as well. Let me know if that works for you.