BUPTlhuanyu / react-music-lhy

基于react16+ react-router4+ typescript react-redux的移动端音乐播放器

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

为什么我install后还是会报错找不到lyric-parser

cyhwinner opened this issue · comments

Failed to compile
C:/Users/74274/Desktop/src/react/react-music-lhy/src/app/components/player/Player.tsx
Type error: Could not find a declaration file for module 'lyric-parser'. 'C:/Users/74274/Desktop/src/react/react-music-lhy/node_modules/lyric-parser/dist/lyric.js' implicitly has an 'any' type.

但是我在node_modules里面是有这个包的

试试将src/common/typings/lyric-parser文件夹放到node_modules/@types

那个问题解决了 ,但是又有新的 不过我把它注释了就没事了
2019-04-14 10:35:33.353-6732 Type error: Property 'attach' does not exist on type 'typeof fastclick'. TS2339
2019-04-14 10:35:33.353-6732
2019-04-14 10:35:33.353-6732 12 |
2019-04-14 10:35:33.353-6732 13 | import fastClick from 'fastclick';
2019-04-14 10:35:33.353-6732 > 14 | fastClick.attach(document.body);

这个和之前的基本一致方法,由于types的问题。将相应的typings文件夹下的fastclick复制到node_modules/@types

万分感谢 已star

不客气,这个项目还有很多功能没实现以及相关功能还需要完善,希望对你有帮助。特别是组件的数据逻辑与视图逻辑杂糅在一起,这方面你可以重点思考一下。以及组件复用的实现:什么时候用组合的方式,什么时候用render props的方式也需要好好思考。后续我可能会花些时间继续完善这些问题。

node_modules/@types是准确的名字吗,我目录下没有

npm install会在你当前目录下创建一个node_modules文件夹,该文件夹下会有一个@types文件夹