sst.dev icon indicating copy to clipboard operation
sst.dev copied to clipboard

Comments: Set up Bootstrap

Open jayair opened this issue 9 years ago • 25 comments

Link to chapter - http://serverless-stack.com/chapters/setup-bootstrap.html

jayair avatar Apr 10 '17 01:04 jayair

When I try to install bootstrap it's giving me an 'unmet peer dependency' error. image

Did I miss an install somewhere?

lrobledo avatar Apr 13 '17 23:04 lrobledo

Hmm.. It seems like React wasn't setup properly. You can try clearing out your NPM cache and retry installing it.

$ rm -rf node_modules/
$ npm cache clean

And then try installing it again

$ npm install

jayair avatar Apr 14 '17 17:04 jayair

Hi,

Thanks for sharing the example

On running the command npm install react-bootstrap --save

I get the following [..................] - rollbackFailedOptional: verb npm-session e5796588f62c74b [..................] - rollbackFailedOptional: verb npm-session e5796588f62c74b

Can you point me to why this is occurring please.

Cheers

RaeMarvin avatar Jul 02 '17 19:07 RaeMarvin

@RaeMarvin That's pretty odd. Can you run these two commands and tell me what it returns npm -v and node -v?

jayair avatar Jul 02 '17 21:07 jayair

@jayair I get the following

$ npm -v
5.0.3
$ node -v
v8.1.2

RaeMarvin avatar Jul 02 '17 21:07 RaeMarvin

@RaeMarvin Thanks, that looks good to me. I'm personally on Node v7.10.0.

But from looking around some other people are facing this as well - https://github.com/npm/npm/issues/17246

jayair avatar Jul 02 '17 22:07 jayair

@jayair Thanks for confirming that my setup looks good and linking into the issues raised.

It's such a shame as I really want to code through your post and see it working

RaeMarvin avatar Jul 02 '17 22:07 RaeMarvin

@RaeMarvin I think something is wrong with NPM. Have you tried installing any other package?

jayair avatar Jul 02 '17 23:07 jayair

@jayair This is my first time using npm (total newbie) so if it's not in your paper then the answer is no.

RaeMarvin avatar Jul 02 '17 23:07 RaeMarvin

@jayair

Just checked and I installed Babel and Webpack

$ npm install --save-dev \
    babel-core \
    babel-loader \
    babel-plugin-transform-runtime \
    babel-preset-es2015 \
    babel-preset-stage-3 \
    serverless-webpack \
    glob \
    webpack \
    webpack-node-externals
$ npm install --save babel-runtime

RaeMarvin avatar Jul 03 '17 00:07 RaeMarvin

@RaeMarvin Those worked fine for you?

jayair avatar Jul 03 '17 00:07 jayair

@jayair Yes that's the strange thing

RaeMarvin avatar Jul 04 '17 05:07 RaeMarvin

@RaeMarvin Not sure if you've tried clearing the npm cache npm cache clean. It might help.

jayair avatar Jul 04 '17 17:07 jayair

@jayair I've tried that but the issue still exists.

RaeMarvin avatar Jul 06 '17 00:07 RaeMarvin

@RaeMarvin That's pretty annoying. I'll try and look for what other folks are doing.

jayair avatar Jul 06 '17 16:07 jayair

Replace $ npm install react-bootstrap --save with $ yarn add react-bootstrp - worked for me... Looks like create-react-app now uses yarn vs npm!

Note: you do not need to append the --save portion when using Yarn, as it saves automatically.

jomazu avatar Jul 06 '17 19:07 jomazu

For those interested... the following link to Andrew Mead's video about Yarn vs NPM does an excellent job explaining the difference(s)!

jomazu avatar Jul 06 '17 20:07 jomazu

@jomazu That's a good idea! It should fix @RaeMarvin's issue. Yarn is pretty much drop in replacement for NPM.

jayair avatar Jul 06 '17 21:07 jayair

@jayair

All sorted 👍

After speaking with NPM support this is not an error message but just one of the messages that are displayed when running the install command.

The issue is that it was stalling at that point.

What I did next was to let the command keep running (or stalling for a few more minutes) and as expected the true error message was displayed.

npm ERR! network read ECONNRESET
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settin
gs.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

I found a link that resolved this issue. https://stackoverflow.com/questions/18419144/npm-not-working-read-econnreset

Basically I needed to run the below commands to set p the proxy.

npm config set registry http://registry.npmjs.org/

And then re-run the install.

I'll keep using npm to complete your example but (@jomazu thanks for YARN mention) I will investigate using YARN also.

Cheers All

RaeMarvin avatar Jul 11 '17 03:07 RaeMarvin

@RaeMarvin Ah I see. Thanks a lot for reporting back.

jayair avatar Jul 11 '17 17:07 jayair