homestead虚拟机,经过npm下载依赖包和解决运行gulp报错问题 yarn出错问题

homestead虚拟机,经过npm下载依赖包和解决运行gulp报错问题 yarn出错问题 css

1. 在虚拟器运行 npm 下载依赖组件时报错: node

npm ERR! EPROTO: protocol error, symlink ... linux

解决方案: npm

运行 npm 时增长参数 --no-bin-links  gulp

npm install --no-bin-links windows

 

2. 执行 gulp 命令时报错: sass

ENOENT: no such file or directory, scandir '/home/vagrant/Code/sample/node_modules/node-sass/vendor' app

解决方案: ui

使用 npm 从新生成 node-saaa spa

npm rebuild node-sass --no-bin-links

 

windows host中的vagrant box Linux中使用npm install时,因为host os不支持linuxsymbol link,因此必须使用 --no-bin-links 命令

 

加速 npm 下载速度

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

 

yarn install 报错

error An unexpected error occurred: "EPROTO: protocol error, symlink '../../

  1. 删除应用里面的 node_modules 文件夹。

    rm –rf node_modules

yarn install --save --no-bin-links

 

  1. 配置淘宝 npm 镜像。

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

cnpm 从新安装。

$ cnpm install

等待安装完成。

$ downloading

进入应用根目录 (个人是 sample ) ,启动 gulp

$ gulp

若是出现如下界面,那就是成功了

 

[15:43:28] Using gulpfile ~/Code/sample/gulpfile.js

[15:43:28] Starting 'default'...

[15:43:28] Starting 'sass'...

 

Fetching Sass Source Files...

- resources/assets/sass/app.scss

 

Saving To...

相关文章
相关标签/搜索