The problem that the WeChat applet cannot build the npm package

Project scenario:

In a small program, if you want to use an external ui component library, you need to build an npm package. This is necessary and cannot be omitted.

If it is not built, an error similar to this will appear:
insert image description here

Cause Analysis:

The npm package build is not done correctly.

solution:

The old version can be found in the local settings. If the new version cannot be found, it can be found in the tool:
insert image description here
After clicking:
insert image description here
the address can be followed by the tutorial given on the official website, such as button:

  "usingComponents": {
    
    
    "van-button": "@vant/weapp/button/index"
  },

It can be rendered normally:
insert image description here

Guess you like

Origin blog.csdn.net/zxdznyy/article/details/130561990