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.

Running `npm init rust-webpack my-app` yields an unexpected result

See original GitHub issue

Describe the Bug

Running npm init with rust-webpack yields a directory which is not what I expected.

Steps to Reproduce

  1. Run npm init rust-webpack my-app
  2. List directory ls -la my-app
  3. Notice that this is not the template directory as expected.

Expected Behavior

When I init from rust-webpack I expect the newly created directory to have the contents of the template directory.

Actual Behavior

Running the npm init command with rust-webpack

npm init rust-webpack my-app

gives me the following my-app directory

drwxr-xr-x  13 kraenhansen  staff    416 19 Jun 16:27 .
drwxr-xr-x  77 kraenhansen  staff   2464 19 Jun 16:27 ..
drwxr-xr-x   3 kraenhansen  staff     96 19 Jun 16:27 .bin
drwxr-xr-x  12 kraenhansen  staff    384 19 Jun 16:27 .git
-rw-r--r--   1 kraenhansen  staff     82 19 Jun 16:27 .gitignore
-rw-r--r--   1 kraenhansen  staff    314 19 Jun 16:27 .travis.yml
-rw-r--r--   1 kraenhansen  staff  10847 19 Jun 16:27 LICENSE-APACHE
-rw-r--r--   1 kraenhansen  staff   1071 19 Jun 16:27 LICENSE-MIT
-rw-r--r--   1 kraenhansen  staff   1849 19 Jun 16:27 README.md
drwxr-xr-x  19 kraenhansen  staff    608 19 Jun 16:27 node_modules
-rw-r--r--   1 kraenhansen  staff   4410 19 Jun 16:27 package-lock.json
-rw-r--r--   1 kraenhansen  staff    362 19 Jun 16:27 package.json
drwxr-xr-x  11 kraenhansen  staff    352 19 Jun 16:27 template

Additional Context

As a comparison, calling npm init with react-app yields a directory with only the files needed to build an app (try running npm init react-app my-react-app).

I believe this is happening because https://github.com/rustwasm/rust-webpack-template/pull/144 changes the structure of the repository and a release has not been made quickly thereafter. It would be awesome if this got released very soon as it’s super confusing for a newcomer.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
fitzgencommented, Jun 26, 2019

Published a new version and this should be fixed! Thanks for filing an issue!

1reaction
JunichiSugiuracommented, Jun 21, 2019

Indeed, I’m a newcomer and got super confused.

For newcomers like me, you can work around this by running this code until the new version gets released.

npx github:rustwasm/rust-webpack-template my-app
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected token '.' when trying to run 'npm install'
Based on the github issue link, the fix is to upgrade nvm for windows to 1.1.10, and then remove (all?) node version and...
Read more >
npm-init | npm Docs
initializer in this case is an npm package named create-<initializer> , which will be installed by npm-exec , and then have its main...
Read more >
Create a New Rust/Webpack Project using the ... - Egghead.io
We start by creating a new directory, myApp. Inside it, we run npm init rust -webpack. [00:18] This will copy the template into...
Read more >
Setting up a Node development environment - MDN Web Docs
You now have a Node development environment up and running on your ... Now install Express in the myapp directory and save it...
Read more >
6 reasons your Node.js apps are failing - IBM Developer
Common Node.js deployment problems · Uncaught exception or error event in JavaScript code · Excessive memory usage, which may result in an out-of-memory...
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