npm run build:h5 提示如下错误
Module build failed: Error: Node Sass version 6.0.0 is incompatible with ^4.0.0.
转载https://www.cnblogs.com/aoshuang/p/14748574.html
原因:node-sass版本过高,卸载重装低版本
1、卸载: npm uninstall node-sass
2、安装: npm install node-sass@4.14.1
3、运行:npm run build:h5
TypeError: Cannot read property 'uglify' of undefined 这个错误一般是 Taro 版本依赖的问题:
原文链接:https://fengzq.cn/blog/5e391e2006319d550838df83
--latest可更换成对应的版本号 如
npm i -g @tarojs/cli@1.2.2此版本号需要跟package.json中的版本一致
# taro
$ taro update self
# npm
npm i -g @tarojs/cli@latest
# yarn
yarn global add @tarojs/cli@latest
解决Error: Cannot find module 'node-sass'问题
原文链接:https://blog.csdn.net/sliver1836/article/details/95950284
解决办法:
1.在项目目录cmd下运行 npm install -g cnpm --registry=https://registry.npm.taobao.org
2.下载成功后再运行 cnpm install node-sass
两个都下载成功后就可以正常的运行项目了。