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

一、Cannot find module '@ionicapp-scripts

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

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

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

关于Cannot find module '@ionicapp-scripts'python

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

如:json

clipboard.png

二、鉴于国内的环境,node-sass实在是太难安装了,能够直接经过淘宝的npm镜像来安装。

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

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

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

cnpm install --save-dev node-sass

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

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

node-sass升级到最新版本
须要gulp-sass时,仍是有关于版本相关错误
因而将package.json中的全部采用最新版本,写法以下ionic

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

而后npm install 或cnpm install、post

由于又说缺乏路径gulp-sass,新建文件夹便可。spa

四、出现相似这样的错误

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

Failed at the node-sass@4.5.0 postinstall script.

clipboard.png

clipboard.png

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

clipboard.png

相关文章
相关标签/搜索