Developer Guru
Developer Guru

Reputation: 85

Laravel 5.5 + Vue.js 2.x project not working on npm run dev

when I have created the new project for Laravel 5.5 + Vue.js 2.x , I have the problem. This is the message after I have run this.

npm install 
npm run dev


> @ dev /Volumes/Work/Work/Vue/CRUD
> npm run development


> @ development /Volumes/Work/Work/Vue/CRUD
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

 95% emitting                                                                         

 DONE  Compiled successfully in 2830ms                                                                                         6:01:15 PM

internal/child_process.js:325
    throw errnoException(err, 'spawn');
    ^

Error: spawn EACCES
    at _errnoException (util.js:1041:11)
    at ChildProcess.spawn (internal/child_process.js:325:11)
    at exports.spawn (child_process.js:493:9)
    at Object.exports.execFile (child_process.js:208:15)
    at Object.module.exports.fileCommand (/Volumes/Work/Work/Vue/CRUD/node_modules/node-notifier/lib/utils.js:53:13)
    at NotificationCenter.notify (/Volumes/Work/Work/Vue/CRUD/node_modules/node-notifier/notifiers/notificationcenter.js:66:11)
    at module.exports.WebpackNotifierPlugin.compilationDone (/Volumes/Work/Work/Vue/CRUD/node_modules/webpack-notifier/index.js:62:18)
    at Compiler.applyPlugins (/Volumes/Work/Work/Vue/CRUD/node_modules/tapable/lib/Tapable.js:61:14)
    at emitRecords.err (/Volumes/Work/Work/Vue/CRUD/node_modules/webpack/lib/Compiler.js:268:11)
    at Compiler.emitRecords (/Volumes/Work/Work/Vue/CRUD/node_modules/webpack/lib/Compiler.js:375:38)
    at emitAssets.err (/Volumes/Work/Work/Vue/CRUD/node_modules/webpack/lib/Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (/Volumes/Work/Work/Vue/CRUD/node_modules/webpack/lib/Compiler.js:368:12)
    at next (/Volumes/Work/Work/Vue/CRUD/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Volumes/Work/Work/Vue/CRUD/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/Volumes/Work/Work/Vue/CRUD/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/Volumes/Work/Work/Vue/CRUD/node_modules/webpack/lib/Compiler.js:365:9)
    at require.forEach.err (/Volumes/Work/Work/Vue/CRUD/node_modules/webpack/lib/Compiler.js:354:15)
    at /Volumes/Work/Work/Vue/CRUD/node_modules/async/dist/async.js:421:16
    at iteratorCallback (/Volumes/Work/Work/Vue/CRUD/node_modules/async/dist/async.js:998:13)
    at /Volumes/Work/Work/Vue/CRUD/node_modules/async/dist/async.js:906:16
    at /Volumes/Work/Work/Vue/CRUD/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:135:15)
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!     /Users/paladin2/.npm/_logs/2017-09-04T08_01_15_242Z-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.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/paladin2/.npm/_logs/2017-09-04T08_01_15_321Z-debug.log

Has anybody had the same problem in the past?

Upvotes: 2

Views: 2593

Answers (5)

Jaikangam
Jaikangam

Reputation: 1

I've installed without laragon or Virtual host. Got the same error that cross-env is not found. After the hours of research I found the solution. Here is how I did:

  1. npm install cross-env -g
  2. npm update
  3. npm install --save

after that npm run dev or npm run build

Boom! Laravel Mix Build Successful it is working.....

Upvotes: 0

swathi_sri
swathi_sri

Reputation: 417

if npm update doesn't work try installing webpack manually by command.

npm install –save-dev npm-install-webpack-plugin

Upvotes: 1

Marco
Marco

Reputation: 429

giving your user execute rights on node_modules does the trick: chmod -R u+x node_modules/

Upvotes: 1

Developer Guru
Developer Guru

Reputation: 85

that issue cause of permission of that folder, I think.

when I set folder permission like this, all works fine on my computer.

chmod -R 765 [foldername]

Thanks.

Upvotes: 0

LJ1090
LJ1090

Reputation: 1

I had the same issue since this morning and I remembered that I updated my npm version lately. EVen if I created a new project and ran npm install && npm run dev I got the same issue.

A temporary solution for me is/was to downgrade npm: npm install -g [email protected]

If I now run npm run dev everything works fine.

Upvotes: 0

Related Questions