为什么'npm run watch'在laravel中给出错误?

编程入门 行业动态 更新时间:2024-10-11 07:31:33

为什么'npm run watch'在laravel中给出<a href=https://www.elefans.com/category/jswz/34/1771449.html style=错误?"/>

为什么'npm run watch'在laravel中给出错误?

我正在关注本教程/。在本教程中,当在命令提示符下执行“ npm run watch”时,将在public / backend / js中创建一个app.js文件。但是当我执行“ npm run watch”时,没有创建这样的文件。执行'npm run watch'命令后,我在命令提示符下找到了这个]

> @ watch E:\Laravel\ecommerce-application
> npm run development -- --watch


> @ development E:\Laravel\ecommerce-application
> node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"

internal/modules/cjs/loader.js:960
  throw err;
  ^

Error: Cannot find module 'E:\Laravel\ecommerce-application\node_modules\cross-env\dist\bin\cross-env.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
    at Function.Module._load (internal/modules/cjs/loader.js:840:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"`
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\J.U.Jisan\AppData\Roaming\npm-cache\_logs\2020-05-09T18_22_08_016Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `npm run development -- --watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch 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\J.U.Jisan\AppData\Roaming\npm-cache\_logs\2020-05-09T18_22_08_158Z-debug.log

我正在按照本教程。在本教程中,在命令提示符下执行“ npm run watch”时,app.js ...

回答如下:

请运行:npm install然后npm run watch

更多推荐

为什么'npm run watch'在laravel中给出错误?

本文发布于:2024-05-07 09:31:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1755620.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   npm   run   laravel   watch

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!