npm install报gyp info it worked if it ends with ok

630 阅读1分钟

今天启动别人的项目,在 npm i 安装依赖项时出现报错信息:

 gyp info it worked if it ends with ok

应该是安装node-sass报错了:

一、先卸载再安装试试:

# 卸载node-sass 
 npm uninstall node-sass
 
# 安装node-sass 
 npm install node-sass

二:依然报错----用另外一种方式解决问题:

1.删除package.json中的node-sass 2.安装淘宝镜像

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

3.检查是否安装成功

cnpm -v

4.通过cnpm安装依赖,在终端中输入

cnpm install

5.安装node-sass

cnpm i node-sass

6.启动项目

npm run dev 或 cnpm run dev