question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm run prod fail

See original GitHub issue
  • Laravel Mix Version: 1.7.2

  • Npm list: ├── axios@0.17.1 ├── bootstrap@4.0.0-beta.3 ├── browser-sync@2.22.0 ├── browser-sync-webpack-plugin@1.2.0 ├── cross-env@5.1.3 ├── jquery@3.2.1 ├── laravel-mix@1.7.2 ├── lodash@4.17.4 ├── popper.js@1.13.0 └── vue@2.5.13

  • Node Version: 8.9.3

  • NPM Version: 5.6.0

  • OS: OSX

Description:

npm run prod fail but npm run dev and watch work fine.

Npm debug log:

0 info it worked if it ends with ok 1 verbose cli [ ‘/usr/local/bin/node’, ‘/usr/local/bin/npm’, ‘run’, ‘prod’ ] 2 info using npm@5.6.0 3 info using node@v8.9.3 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/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/{username}/Code/{projectname}/node_modules/.bin:/Users/{username}/bin:/usr/local/bin:/Users/{username}/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin 9 verbose lifecycle @~prod: CWD: /Users/{username}/Code/{projectname} 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/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285: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:925:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) 14 verbose pkgid @ 15 verbose cwd /Users/{username}/Code/{projectname} 16 verbose Darwin 16.7.0 17 verbose argv “/usr/local/bin/node” “/usr/local/bin/npm” “run” “prod” 18 verbose node v8.9.3 19 verbose npm v5.6.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 ]

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Nathanwcommented, Jan 4, 2018

This error seems to be due to the uglify options needing to be formatted like this:

uglify: {
     uglifyOptions: {
         output: {
             comments: false 
         }
     }
 }

This can be seen in the default mix config file here: https://github.com/JeffreyWay/laravel-mix/blob/master/src/config.js#L286

0reactions
rslanzicommented, Jan 10, 2018

Ops! 😕 Now it works! Thank you @Nathanw

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm run prod failed - Adobe Experience League Community
I am trying to run a maven aem project but I got the below error. Can anyone help me with this. [ERROR] Failed...
Read more >
npm run production Fails. - Laracasts
npm run production Fails. Hi,. I am having this config in my package.json. Copy Code { "private": true, "scripts": { "dev": "npm run...
Read more >
Failed at the @ production script. Error running npm run ...
I am facing issue while using the following command npm run production. after execute following command i ...
Read more >
NPM run prod error · Issue #1304 - GitHub
prod : `npm run production` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ prod script. npm ERR! This...
Read more >
DigitalOcean App, Laravel, npm run production fails
Are there any fixes to npm run prod fails on build? I would like to add this to ensure what is on the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found