gpt4 book ai didi

运行 npm run dev 时 Laravel 7 中的 npm 错误

转载 作者:行者123 更新时间:2023-12-01 21:43:10 25 4
gpt4 key购买 nike

我使用的是 Windows 10。我刚刚安装了 Laravel 7,并使用以下命令创建了一个新项目:

composer create-project --prefer-dist laravel/laravel briscola

然后我在 app.scss 文件中添加了以下代码来呈现红色背景:

body {
background-color: red;
}

然后我运行以下代码来使用当前的 app.scss 文件:

npm run dev

但是不幸的是,之前的命令不起作用,我看到了以下错误:

> @ dev C:\xampp\htdocs\briscola
> npm run development

npm WARN invalid config loglevel="notice"

> @ development C:\xampp\htdocs\briscola
> 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" non è riconosciuto come comando interno o esterno,
un programma eseguibile o un file batch.
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 WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Della Mea Michele\AppData\Roaming\npm-cache\_logs\2020-04-05T15_14_25_432Z-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.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Della Mea Michele\AppData\Roaming\npm-cache\_logs\2020-04-05T15_14_26_197Z-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

关于运行 npm run dev 时 Laravel 7 中的 npm 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61044879/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com