【问题标题】:Failed to install npm dev / npm watch for Laravel 5.6无法为 Laravel 5.6 安装 npm dev / npm watch
【发布时间】:2020-01-21 22:44:06
【问题描述】:

我正在使用 Laravel 5.6 做一个项目,我已经成功安装了 npm,但是当我运行 npm run devnpm run watch 时,我得到了这个错误:

$ npm run dev

> @ dev C:\wamp64\www\QuAn
> npm run development


> @ development C:\wamp64\www\QuAn
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

11% building 9/14 modules 5 active ...elector.js?type=template&index=0!C:\wamp64\www\QuAn\resources\assets\js\components\ExampleComponent.vue{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.
78% module and chunk tree optimization unnamed compat pluginC:\wamp64\www\QuAn\node_modules\webpack\lib\Chunk.js:861
                throw new Error(
                ^

Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
    at Chunk.get (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Chunk.js:861:9)
    at C:\wamp64\www\QuAn\node_modules\←[4mextract-text-webpack-plugin←[24m\dist\index.js:176:48
    at Array.forEach (<anonymous>)
    at C:\wamp64\www\QuAn\node_modules\←[4mextract-text-webpack-plugin←[24m\dist\index.js:171:18
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\node_modules\←[4mtapable←[24m\lib\HookCodeFactory.js:33:10), <anonymous>:12:1)
    at AsyncSeriesHook.lazyCompileHook (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\node_modules\←[4mtapable←[24m\lib\Hook.js:154:20)
    at Compilation.seal (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Compilation.js:1342:27)
    at C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Compiler.js:675:18
    at C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Compilation.js:1261:4
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\node_modules\←[4mtapable←[24m\lib\HookCodeFactory.js:33:10), <anonymous>:31:1)
    at AsyncSeriesHook.lazyCompileHook (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\node_modules\←[4mtapable←[24m\lib\Hook.js:154:20)
    at Compilation.finish (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Compilation.js:1253:28)
    at C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Compiler.js:672:17
    at eval (eval at create (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\node_modules\←[4mtapable←[24m\lib\HookCodeFactory.js:33:10), <anonymous>:11:1)
    at C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Compilation.js:1185:12
    at C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Compilation.js:1097:9
←[90m    at processTicksAndRejections (internal/process/task_queues.js:75:11)←[39m
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\INFO\AppData\Roaming\npm-cache\_logs\2019-09-20T21_53_25_570Z-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 ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\INFO\AppData\Roaming\npm-cache\_logs\2019-09-20T21_53_25_604Z-debug.log

我尝试清理缓存、删除 node_modules、文件并重新安装 npm,但似乎没有任何解决问题的方法。

版本:Laravel 5.6Node 12.10npm 6.11.3

【问题讨论】:

    标签: node.js laravel npm laravel-5.6


    【解决方案1】:

    我认为这个解决方案会帮助你github阅读 JeffreyWay 评论

    尝试完全重置:

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

    【讨论】:

    • 我已经尝试过这个解决方案,但我一直收到这个错误:rm: cannot remove 'package-lock.json': No such file or directory rm: cannot remove 'yarn.lock': No such文件或目录
    猜你喜欢
    • 2018-10-29
    • 2021-04-20
    • 1970-01-01
    • 2021-07-22
    • 2021-07-27
    • 2021-05-07
    • 2021-04-11
    • 2023-03-10
    • 1970-01-01
    相关资源
    最近更新 更多