Erron进行了91%的额外资产处理

时间:2019-07-15 09:14:46

标签: node.js npm webpack

我认为 webpack.config.js 存在此问题。

我尝试了不同的laravel-mix版本。在4个以上的laravel-mix上,我获得了“挂起”的92%块资产优化terserplugin。

const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
    optimization: {
        minimizer: [new TerserPlugin({
            cache: 'node_modules/.cache/TPtmp',
        })],
    },
};

let mix = require('laravel-mix');

mix.setPublicPath('public');
mix.js('public/src/vuejs/app.js', 'src/js/app.js')
    .sass('public/src/vuejs/app.scss', 'src/css/app.css');

错误日志:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'prod' ]
2 info using npm@6.9.0
3 info using node@v10.16.0
4 verbose run-script [ 'preprod', 'prod', 'postprod' ]
5 info lifecycle @~preprod: @
6 info lifecycle @~prod: @
7 verbose lifecycle @~prod: unsafe-perm in lifecycle true
8 verbose lifecycle @~prod: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/www/node_modules/.bin:/home/dev/bin:/home/dev/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:$
9 verbose lifecycle @~prod: CWD: /var/www
10 silly lifecycle @~prod: Args: [ '-c', 'npm run production' ]
11 silly lifecycle @~prod: Returned: code: 1  signal: null
12 info lifecycle @~prod: Failed to exec prod script
13 verbose stack Error: @ prod: `npm run production`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:198:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:198:13)
13 verbose stack     at maybeClose (internal/child_process.js:982:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid @
15 verbose cwd /var/www
16 verbose Linux 4.4.0-112-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "prod"
18 verbose node v10.16.0
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ prod: `npm run production`
22 error Exit status 1
23 error Failed at the @ prod script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

我不知道如何解决它。

0 个答案:

没有答案