Inconsistency between the Taro CLI and the project’s dependency version
Taro is an open cross-terminal and cross-framework solution that supports the use of React/Vue/Nerv and other frameworks to develop applications such as WeChat/JD/Baidu/Alipay/ByteDance/QQ applet/H5.
Keep the Taro CLI version consistent with the version of Taro related dependencies in the project
Please always pay attention to keep the Taro CLI version consistent with the version of Taro related dependencies in the project.
The inconsistency between the CLI and the project’s dependency version is one of the sources of many problems. For example, if the Taro CLI version is 3.0.8, then the version of Taro-related dependencies must also be 3.0.8. Taro-related package names can be known from this list - https://nervjs.github.io/taro/docs/CONTRIBUTING/#taro-%E7%BB%84%E6%88%90, and the specific dependency versions can be obtained by using the taro info command or through package.json Know.
./src/app.ts Module not found: Can't resolve 'undefined' in '/Users/cloudolife/WorkSpaces/col-taro/taro-example/src'
监听文件修改中...
./src/app.ts Module not found: Error: Can't resolve 'undefined' in '/Users/cloudolife/WorkSpaces/col-taro/taro-example/src' resolve 'undefined' in '/Users/cloudolife/WorkSpaces/col-taro/taro-example/src' Parsed request is a module using description file: /Users/cloudolife/WorkSpaces/col-taro/taro-example/package.json (relative path: ./src) resolve as module /Users/cloudolife/WorkSpaces/col-taro/taro-example/src/node_modules doesn't exist or is not a directory /Users/cloudolife/WorkSpaces/col-taro/node_modules doesn't exist or is not a directory /Users/cloudolife/WorkSpaces/node_modules doesn't exist or is not a directory /Users/cloudolife/node_modules doesn't exist or is not a directory /Users/node_modules doesn't exist or is not a directory /node_modules doesn't exist or is not a directory looking for modules in /Users/cloudolife/WorkSpaces/col-taro/taro-example/node_modules
If you find inconsistencies, you can use the Taro upgrade commands taro update self [version number] and taro update project [version number] to upgrade the CLI and project dependencies to the specified version respectively;
Or you can manually install the corresponding version of the CLI and modify package.json Depend on the version number, and then reinstall the dependency to solve it.