klren0312 / daliy_knowledge

知识积累,正确使用方式是watch
21 stars 4 forks source link

处理微信小程序构建npm报错NPM packages not found. Please confirm npm packages which need to build are belong to `miniprogramRoot` directory. #817

Open klren0312 opened 8 months ago

klren0312 commented 8 months ago

报错信息

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`

修改方法

project.config.json中的setting添加packNpmManuallypackNpmRelationList

{
  "setting": {
    "packNpmManually": true,
    "packNpmRelationList": [
      {
        "packageJsonPath": "./package.json",
        "miniprogramNpmDistDir": "./miniprogram/"
      }
    ]
  }
}

修改后重新打开项目