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 development error

See original GitHub issue
  • Laravel Mix Version: 0.11.4(npm list --depth=0)
  • Node Version (7.10.0):
  • NPM Version (4.2.0):
  • OS: macOS

Description:

├── axios@0.15.3 ├── bootstrap-sass@3.3.7 ├── cross-env@3.2.4 ├── jquery@3.2.1 ├── laravel-mix@0.11.4 ├── lodash@4.17.4 └── vue@2.3.3

npm ERR! Please include the following file with any support request: npm ERR! /Users/chenghuiyong/.npm/_logs/2017-05-13T04_00_13_806Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/7.10.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'development' ]
2 info using npm@4.2.0
3 info using node@v7.10.0
4 verbose run-script [ 'predevelopment', 'development', 'postdevelopment' ]
5 info lifecycle @~predevelopment: @
6 silly lifecycle @~predevelopment: no script for predevelopment, continuing
7 info lifecycle @~development: @
8 verbose lifecycle @~development: unsafe-perm in lifecycle true
9 verbose lifecycle @~development: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/chenghuiyong/Applications/Public/ecshop_discount/node_modules/.bin:/usr/local/bin:/usr/local/git/bin:/usr/bin:/bin:/usr/sbin:/sbin
10 verbose lifecycle @~development: CWD: /Users/chenghuiyong/Applications/Public/ecshop_discount
11 silly lifecycle @~development: Args: [ '-c',
11 silly lifecycle   'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
12 silly lifecycle @~development: Returned: code: 2  signal: null
13 info lifecycle @~development: Failed to exec development script
14 verbose stack Error: @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
14 verbose stack Exit status 2
14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:194:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:194:7)
14 verbose stack     at maybeClose (internal/child_process.js:899:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid @
16 verbose cwd /Users/chenghuiyong/Applications/Public/ecshop_discount
17 error Darwin 16.5.0
18 error argv "/usr/local/Cellar/node/7.10.0/bin/node" "/usr/local/bin/npm" "run" "development"
19 error node v7.10.0
20 error npm  v4.2.0
21 error code ELIFECYCLE
22 error errno 2
23 error @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
23 error Exit status 2
24 error Failed at the @ development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the  package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error     cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
24 error You can get information on how to open an issue for this project with:
24 error     npm bugs
24 error Or if that isn't available, you can get their info via:
24 error     npm owner ls
24 error There is likely additional logging output above.
25 verbose exit [ 2, true ]

Issue Analytics

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

github_iconTop GitHub Comments

7reactions
huiyonghkwcommented, May 13, 2017

I try to solve it like this

watch the 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"
  }

....

execute the command cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

$ cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

install cross-env

$ npm install --global cross-env

after that, execute above cross-env command and you can find something, good luck for you

0reactions
Chi-Gcommented, Sep 8, 2021

img 1 Screenshot (243) img 1 cont… Screenshot (244) how do i solve this when i run npm run dev ?

app.scss file below @import url('https://fonts.googleapis.com/css?family=Nunito'); $font-family-sans-serif: 'Nunito', sans-serif; @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";

package.json file { "private": true, "scripts": { "dev": "npm run development", "development": "mix", "watch": "mix watch", "watch-poll": "mix watch -- --watch-options-poll=1000", "hot": "mix watch --hot", "prod": "npm run production", "production": "mix --production" },

{ "devDependencies": "axios": "^0.21", "bootstrap": "^5.1.1", "laravel-mix": "^6.0.6", "lodash": "^4.17.19", "popper.js": "^1.16.1", "postcss": "^8.1.14", "resolve-url-loader": "^4.0.0", "sass": "^1.39.0", "sass-loader": "^12.1.0" }

webpack.mix.js file const mix = require('laravel-mix');

mix.js('resources/js/app.js', 'public/js');

mix.sass('resources/sass/app.sass', 'public/css') .sass('resources/sass/admin.sass', 'public/css/admin');

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why I can not run Npm run dev? - Stack Overflow
First run npm install cross-env npm install. Then run npm run dev.
Read more >
npm run dev error - Laracasts
It could be caused by your installed packages being bad. Try this. Copy Code npm cache clean --force rm -rf node_modules npm install...
Read more >
Error on npm run dev with Laravel Project · Issue #2761 - GitHub
Hi, I get following error when i am try to run npm run dev command on windows power-shell @ development C:\Users\Praneeth ...
Read more >
How To Fix “Laravel Mix NPM run dev error” - YouTube
This video will help you to solve the annoying “Laravel Mix NPM run dev error ” that you probably have seen before when...
Read more >
npm run dev Is Not Working In Laravel 8 - Error Fixed - YouTube
You will fix your error InchaeAllah in four steps, don't worry Music:https://www.youtube.com/watch?v=AOeY-nDp7hI&t=0s.
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