soney / si-579

SI 579 Course

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Office hour questions about including libraries

LittleAprilFool opened this issue · comments

commented

1. Snapsvg

Issue

  • install snapsvg by npm install snapsvg
  • include snapsvg by import Snap from "snapsvg" (the instructions on npm site are out-dated)
  • get error Uncaught TypeError: Cannot read property 'on' of undefined

Related Discussions

Solution

commented

2. Fontawesome

Issue

  • install fontawesome by npm install @fortawesome/fontawesome-free , following instructions here
  • the instructions are not clear

Solution

If students are using Fontawesome, they can just use CDN to reference it, no need to bundle it with webpack

commented

3. NPM couldn't install any packages

Issue

A common issue that students located in China would encounter: https://registry.npmjs.org/ is blocked by the GFW — even if they turn on the VPN, npm install wouldn’t install through the VPN and they will get npm install Error: rollbackFailedOptional.

Solution

Use a mirror site of npmjs hosted in China. For example, run npm config set registry http://registry.npm.taobao.org