由于在日历引用的时候出现了未发现的错误image.png

    1. Example:
    2. nvm install 8.0.0 Install a specific version number
    3. nvm use 8.0 Use the latest available 8.0.x release
    4. nvm run 6.10.3 app.js Run app.js using node 6.10.3
    5. nvm exec 4.8.3 node app.js Run `node app.js` with the PATH pointing to node 4.8.3
    6. nvm alias default 8.1.0 Set default node version on a shell
    7. nvm alias default node Always default to the latest available node version on a shell
    8. Note:
    9. to remove, delete, or uninstall nvm - just remove the `$NVM_DIR` folder (usually `~/.nvm`)
    10. 1s-MacBook-Air-5:samplate a1$ nvm install --lts v10.15.3
    11. Downloading and installing node v10.15.3...
    12. Downloading https://nodejs.org/dist/v10.15.3/node-v10.15.3-darwin-x64.tar.xz...
    13. ######################################################################## 100.0%
    14. Computing checksum with shasum -a 256
    15. Checksums matched!
    16. Now using node v10.15.3 (npm v6.4.1)
    17. 1s-MacBook-Air-5:samplate a1$ . ~/.bash_profile
    18. Now using node v10.15.3 (npm v6.4.1)
    19. 1s-MacBook-Air-5:samplate a1$ node -v
    20. v10.15.3
    21. 1s-MacBook-Air-5:samplate a1$
    22. 1s-MacBook-Air-5:samplate a1$ npm -v
    23. 6.4.1
    24. 1s-MacBook-Air-5:samplate a1$
    25. 1s-MacBook-Air-5:samplate a1$
    26. 1s-MacBook-Air-5:samplate a1$
    27. 1s-MacBook-Air-5:samplate a1$
    28. 1s-MacBook-Air-5:samplate a1$ rm -rf node_modules
    29. 1s-MacBook-Air-5:samplate a1$ npm i

    版本4.8.3->6.4.1/8.1.0->10.15.3
    未安装 taro-ui ,后来安装了以后缺少了 promise typefill 包,安装后失效。从头开始安装,发现还是不行。后来发现是原来引用了 cnpm , 后来使用了 cnpm i ,后来又出现了新的问题,watch的时候缺失 modules ,添加以后发现最后缺失一个包,无法安装,后来去网站查看了一下,是由于版本低的缘故,需要安装新版本,为了避免新旧版本不兼容的问题,需要卸载旧版本的依赖

    1. 1s-MacBook-Air-5:samplate a1$ rm -rf node_modules
    2. 1s-MacBook-Air-5:samplate a1$ npm i
    3. npm WARN deprecated kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
    4. npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
    5. ░░░░░░⸩ extract:core-js: sill extract array-flatten@2.1.2

    之后再进行 taro build —type weapp —watch 就可以了。

    细节
    ls -la node_modules/ 是查看当前 node_modules/的所有文件,包括隐藏目录
    再次执行 npm i 前面一次是安装,这次显示已经装完
    执行watch ,发现不存在。是因为换了新版本,原来的 taro-cli 不存在的,
    再次安装taro-cli npm install -g @tarojs/cli
    再次watch,成功了。

    1. 1s-MacBook-Air-5:samplate a1$ ls -la node_modules/
    2. total 0
    3. drwxr-xr-x 833 a1 staff 26656 3 28 09:25 .
    4. drwxr-xr-x 14 a1 staff 448 3 28 09:24 ..
    5. drwxr-xr-x 48 a1 staff 1536 3 28 09:22 .bin
    6. drwxr-xr-x 11 a1 staff 352 3 28 09:22 @babel
    7. drwxr-xr-x 19 a1 staff 608 3 28 09:22 @tarojs
    8. ......
    9. drwxr-xr-x 9 a1 staff 288 3 28 09:22 yargs-parser
    10. 1s-MacBook-Air-5:samplate a1$ npm i
    11. audited 13974 packages in 9.479s
    12. found 0 vulnerabilities
    13. 1s-MacBook-Air-5:samplate a1$ taro build --type weapp --watch
    14. -bash: taro: command not found
    15. 1s-MacBook-Air-5:samplate a1$ taro build --type weapp --watch
    16. -bash: taro: command not found
    17. 1s-MacBook-Air-5:samplate a1$ npm i taro-ui -S
    18. + taro-ui@2.0.2
    19. updated 1 package and audited 13974 packages in 12.765s
    20. found 0 vulnerabilities
    21. 1s-MacBook-Air-5:samplate a1$ taro build --type weapp --watch
    22. -bash: taro: command not found
    23. 1s-MacBook-Air-5:samplate a1$ taro build --type weapp --watch
    24. -bash: taro: command not found
    25. 1s-MacBook-Air-5:samplate a1$ cd ~/github/
    26. 1s-MacBook-Air-5:github a1$ cd samplate
    27. 1s-MacBook-Air-5:samplate a1$ taro build --type weapp --watch
    28. -bash: taro: command not found
    29. 1s-MacBook-Air-5:samplate a1$ npm install -g @tarojs/cli
    30. npm WARN deprecated babel-plugin-remove-dead-code@1.3.2: use babel-plugin-minify-dead-code-elimination and babel-plugin-minify-guarded-expressions
    31. /Users/a1/.nvm/versions/node/v10.15.3/bin/taro -> /Users/a1/.nvm/versions/node/v10.15.3/lib/node_modules/@tarojs/cli/bin/taro
    32. > fsevents@1.2.7 install /Users/a1/.nvm/versions/node/v10.15.3/lib/node_modules/@tarojs/cli/node_modules/fsevents
    33. > node install
    34. node-pre-gyp WARN Using needle for node-pre-gyp https download
    35. [fsevents] Success: "/Users/a1/.nvm/versions/node/v10.15.3/lib/node_modules/@tarojs/cli/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" is installed via remote
    36. + @tarojs/cli@1.2.22
    37. added 852 packages from 725 contributors in 41.618s
    38. 1s-MacBook-Air-5:samplate a1$ taro build --type weapp --watch
    39. 👽 Taro v1.2.22
    40. 开始编译项目 samplate
    41. 生成 工具配置 dist/project.config.json
    42. 编译 入口文件 src/app.js