【发布时间】:2020-06-25 17:31:21
【问题描述】:
我正在学习 react 并第一次尝试使用 reactstrap。我已经使用以下命令安装了带有 npm 的 react 并得到了以下结果:
npm install reactstrap
+ reactstrap@8.4.1
updated 1 package and audited 919281 packages in 10.948s
53 packages are looking for funding
run `npm fund` for details
found 19 vulnerabilities (18 moderate, 1 high)
但是当我尝试运行应用程序时出现以下错误:
【问题讨论】:
-
你需要在 reactstrap 周围加上引号:
from 'reactstrap'而不是from reactstrap。 -
因为记得阅读实际错误:“Parsing error: Unexpected token”是告诉你有一个意外的令牌,例如你写了一些没有意义的东西。并不是说你写了一些确实有意义的东西,问题是 reactstrap 不知何故不可用。
标签: reactjs npm bootstrap-4 npm-install reactstrap