用yarn install 安装模块报错解决方法

1,如果遇到错误的时候执行,否则请跳过 

$ rm -rf node_modules

2,配置淘宝镜像

$ yarn config set registry https://registry.npm.taobao.org

3,安装

$ yarn install --no-bin-links

4,修改script

"scripts": {
    "dev": "npm run development",
    "development": "NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch-poll": "npm run watch -- --watch-poll",
    "hot": "NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "prod": "npm run production",
    "production": "NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},

5,安装cross-env

yarn add cross-env --no-bin-links

6,最后、

npm run dev 

npm run watch-poll

你可能感兴趣的:(大前端)