WebPack Watch脚本在夫妇success compiles.laravel homestead后丢下错误



捆绑包成功地编译了几次,但我得到了这个错误:

错误:

95% emittingError: UNKNOWN: unknown error, open 'D:Web DevelopmentProjectsGUIRebuildpublicjssuper_admin_bundle.js
'
    at Error (native)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `cross-env 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 @ 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!     C:UsersSmolenAppDataRoamingnpm-cache_logs2017-12-01T05_07_28_612Z-debug.log

日志:

0 info it worked if it ends with ok
1 verbose cli [ 'D:\Program Files\nodejs\node.exe',
1 verbose cli   'C:\Users\Smolen\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'watch' ]
2 info using npm@5.5.1
3 info using node@v6.11.3
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle @~prewatch: @
6 info lifecycle @~watch: @
7 verbose lifecycle @~watch: unsafe-perm in lifecycle true
8 verbose lifecycle @~watch: PATH: C:UsersSmolenAppDataRoamingnpmnode_modulesnpmbinnode-gyp-bin;D:Web DevelopmentProjectsGUIRebuildnode_modules.bin;%SystemRoot%system32WindowsPowerShellv1.0;C:ProgramDataOracleJavajavapath;C:Python27;C:Python27Scripts;C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Client;C:Program Files (x86)PC Connectivity Solution;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;D:Program Files (x86)SkypePhone;C:Program Files (x86)ATI TechnologiesATI.ACECore-Static;D:HashiCorpVagrantbin;D:Program FilesGitcmd;D:Program Filesnodejs;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsIPT;C:ProgramDatachocolateybin;C:Program FilesLenovoBluetooth Software;C:Program FilesLenovoBluetooth Softwaresyswow64;D:Program Files (x86)PuTTY;C:UsersSmolenAppDataLocalatombin;C:UsersSmolenAppDataRoamingnpm;D:UsersSmolenAppDataLocalAndroidsdkplatform-tools;
9 verbose lifecycle @~watch: CWD: D:Web DevelopmentProjectsGUIRebuild
10 silly lifecycle @~watch: Args: [ '/d /s /c',
10 silly lifecycle   'cross-env 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 @~watch: Returned: code: 1  signal: null
12 info lifecycle @~watch: Failed to exec watch script
13 verbose stack Error: @ watch: `cross-env 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> (C:UsersSmolenAppDataRoamingnpmnode_modulesnpmnode_modulesnpm-lifecycleindex.js:280:16)
13 verbose stack     at emitTwo (events.js:106:13)
13 verbose stack     at EventEmitter.emit (events.js:191:7)
13 verbose stack     at ChildProcess.<anonymous> (C:UsersSmolenAppDataRoamingnpmnode_modulesnpmnode_modulesnpm-lifecyclelibspawn.js:55:14)
13 verbose stack     at emitTwo (events.js:106:13)
13 verbose stack     at ChildProcess.emit (events.js:191:7)
13 verbose stack     at maybeClose (internal/child_process.js:920:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
14 verbose pkgid @
15 verbose cwd D:Web DevelopmentProjectsGUIRebuild
16 verbose Windows_NT 6.1.7601
17 verbose argv "D:\Program Files\nodejs\node.exe" "C:\Users\Smolen\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "watch"
18 verbose node v6.11.3
19 verbose npm  v5.5.1
20 error code ELIFECYCLE
21 error errno 1
22 error @ watch: `cross-env 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 @ watch script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

我不知道为什么会发生这种情况,我正在使用Vagrant和Virtual Box,但是在我的机器上不在虚拟的机器上编译。我在随机文件上获取此"未知错误"。

我尝试的是:

  1. 删除/重新安装node_modules
  2. 升级节点和NPM
  3. 清除NPM缓存

OS: Windows 7
Laravel: 5.4V
npm: 5.5.1v

您可以尝试删除node_modules文件夹并再次运行 npm install

在我的情况下,输出目录已损坏并且无法打开,因此WebPack无法访问它。

通过在另一个位置检查项目是最快的解决方案,因为删除目录并不容易,并且需要使用Windows维修工具来维修驱动器(右键单击驱动器 -> properties-> properties-> properties->>>工具 ->磁盘检查)。

最新更新