依赖管理
一般我们都是使用 npx
、npm
、cnpm
、yarn
, 关于其比较1在此不赘述。
两次遇到The "path" argument must be of type string. Received type undefine
错误。
分析原因,想说的是两次都是由于不同 依赖关系树
导致的项目无法运行。
当然也有可能是node环境问题所导致。
总结
推荐项目全程采用yarn
进行依赖管理。
使用yarn upgrade XX
时候会遇到这个问题,yarn upgrade 更新依赖包时yarn.lock更新但package.json不同步更新版本信息,如果想在package.json
中反馈出来,就要指定版本
20200318更新
2020 年 3 月 16 日,全球开源社区爆出大新闻:GitHub 宣布收购 npm 。
从推出vscode->ts->github->npm, M$一路力挺js/ts。我可能很快要重回npm了^_^
20200506更新
在package.json中如何查找未使用的npm包?
名为depcheck
的npm模块;
还有一个叫做npm-check