报错信息如下:

message: NPM packages not found. Please confirm npm packages which need to build are belong to `miniprogramRoot` directory. Or you may edit project.config.json's `packNpmManually` and `packNpmRelationList`
appid: wx7144a5d5411c56ff
openid: o6zAJs9aPvd1IQQQAsgEEtFudn6s
ideVersion: 1.06.2310080
osType: win32-x64
time: 2024-05-07 13:30:13

安装TDesign组件库之后,点击工具下的构建npm报如上错误。

解决方案:

在project.config.json这个文件中修改setting中参数如下:

"packNpmRelationList": [

      {

        "packageJsonPath": "./package.json",

        "miniprogramNpmDistDir": "./"

      }

    ],

    "packNpmManually": true,

修改之后重启微信小程序开发工具即可。

05-07 18:05