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

Install step doesn't work #95

Closed
Pauan opened this issue Jan 9, 2019 · 6 comments
Closed

Install step doesn't work #95

Pauan opened this issue Jan 9, 2019 · 6 comments
Labels
bug Something isn't working dependencies

Comments

@Pauan
Copy link
Contributor

Pauan commented Jan 9, 2019

I just tried to use npm init rust-webpack todomvc and I get this error:

npx: installed 1 in 14.615s
 🦀 Rust + 🕸 WebAssembly + Webpack = ❤️
events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: spawn npm ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
    at onErrorNT (internal/child_process.js:407:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
    at onErrorNT (internal/child_process.js:407:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)

If I manually run npm install in the todomvc directory it works fine, though I get these warnings:

> webpack-cli@3.2.0 postinstall todomvc\node_modules\webpack-cli
> opencollective postinstall


     *** Thank you for using webpack-cli! ***

Please consider donating to our open collective
     to help us maintain this package.

  https://opencollective.com/webpack/donate

                    ***

npm WARN create-rust-webpack@0.1.5 license should be a valid SPDX license expression
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 636 packages from 420 contributors and audited 8213 packages in 139.856s
found 1 high severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details

Metadata

OS: Windows 10 64-bit
wasm-pack: 0.5.1
Node: v10.15.0
npm: 6.4.1

@fitzgen
Copy link
Member

fitzgen commented Jan 9, 2019

Thanks for the bug report @Pauan!

@fitzgen fitzgen added bug Something isn't working dependencies labels Jan 9, 2019
@xtuc
Copy link
Member

xtuc commented Jan 10, 2019

Could someone please run npm audit fix and commit the diff. This will fix the installation for now, it will probably be fixed upstream in the meantime.

fitzgen added a commit that referenced this issue Jan 10, 2019
@fitzgen
Copy link
Member

fitzgen commented Jan 10, 2019

This works for me after #96:

$ npm init rust-webpack todomvc
 🦀 Rust + 🕸 WebAssembly + Webpack = ❤️ 
 Installed dependencies ✅ 

If you're still running into issues, @Pauan, please re-open!

@Pauan
Copy link
Contributor Author

Pauan commented Jan 11, 2019

I just tested it, and it still doesn't work. I'm not surprised, since the error says spawn npm ENOENT (meaning it can't find the npm runtime), which doesn't have anything to do with npm audit.

@Pauan
Copy link
Contributor Author

Pauan commented Jan 11, 2019

Actually, why does it use the synchronous fs stuff but the async child_process stuff? I'll send a PR.

Pauan added a commit to Pauan/rust-webpack-template that referenced this issue Jan 11, 2019
@Pauan
Copy link
Contributor Author

Pauan commented Jan 11, 2019

I found the issue: you have to specify shell: true on Windows in order for it to find npm on the PATH. I created a PR which fixes it: #98

fitzgen added a commit that referenced this issue Jan 11, 2019
Changing to use spawnSync, also fixing #95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies
Projects
None yet
Development

No branches or pull requests

3 participants