laravel 5.4 dev npm run dev error

Posted 2 years ago by w1n78

i wanted to get an early start before the release of laravel 5.4. so i downloaded a fresh copy onto an empty project. as i start to go through my usual configs, i noticed no more gulpfile.js. i checked out https://github.com/laravel/docs/blob/5.4/mix.md and seen a few commands

// Run all Mix tasks...
npm run dev

// Run all Mix tasks and minify output...
npm run production

so i guess no more gulp command. i ran the commands above and get the following errors.

> @ dev /Users/sherwin/apps/laravel/test_project
> cross-env NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

sh: cross-env: command not found

npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/Cellar/node/7.3.0/bin/node" "/usr/local/bin/npm" "run" "dev"
npm ERR! node v7.3.0
npm ERR! npm  v3.10.10
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @ dev: `cross-env NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the @ dev script 'cross-env NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

as you can see from the error, i have node and npm installed. i am the worst at anything node related and javascript. all of the files are unmodified except i added a laravel-debugbar repo and "app/Modles" in my autoload entry in composer.json. did i miss something?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.