I'm trying to install the CSS-Framework "Semantic UI" on a Windows 10 PC with npm from node.js.
I've followed the official install-instructions carefully.
npm install -g gulp
npm install semantic-ui --save
Uncaught ReferenceError: jQuery is not defined / semantic.min.js:11
While jQuery is required by Semantic UI, it's not a npm requirement.
<script> tag. You can download it from the official website or use a CDN.
The jquery npm package is related, but in no way the same thing. This package is used when you want to build your own jQuery file (i.e. when you want to make some changes or have some specific requirements) - you usually don't want to do this.
In short, if
gulp build worked for you, then you're all set - the only two files you need are semantic.css and semantic.js. Make sure jQuery (found on jquery.com, not the one installed using npm) is also included in your web pages, right before semantic.js. So your "base" HTML file should look something like this (assuming the generated
semantic.js are in the dist folder):
<!doctype html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> <title>Title</title> <link rel="stylesheet" type="text/css" href="dist/semantic.css"> </head> <body> Body goes here <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <script src="dist/semantic.js"></script> </body> </html>