尝试运行“ npm run watch”(运行laravel混合监视程序的命令)时遇到错误。
简而言之 1.它适用于我的Macbook,相同的OS版本,相同的NPM版本,相同的项目。 2.我尝试重新安装nodeJS并删除了我的node_modules。 3.我基于第一个尝试了各种关于堆栈溢出的解决方案 错误日志上的一行(错误:Chunk.entrypoints(...))。
这是错误日志:
Johrs-iMac:tdc-roots johrclaessens$ npm run watch
> pagekit@1.0.0 watch /Users/johrclaessens/stack/TDC/Web/projects/tdc-roots
> NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
10% building modules 1/1 modules 0 active
webpack is watching the files…
77% module and chunk tree optimization unnamed compat plugin/Users/johrclaessens/stack/TDC/Web/projects/tdc-roots/node_modules/webpack/lib/Chunk.js:460
throw new Error(
^
Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
at Chunk.get (/Users/johrclaessens/stack/TDC/Web/projects/tdc-roots/node_modules/webpack/lib/Chunk.js:460:9)
at /Users/johrclaessens/stack/TDC/Web/projects/tdc-roots/node_modules/laravel-mix/node_modules/extract-text-webpack-plugin/dist/index.js:176:48
at Array.forEach (<anonymous>)
at /Users/johrclaessens/stack/TDC/Web/projects/tdc-roots/node_modules/laravel-mix/node_modules/extract-text-webpack-plugin/dist/index.js:171:18
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/johrclaessens/stack/TDC/Web/projects/tdc-roots/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:12:1)
at AsyncSeriesHook.lazyCompileHook (/Users/johrclaessens/stack/TDC/Web/projects/tdc-roots/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.seal (/Users/johrclaessens/stack/TDC/Web/projects/tdc-roots/node_modules/webpack/lib/Compilation.js:881:27)
at hooks.make.callAsync.err (/Users/johrclaessens/stack/TDC/Web/projects/tdc-roots/node_modules/webpack/lib/Compiler.js:464:17)
at _err0 (eval at create (/Users/johrclaessens/stack/TDC/Web/projects/tdc-roots/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:11:1)
at _addModuleChain (/Users/johrclaessens/stack/TDC/Web/projects/tdc-roots/node_modules/webpack/lib/Compilation.js:749:12)
at processModuleDependencies.err (/Users/johrclaessens/stack/TDC/Web/projects/tdc-roots/node_modules/webpack/lib/Compilation.js:688:9)
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickCallback (internal/process/next_tick.js:181:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pagekit@1.0.0 watch: `NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pagekit@1.0.0 watch 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! /Users/johrclaessens/.npm/_logs/2018-10-24T20_33_19_843Z-debug.log
还有npm的错误日志:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'watch' ]
2 info using npm@6.4.1
3 info using node@v8.12.0
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle pagekit@1.0.0~prewatch: pagekit@1.0.0
6 info lifecycle pagekit@1.0.0~watch: pagekit@1.0.0
7 verbose lifecycle pagekit@1.0.0~watch: unsafe-perm in lifecycle true
8 verbose lifecycle pagekit@1.0.0~watch: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/johrclaessens/stack/TDC/Web/projects/tdc-roots/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/johrclaessens/.nexustools:/Applications/DevDesktop/tools
9 verbose lifecycle pagekit@1.0.0~watch: CWD: /Users/johrclaessens/stack/TDC/Web/projects/tdc-roots
10 silly lifecycle pagekit@1.0.0~watch: Args: [ '-c',
10 silly lifecycle 'NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
11 silly lifecycle pagekit@1.0.0~watch: Returned: code: 1 signal: null
12 info lifecycle pagekit@1.0.0~watch: Failed to exec watch script
13 verbose stack Error: pagekit@1.0.0 watch: `NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:915:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid pagekit@1.0.0
15 verbose cwd /Users/johrclaessens/stack/TDC/Web/projects/tdc-roots
16 verbose Darwin 18.0.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "watch"
18 verbose node v8.12.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error pagekit@1.0.0 watch: `NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
22 error Exit status 1
23 error Failed at the pagekit@1.0.0 watch script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
有人可以帮助我解决问题吗? 预先感谢!
答案 0 :(得分:0)
该问题已通过从源代码中删除项目目录和git克隆来解决。快速的npm安装和laravel混合运行没有任何问题。