laravel-mix: Dependencies missing for install & Fail to exec dev script
Observed Behavior
After running npm run dev recieved message “Failed to exec dev script”
Suspected Cause
Dependencies are missing for fresh installation backdating to against an exisiting Laravel 5.3 app
Reproduction Steps
Using an existing Laravel 5.3 app (all API driven, but it would be good to add a simple UI to update the data).
- Delete
gulpfile.js - Delete
yarn.lockfile - Recursively delete
node_modulesdirectory - Run
yarn add laravel-mix - Copy
webpack.config.jsandwebpack.mix.jsto home directory. - Copy scripts from npm-scripts laravel-mix documentation to
packages.json - Run
npm run dev
Local Stack
- Node v6.3.1
- NPM v4.1.1
Work Around
I was able to work around the issue and get to a working instance by:
- Manually install webpack 2.2.0-rc.4
yarn add webpack@2.2.0-rc.4 - Manually install graceful-fs
yarn add graceful-fs - Run
webpack --progress --hide-modulesinstead of the script
NPM Error Log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/6.3.1/bin/node',
1 verbose cli '/Users/dfurman/.node/bin/npm',
1 verbose cli 'run',
1 verbose cli 'dev' ]
2 info using npm@4.1.1
3 info using node@v6.3.1
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle @~predev: @
6 silly lifecycle @~predev: no script for predev, continuing
7 info lifecycle @~dev: @
8 verbose lifecycle @~dev: unsafe-perm in lifecycle true
9 verbose lifecycle @~dev: PATH: /Users/dfurman/.node/lib/node_modules/npm/bin/node-gyp-bin:/Users/dfurman/Code/web/routing/node_modules/.bin:/Users/dfurman/.node/bin:/Users/dfurman/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/usr/local/MacGPG2/bin
10 verbose lifecycle @~dev: CWD: /Users/dfurman/Code/web/routing
11 silly lifecycle @~dev: Args: [ '-c',
11 silly lifecycle 'cross-env NODE_ENV=development webpack --watch --progress --hide-modules' ]
12 info lifecycle @~dev: Failed to exec dev script
13 verbose stack Error: @ dev: `cross-env NODE_ENV=development webpack --watch --progress --hide-modules`
13 verbose stack spawn ENOENT
13 verbose stack at ChildProcess.<anonymous> (/Users/dfurman/.node/lib/node_modules/npm/lib/utils/spawn.js:33:16)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at ChildProcess.emit (events.js:191:7)
13 verbose stack at maybeClose (internal/child_process.js:852:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
14 verbose pkgid @
15 verbose cwd /Users/dfurman/Code/web/routing
16 error Darwin 15.6.0
17 error argv "/usr/local/Cellar/node/6.3.1/bin/node" "/Users/dfurman/.node/bin/npm" "run" "dev"
18 error node v6.3.1
19 error npm v4.1.1
20 error file sh
21 error code ELIFECYCLE
22 error errno ENOENT
23 error syscall spawn
24 error @ dev: `cross-env NODE_ENV=development webpack --watch --progress --hide-modules`
24 error spawn ENOENT
25 error Failed at the @ dev script 'cross-env NODE_ENV=development webpack --watch --progress --hide-modules'.
25 error Make sure you have the latest version of node.js and npm installed.
25 error If you do, this is most likely a problem with the package,
25 error not with npm itself.
25 error Tell the author that this fails on your system:
25 error cross-env NODE_ENV=development webpack --watch --progress --hide-modules
25 error You can get information on how to open an issue for this project with:
25 error npm bugs
25 error Or if that isn't available, you can get their info via:
25 error npm owner ls
25 error There is likely additional logging output above.
26 verbose exit [ 1, true ]
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (2 by maintainers)
@rikless hmmm 😕 So, I’m not wrong about it 😉 Anyway, good to see it works.
@JeffreyWay I think to be clear, need some note in the docs before using Mix, make sure “you” have
cross-envandwebpackglobally. If I’ve enough time, maybe I’ll send PR.@ricardocanelas Whoops, nope. Good to see it works.