Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
升级至laravel mix 4.0.16后,npm开始生产;行不通 Laravel版本5.5 Laravel Mix版本4.0.16 节点版本v10.16.0 NPM版本6.9.0 Centos 7_Laravel_Vue.js_Laravel Mix - Fatal编程技术网

升级至laravel mix 4.0.16后,npm开始生产;行不通 Laravel版本5.5 Laravel Mix版本4.0.16 节点版本v10.16.0 NPM版本6.9.0 Centos 7

升级至laravel mix 4.0.16后,npm开始生产;行不通 Laravel版本5.5 Laravel Mix版本4.0.16 节点版本v10.16.0 NPM版本6.9.0 Centos 7,laravel,vue.js,laravel-mix,Laravel,Vue.js,Laravel Mix,说明 { "private": true, "scripts": { "dev": "npm run development", "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.conf

说明

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "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",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.19.0",
        "bootstrap-sass": "^3.4.1",
        "cross-env": "^5.0.1",
        "jquery": "^3.4.1",
        "laravel-mix": "^4.0.16",
        "lodash": "^4.17.4",
        "vue": "^2.6.10"
    },
    "dependencies": {
        "vue-js-modal": "^1.3.31",
        "vue-router": "^3.0.6",
        "vue-slider-component": "^3.0.32",
        "vue-template-compiler": "^2.6.10"
    }
}
在我使用
npm update
命令将laravel mix从1*升级到4.0.16之后,
npm run production
不工作,但
npm run watch
命令工作正常

package.json

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "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",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.19.0",
        "bootstrap-sass": "^3.4.1",
        "cross-env": "^5.0.1",
        "jquery": "^3.4.1",
        "laravel-mix": "^4.0.16",
        "lodash": "^4.17.4",
        "vue": "^2.6.10"
    },
    "dependencies": {
        "vue-js-modal": "^1.3.31",
        "vue-router": "^3.0.6",
        "vue-slider-component": "^3.0.32",
        "vue-template-compiler": "^2.6.10"
    }
}
npm运行生产错误

[jezygroup@server jezyGroup]$ npm run production

> @ production /home/jezygroup/jezyGroup
> cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

 10% building 0/1 modules 1 active ...p/resources/assets/js/AdminPanel/app.j 10% building 1/1 modules 0 activenpm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ production: `cross-env NODE_ENV=production 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 @ production 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!     /home/jezygroup/.npm/_logs/2019-06-06T11_39_30_311Z-debug.log
日志文件

[jezygroup@server jezyGroup]$ cat /home/jezygroup/.npm/_logs/2019-06-06T11_39_30_311Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/home/jezygroup/.nvm/versions/node/v10.16.0/bin/node',
1 verbose cli   '/home/jezygroup/.nvm/versions/node/v10.16.0/bin/npm',
1 verbose cli   'run',
1 verbose cli   'production' ]
2 info using npm@6.9.0
3 info using node@v10.16.0
4 verbose run-script [ 'preproduction', 'production', 'postproduction' ]
5 info lifecycle @~preproduction: @
6 info lifecycle @~production: @
7 verbose lifecycle @~production: unsafe-perm in lifecycle true
8 verbose lifecycle @~production: PATH: /home/jezygroup/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/jezygroup/jezyGroup/node_modules/.bin:/home/jezygroup/.nvm/versions/node/v10.16.0/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/cpanel/composer/bin:/home/jezygroup/.local/bin:/home/jezygroup/bin
9 verbose lifecycle @~production: CWD: /home/jezygroup/jezyGroup
10 silly lifecycle @~production: Args: [ '-c',
10 silly lifecycle   'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
11 silly lifecycle @~production: Returned: code: 1  signal: null
12 info lifecycle @~production: Failed to exec production script
13 verbose stack Error: @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/home/jezygroup/.nvm/versions/node/v10.16.0/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> (/home/jezygroup/.nvm/versions/node/v10.16.0/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 /home/jezygroup/jezyGroup
16 verbose Linux 3.10.0-962.3.2.lve1.5.24.7.el7.x86_64
17 verbose argv "/home/jezygroup/.nvm/versions/node/v10.16.0/bin/node" "/home/jezygroup/.nvm/versions/node/v10.16.0/bin/npm" "run" "production"
18 verbose node v10.16.0
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
22 error Exit status 1
23 error Failed at the @ production script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

使用更新package.json,特别是“脚本”部分

{
“私人”:没错,
“脚本”:{
“开发”:“npm运行开发”,
“开发”:“跨环境节点\u env=development节点\u modules/webpack/bin/webpack.js--progress--hide modules--config=NODE\u modules/laravel mix/setup/webpack.config.js”,
“观察”:“npm运行开发-----观察”,
“观察投票”:“npm运行观察---观察投票”,
“hot”:“cross env NODE_env=development NODE_modules/webpack dev server/bin/webpack-dev-server.js--inline--hot--config=NODE_modules/laravel mix/setup/webpack.config.js”,
“产品”:“npm运行生产”,
“生产”:“交叉环境节点\环境=生产节点\模块/webpack/bin/webpack.js--无进展--隐藏模块--配置=节点\模块/laravel mix/setup/webpack.config.js”
},
“依赖项”:{
“axios”:“^0.19”,
“引导”:“^4.1.0”,
“交叉环境”:“^5.1”,
“jquery”:“^3.4.1”,
“laravel mix”:“^4.0.16”,
“lodash”:“^4.17.5”,
“popper.js”:“^1.12”,
“解析url加载程序”:“^2.3.1”,
“sass”:“^1.15.2”,
“sass加载程序”:“^7.1.0”,
“vue”:“^2.6.10”,
“vue js模式”:“^1.3.31”,
“vue路由器”:“^3.0.6”,
“vue滑块组件”:“^3.0.32”,
vue模板编译器“^2.6.10”
}
}

使用更新package.json,特别是“脚本”部分

{
“私人”:没错,
“脚本”:{
“开发”:“npm运行开发”,
“开发”:“跨环境节点\u env=development节点\u modules/webpack/bin/webpack.js--progress--hide modules--config=NODE\u modules/laravel mix/setup/webpack.config.js”,
“观察”:“npm运行开发-----观察”,
“观察投票”:“npm运行观察---观察投票”,
“hot”:“cross env NODE_env=development NODE_modules/webpack dev server/bin/webpack-dev-server.js--inline--hot--config=NODE_modules/laravel mix/setup/webpack.config.js”,
“产品”:“npm运行生产”,
“生产”:“交叉环境节点\环境=生产节点\模块/webpack/bin/webpack.js--无进展--隐藏模块--配置=节点\模块/laravel mix/setup/webpack.config.js”
},
“依赖项”:{
“axios”:“^0.19”,
“引导”:“^4.1.0”,
“交叉环境”:“^5.1”,
“jquery”:“^3.4.1”,
“laravel mix”:“^4.0.16”,
“lodash”:“^4.17.5”,
“popper.js”:“^1.12”,
“解析url加载程序”:“^2.3.1”,
“sass”:“^1.15.2”,
“sass加载程序”:“^7.1.0”,
“vue”:“^2.6.10”,
“vue js模式”:“^1.3.31”,
“vue路由器”:“^3.0.6”,
“vue滑块组件”:“^3.0.32”,
vue模板编译器“^2.6.10”
}
}

问题可能出在webpack.mix.js配置中。你能在这里复制这个文件的内容吗?添加了webpack.mix.js文件问题可能在webpack.mix.js配置中。你能把这个文件的内容复制到这里吗?添加了webpack.mix.js文件