Could not install from calendar.js as it does not contain a package.json file

前言

记录一下微信开发者工具的一个问题


npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules\miniprogram-datepicker\calendar@github:pithyone\calendar.js" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\51541\AppData\Roaming\npm-cache\_logs\2022-01-21T07_42_25_990Z-debug.log

刚导入项目,npm i 失败了,解决方案如下:
1.打开window资源管理器,在项目根目录下创建目录node_modules
2.执行npm i miniprogram-datepicker --save
3.在根目录重新执行npm i即可

原创,禁止转载!