运行命令:cnpm install node-sass@latest
版本错误:
Node Sass version 5.0.0 is incompatible with^4.0.0
解决:
卸载已安装版本 npm uninstall node-sass
安装 cnpm install node-sass@4.14.1
执行cnpm安装命令报错:Cannot find module ‘node:util’
出现这种情况是因为 npm 版本与 cnpm 的版本不匹配导致的
首先我们卸载刚刚安装的cnpm
npm uninstall cnpm
查看当前 npm 的版本
npm -v
根据 npm 的版本指定版本安装 cnpm
npm install -g cnpm@6.0.0 --registry=https://registry.npm.taobao.org
安装成功后我们执行 cnpm -v 查看,出现以上情况代表安装成功