l06 执行到 yarn dev 的时候报错,请问什么原因呀?

root@22ad2704fc07:/var/www/yanwug# yarn dev yarn run v1.22.4 $ npm run development npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1587104905959-0.3781740644354059/node but npm is using /home/laradock/.nvm/versions/node/v13.13.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with. > @ development /var/www/yanwug > cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js 98% after emitting SizeLimitsPlugin ERROR Failed to compile with 1 errors 2:28:36 PM error in ./resources/js/app.js
ERROR in ./resources/js/app.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module '@babel/compat-data/corejs3-shipped-proposals' Require stack:
npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the @ development script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
join_jiang
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
leo
最佳答案

我在一个全新的环境下安装没有遇到你的这个问题,你的 nodejs 版本是多少?我这边用的是 v10.20.1

5年前 评论
666666 (楼主) 5年前
leo (作者) 5年前
666666 (楼主) 5年前
讨论数量: 2
leo

大概率是前一步用 yarn 命令安装依赖包没有正常结束导致的,你需要把 node_modules 目录删掉重新 yarn 安装

5年前 评论
666666 (楼主) 5年前
666666 (楼主) 5年前
leo

我在一个全新的环境下安装没有遇到你的这个问题,你的 nodejs 版本是多少?我这边用的是 v10.20.1

5年前 评论
666666 (楼主) 5年前
leo (作者) 5年前
666666 (楼主) 5年前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!