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.

Error running 'npm run dev'

See original GitHub issue
  • Laravel Mix Version: 5.0.4
  • Node Version: 13.3.0:
  • NPM Version: 6.13.1:
  • OS: windows 10

The cmd screen:

@ dev C:\xampp\htdocs\blog npm run development

@ development C:\xampp\htdocs\blog cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

C:\xampp\htdocs\blog\node_modules\webpack-cli\bin\cli.js:93 throw err; ^

Error: Package exports for ‘C:\xampp\htdocs\blog\node_modules\kleur’ do not define a valid ‘./colors’ target at resolveExportsTarget (internal/modules/cjs/loader.js:614:9) at applyExports (internal/modules/cjs/loader.js:499:14) at resolveExports (internal/modules/cjs/loader.js:548:12) at Function.Module._findPath (internal/modules/cjs/loader.js:650:22) at Function.Module._resolveFilename (internal/modules/cjs/loader.js:948:27) at Function.Module._load (internal/modules/cjs/loader.js:854:27) at Module.require (internal/modules/cjs/loader.js:1023:19) at require (C:\xampp\htdocs\blog\node_modules\v8-compile-cache\v8-compile-cache.js:161:20) at Object.<anonymous> (C:\xampp\htdocs\blog\node_modules\autoprefixer\lib\autoprefixer.js:9:13) at Module._compile (C:\xampp\htdocs\blog\node_modules\v8-compile-cache\v8-compile-cache.js:194:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:1167:10) at Module.load (internal/modules/cjs/loader.js:983:32) at Function.Module._load (internal/modules/cjs/loader.js:891:14) at Module.require (internal/modules/cjs/loader.js:1023:19) at require (C:\xampp\htdocs\blog\node_modules\v8-compile-cache\v8-compile-cache.js:161:20) at C:\xampp\htdocs\blog\node_modules\laravel-mix\src\components\Preprocessor.js:62:41 at C:\xampp\htdocs\blog\node_modules\laravel-mix\src\components\Preprocessor.js:69:31 at global.tap (C:\xampp\htdocs\blog\node_modules\laravel-mix\src\helpers.js:10:5) at C:\xampp\htdocs\blog\node_modules\laravel-mix\src\components\Preprocessor.js:27:13 at Array.forEach (<anonymous>) at Sass.webpackRules (C:\xampp\htdocs\blog\node_modules\laravel-mix\src\components\Preprocessor.js:22:22) at ComponentFactory.applyRules (C:\xampp\htdocs\blog\node_modules\laravel-mix\src\components\ComponentFactory.js:155:23) at C:\xampp\htdocs\blog\node_modules\laravel-mix\src\components\ComponentFactory.js:66:48 at C:\xampp\htdocs\blog\node_modules\laravel-mix\src\Dispatcher.js:34:47 at Array.forEach (<anonymous>) at Dispatcher.fire (C:\xampp\htdocs\blog\node_modules\laravel-mix\src\Dispatcher.js:34:28) at Mix.dispatch (C:\xampp\htdocs\blog\node_modules\laravel-mix\src\Mix.js:118:25) at WebpackConfig.buildRules (C:\xampp\htdocs\blog\node_modules\laravel-mix\src\builder\WebpackConfig.js:90:13) at WebpackConfig.build (C:\xampp\htdocs\blog\node_modules\laravel-mix\src\builder\WebpackConfig.js:23:14) at Object.<anonymous> (C:\xampp\htdocs\blog\node_modules\laravel-mix\setup\webpack.config.js:29:38) at Module._compile (C:\xampp\htdocs\blog\node_modules\v8-compile-cache\v8-compile-cache.js:194:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:1167:10) at Module.load (internal/modules/cjs/loader.js:983:32) at Function.Module._load (internal/modules/cjs/loader.js:891:14) at Module.require (internal/modules/cjs/loader.js:1023:19) at require (C:\xampp\htdocs\blog\node_modules\v8-compile-cache\v8-compile-cache.js:161:20) { code: ‘MODULE_NOT_FOUND’ } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ development: cross-env NODE_ENV=development 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 @ development 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! C:\Users\פלש\AppData\Roaming\npm-cache_logs\2020-06-21T10_45_49_481Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ dev: npm run development npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I deleted the package folder, cleaned up a cache, and reinstalled, nothing helped.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9

github_iconTop GitHub Comments

12reactions
alex-kudryacommented, Aug 3, 2020

Update Node to 14.7.0 to fix it

0reactions
apolopenacommented, Mar 26, 2021

@JeffreyWay this issue does not seem to be resolved. Updating node does not fix it. I am getting the error on:

  • Node v14.16.0
  • NPM version 6.14.11
  • Ubuntu 20.04.2 LTS
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/home/gitpod/.nvm/versions/node/v14.16.0/bin/node',
1 verbose cli   '/home/gitpod/.nvm/versions/node/v14.16.0/bin/npm',
1 verbose cli   'run',
1 verbose cli   'development'
1 verbose cli ]
2 info using npm@6.14.11
3 info using node@v14.16.0
4 verbose run-script [ 'predevelopment', 'development', 'postdevelopment' ]
5 info lifecycle @~predevelopment: @
6 info lifecycle @~development: @
7 verbose lifecycle @~development: unsafe-perm in lifecycle true
8 verbose lifecycle @~development: PATH: /home/gitpod/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/workspace/gitpod-laravel8-starter/node_modules/.bin:/home/gitpod/.nvm/versions/node/v14.16.0/bin:/tmp/yarn--1616783743790-0.4004209842427078:/workspace/gitpod-laravel8-starter/node_modules/.bin:/home/gitpod/.config/yarn/link/node_modules/.bin:/home/gitpod/.yarn/bin:/home/gitpod/.nvm/versions/node/v14.16.0/libexec/lib/node_modules/npm/bin/node-gyp-bin:/home/gitpod/.nvm/versions/node/v14.16.0/lib/node_modules/npm/bin/node-gyp-bin:/home/gitpod/.nvm/versions/node/v14.16.0/bin/node_modules/npm/bin/node-gyp-bin:/home/gitpod/.sdkman/candidates/maven/current/bin:/home/gitpod/.sdkman/candidates/java/current/bin:/home/gitpod/.sdkman/candidates/gradle/current/bin:/home/gitpod/.rvm/gems/ruby-2.6.6/bin:/home/gitpod/.rvm/gems/ruby-2.6.6@global/bin:/home/gitpod/.rvm/rubies/ruby-2.6.6/bin:/home/gitpod/.pyenv/plugins/pyenv-virtualenv/shims:/home/gitpod/.pyenv/shims:/workspace/.cargo/bin:/workspace/.pip-modules/bin:/workspace/.rvm/bin:/ide/bin:/home/gitpod/.pyenv/bin:/home/gitpod/.pyenv/shims:/workspace/go/bin:/home/gitpod/go/bin:/home/gitpod/go-packages/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin/:/home/gitpod/.nvm/versions/node/v14.16.0/bin:/home/gitpod/.cargo/bin:/home/gitpod/.rvm/bin
9 verbose lifecycle @~development: CWD: /workspace/gitpod-laravel8-starter
10 silly lifecycle @~development: Args: [ '-c', 'mix' ]
11 silly lifecycle @~development: Returned: code: 1  signal: null
12 info lifecycle @~development: Failed to exec development script
13 verbose stack Error: @ development: `mix`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/home/gitpod/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (/home/gitpod/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1048:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid @
15 verbose cwd /workspace/gitpod-laravel8-starter
16 verbose Linux 5.4.0-1024-gcp
17 verbose argv "/home/gitpod/.nvm/versions/node/v14.16.0/bin/node" "/home/gitpod/.nvm/versions/node/v14.16.0/bin/npm" "run" "development"
18 verbose node v14.16.0
19 verbose npm  v6.14.11
20 error code ELIFECYCLE
21 error errno 1
22 error @ development: `mix`
22 error Exit status 1
23 error Failed at the @ development script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

UPDATE: I can confirm that this issue went away when I upgraded npm to version 7.7.5

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why I can not run Npm run dev? - Stack Overflow
Basically delete the node_modules folder and package-lock.json file , clear cache and do an npm install. Worked for me. Share.
Read more >
npm run dev error - Laracasts
npm run dev error ... npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ development: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js -- ...
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 ... Running multiple commands at the...
Read more >
What to do when "npm run dev" is not working? (React)
I tried to start my application with “npm run dev” as it is a react / next.js app. The console gave me an...
Read more >
20.04 - Error Running npm run dev in Vagrant and VirtualBox
It's plausible that symlinks are your problem. I run an Ubuntu 20.04 LTS Linux guest in VirtualBox 6.1.32 and when using host shares...
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