Help me to install react and babel webpacks, please


#1

Hi everybody! I'm very new at programming and I'm stuck trying to install react on my virtual machine. I use Vagrant and scotch-box.
Here's the list of commands
Git bash (windows 7):
1. cd d:
2. git clone https://github.com/scotch-io/scotch-box.git my-project
3. cd \my-project
3. vagrant up
4. vagrant ssh
vagrant:
5. cd /var/www/public
6. npm init
7. npm install react react-dom --no-bin-links (--save didn't work)
8. npm install babel-loader babel-core babel-preset-es2015 babel-preset-react --no-bin-links
9. npm install babel webpack webpack-dev-server --no-bin-links
10. touch index.html App.js main.js webpack.config.js
then I've followed the guidance from the egghead site, linked to react install and changed the files from stage 10.
11. npm start
When I call "npm start" it shows me an error (pinned to message).


Thank you a lot!


#2

It keeps saying that webpack-dev-server wasn't found, so was it installed proprely? --no-bin-links sounds a whole lot like it could make things not be found, can you motivate why you have that? (to yourself, I have no clue)

If you get an error message, read it, look for clues, look for things to google


#3

I've found the whole list of npm install commands here https://docs.npmjs.com/cli/install, I'll destroy my existing machine and try again, let's see what I can do with that.
--no-bin-links helped me to install react, so I've just wanted to install webpacks in the same way.


#4

Helped how? Is that actually what you want or did you just do it to make the install succeed? Maybe it does something unwanted, and if so, what is causing the install to fail without it, maybe that's the real issue?


#5

Thank you, I'm now reading npm docs and trying, I'll write immediately, if I succeed.


#6

I imagine that there's some error message that shows up when you install normally?


#7


#8

You're gonna have to explain what that's meant to tell me. Looks a whole lot like the last one and not much like the installation of anything.


#9

Sorry, I got confused with two printscreens.
And here is my package.json, there are no dependencies, so I guess it could provide me with mistakes and warnings


#10

But what happened when you tried to install in whatever way is the normal way?


#11


That's how it works with --no-bin-links


#12

That's still with that option. But since it looks like something that could cause things not to be found, the question is still, why did you add that option and what happens without it.


#13

Here above are my errors when I try installing in normal way (I've edited the previous mistaken post)

"The --no-bin-links argument will prevent npm from creating symlinks for
any binaries the package might contain." But I don't get it for now, when I try to install this way, it returns me warnings, but no errors (fourth pic above). I don't know why, that advice I've seen on github issues.


#14

And if it's looking for them, and does't find them cause they weren't created, then that's one reason why it might not be finding that.. whatever-it-is -- unless you know exactly what's going on and can say why that's not the case.

Are you refering to this?

What you have there is a linux vm though, right? You're using a linux file system where symlinks are nothing weird.
There's some mention of sharing directories with windows preventing symlinks on VMWare vm's.. does that ring any bell?

Have you tried installing as root? It doesn't say "permission denied", but /usr/local/bin is owned by the root user on my system, and I do get permission denied if I run the same command.


#15

I haven't tried installing as root, and the error "npm ERR! code: 'EACCES'," hints to me that I should try, but I don't know how to do this.

Here's kind of my problem https://github.com/npm/npm/issues/1863


#16

Add sudo before the command that you want to run with elevated privileges, or sudo su to change to root user with your password, or just su to change to root user with root's password

But if that was the issue I really think you'd be seeing "permission denied" messages, I'd sooner put my money on that this has to do with windows


#17

Yeah, you've found where I saw about --no-bin-links flag


#18

#19

Is there a particular reason for using vagrant? You could use a "normal" vm. For picking a distro I suggest Antergos if you want the latest versions of everything, or Mint if.. no clue why you wouldn't just pick Antergos actually, better chance of installing in a vm perhaps.


#20

Thank you! I think it is a good idea)