How to find cause of Warning: PropTypes has been moved to a separate package

后端 未结 2 389
刺人心
刺人心 2021-01-13 23:50

If I get the warning \"Warning: PropTypes has been moved to a separate package.\" How can I locate which npm package is still using it? The warning doesnt offer any details

2条回答
  •  轮回少年
    2021-01-14 00:50

    This is just an idea so might not be that useful or there would be a better solution but you can use npm ls command to get the dependency tree. Then you can locate the packages that depends on react but not prop-types. This is sort of a manual solution and might be a better one.

    More info about npm ls here

    Synopsis

    npm ls [[<@scope>/] ...]
    
    aliases: list, la, ll
    

    Description

    This command will print to stdout all the versions of packages that are installed, as well as their dependencies, in a tree-structure.

提交回复
热议问题