无法将"cross-env"识别为内部或外部命令, [英] 'cross-env' is not recognized as an internal or external command,

查看:2868
本文介绍了无法将"cross-env"识别为内部或外部命令,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您能帮我这个忙吗?我在为Laravel Mix运行npm run dev时遇到问题.我按了下面的链接,但仍然存在错误.我的操作系统有问题吗?我试图删除 node_modules ,运行 npm install --global cross-env .并再次运行NPM安装.

Guys can you please help me on this I have trouble run npm run dev for my Laravel Mix. I followed links below but still error exist. Do i have a problem on my OS? I tried to remove node_modules, run npm install --global cross-env. and run NPM install again.

https://github.com/JeffreyWay/laravel-mix/issues/478

Laravel 5.4'cross-env'不被识别为内部或外部命令

这是我的版本:

  • Laravel混合版本:^ 2.0
  • 节点版本(节点-v):8.9.0
  • NPM版本(npm -v):5.6.0
  • 操作系统:Windows7
  • XAMPP

> @ development C:\xampp\htdocs\codetinerant
> 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\Garciano\AppData\Roaming\npm-cache\_logs\2018-02-17T10_08_34_901Z-debug.log

推荐答案

首先,运行:

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force

然后运行命令

npm install cross-env

npm install 

,然后您也可以运行

npm run dev

这篇关于无法将"cross-env"识别为内部或外部命令,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆