问题描述
我正在观看此视频 https://www.youtube.com/watch?v=zEPYSNO7o3Q
我在 npm run dev
这是我尝试的解决方案:
Step1:作曲者更新步骤2:rm -rf node_modules第三步:NPM缓存清理步骤4:npm安装步骤5:npm已过时步骤6:npm安装步骤7:NPM运行开发
但是我仍然收到此错误:
>@开发C:\ laragon \ www \ lara6>跨环境NODE_ENV =开发node_modules/webpack/bin/webpack.js --progress --hide-modules-config = node_modules/laravel-mix/setup/webpack.config.js无法将"cross-env"识别为内部或外部命令,可操作的程序或批处理文件.npm ERR!代码ELIFECYCLEnpm ERR!errno 1npm ERR!@ development:`cross-env NODE_ENV = development node_modules/webpack/bin/webpack.js-进度-隐藏模块--config = node_modules/laravel-mix/setup/webpack.config.js`npm ERR!退出状态1npm ERR!npm ERR!@开发脚本失败.npm ERR!npm可能不是问题.上面可能还有其他日志记录输出.npm ERR!可以在以下位置找到此运行的完整日志:npm ERR!C:\ Users \ mmagante \ AppData \ Roaming \ npm-cache \ _logs \ 2020-01-22T03_04_02_064Z-debug.lognpm ERR!代码ELIFECYCLEnpm ERR!errno 1npm ERR!@ dev:`npm运行开发`npm ERR!退出状态1npm ERR!npm ERR!@ dev脚本失败.npm ERR!npm可能不是问题.上面可能还有其他日志记录输出.
我当前正在使用:
php artisan --version -Laravel Framework 6.12.0
节点-v -v12.14.1
npm -v -6.13.6
php -v -PHP 7.2.19
我也找到了此链接,但仍然无法正常工作: https://github.com/JeffreyWay/laravel-mix/issues/1072
从项目中删除 node_modules
文件夹.
运行 npm install --global cross-env
此命令.
从 package.json
文件的 devDependencies
部分删除"cross-env":"^ 5.0.1",
.>
运行 npm install --no-bin-links
现在运行 npm run dev
I am following this video https://www.youtube.com/watch?v=zEPYSNO7o3Q
And I got error in npm run dev
This is the solution I try:
Step1: composer update
Step2: rm -rf node_modules
Step3: npm cache clean
Step4: npm install
Step5: npm outdated
Step6: npm install
Step7: npm run dev
But I still get this error:
> @ development C:\laragon\www\lara6
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --
config=node_modules/laravel-mix/setup/webpack.config.js
'cross-env' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
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 1
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.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\mmagante\AppData\Roaming\npm-cache\_logs\2020-01-22T03_04_02_064Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I am currently using:
php artisan --version - Laravel Framework 6.12.0
node -v - v12.14.1
npm -v - 6.13.6
php -v - PHP 7.2.19
I also find this link and still not working:https://github.com/JeffreyWay/laravel-mix/issues/1072
Delete node_modules
folder from your project.
Run npm install --global cross-env
this command.
Delete "cross-env": "^5.0.1",
From package.json
file devDependencies
section.
Run npm install --no-bin-links
Now run npm run dev
这篇关于npm run watch在Laravel 6.0中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!