npm install 花式失败的一些解决方式(ionic2)

1、Cannot find module '@ionicapp-scripts

npm config set registry http://registry.cnpmjs.org

参考
http://blog.csdn.net/gebitan5...

npm install @ionic/app-scripts@latest --save-dev

关于Cannot find module '@ionicapp-scripts'

无法找到 moudule 统一解决方式,去npm官网上查询对应的package,然后安装。

如:

npm install 花式失败的一些解决方式(ionic2)

2、鉴于国内的环境,node-sass实在是太难安装了,可以直接通过淘宝的npm镜像来安装。

1.安装cnpm(https://npm.taobao.org/

npm install -g cnpm --registry=https://registry.npm.taobao.org

2.在项目文件夹下安装node-sass

cnpm install --save-dev node-sass

说明:--save-dev自动将node-sass加入到项目文件夹下的package.json中

3、用最新版nodejs,需要gulp时遇到的问题:

node-sass升级到最新版本
需要gulp-sass时,还是有关于版本相关错误
于是将package.json中的所有采用最新版本,写法如下

"gulp": "*",
"gulp-cache": "*",
"gulp-content-includer": "*",
……

然后npm install 或cnpm install、

因为又说缺少路径gulp-sass,新建文件夹即可。

4、出现类似这样的错误

Can't find Python executable "python", you can set the PYTHON env
variable.

Failed at the node-sass@4.5.0 postinstall script.

npm install 花式失败的一些解决方式(ionic2)

npm install 花式失败的一些解决方式(ionic2)

解决方式:修改packge.json,将所有包更新到最新版。

npm install 花式失败的一些解决方式(ionic2)

相关推荐