Read the error. It tells you what the problem is how to solve it at the start.
Jun 3, 2018
4
Level 4
npm run production Fails.
Hi,
I am having this config in my 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 --display-error-details --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": {
"laravel-mix": "^2.0",
"less": "^3.0.2",
"less-loader": "^4.1.0",
"lodash": "^4.17.4",
"popper.js": "^1.12",
"tailwindcss": "^0.5.2",
"vue": "^2.5.7",
"yarn": "*"
},
"dependencies": {
"tinymce": "^4.6.4",
"axios": "^0.18",
"cross-env": "^5.1"
}
}
However, when I run: npm i -- production and npm run production I get the following error:
0 info it worked if it ends with ok
1 warn npm npm does not support Node.js v7.5.0
2 warn npm You should probably upgrade to a newer version of node as we
3 warn npm can't make any promises that npm will work with this version.
4 warn npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
5 warn npm You can find the latest version at https://nodejs.org/
6 verbose cli [ '/usr/local/Cellar/node/7.5.0/bin/node',
6 verbose cli '/usr/local/bin/npm',
6 verbose cli 'run',
6 verbose cli 'production' ]
7 info using [email protected]
8 info using [email protected]
9 verbose run-script [ 'preproduction', 'production', 'postproduction' ]
10 info lifecycle @~preproduction: @
11 info lifecycle @~production: @
12 verbose lifecycle @~production: unsafe-perm in lifecycle true
13 verbose lifecycle @~production: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Volumes/DEV-DRIVE/hypotheekbond/test/jigal/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jigal.sanders/Library/Android/sdk/tools:/Users/jigal.sanders/Library/Android/sdk/platform-tools
14 verbose lifecycle @~production: CWD: /Volumes/DEV-DRIVE/hypotheekbond/test/jigal
15 silly lifecycle @~production: Args: [ '-c',
15 silly lifecycle 'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
16 silly lifecycle @~production: Returned: code: 1 signal: null
17 info lifecycle @~production: Failed to exec production script
18 verbose stack Error: @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
18 verbose stack Exit status 1
18 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:304:16)
18 verbose stack at emitTwo (events.js:106:13)
18 verbose stack at EventEmitter.emit (events.js:192:7)
18 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
18 verbose stack at emitTwo (events.js:106:13)
18 verbose stack at ChildProcess.emit (events.js:192:7)
18 verbose stack at maybeClose (internal/child_process.js:890:16)
18 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
19 verbose pkgid @
20 verbose cwd /Volumes/DEV-DRIVE/hypotheekbond/test/jigal
21 verbose Darwin 17.5.0
22 verbose argv "/usr/local/Cellar/node/7.5.0/bin/node" "/usr/local/bin/npm" "run" "production"
23 verbose node v7.5.0
24 verbose npm v6.1.0
25 error code ELIFECYCLE
26 error errno 1
27 error @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
27 error Exit status 1
28 error Failed at the @ production script.
28 error This is probably not a problem with npm. There is likely additional logging output above.
29 verbose exit [ 1, true ]
Please or to participate in this conversation.