执行以下命令:
- 1
$ rm -rf node_modules - 2
$ yarn config set registry http://registry.cnpmjs.org - 3
$ yarn install --no-bin-links - 4 接下来打开 pakage.json 修改, 去掉 package.json 中的四处 cross-env
"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 --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
- 5.执行
$ npm run watch-poll或者npm run dev - 6.完成
via: https://laravel-china.org/topics/3570/yarn-install-error-learning-laravel-entry-manual-encounter-problems-to-help