Laravel-mix: Help Requested From Windows Users

Created on 25 Jan 2017  路  50Comments  路  Source: JeffreyWay/laravel-mix

Hey, everyone. I could use some help from Windows users. If you have the time, would you mind doing:

laravel new example
npm install
npm run dev

Did you get an error related to "node_modules not being an external command", or anything along those lines? If so, can you try running a variant of this command?

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

This ends up being more complicated, because Yarn has this weird thing where it doesn't symlink bin installs to node_modules/.bin. So, if you install Mix with NPM, no problem. But if you do it through Yarn, the NPM script can't find webpack or webpack-dev-server.

So we updated the NPM script to specify the full path to these executable, but now some Windows users are having issues, and I'm not quite sure what the root of it is.

Any help would be appreciated! :)

Most helpful comment

cross-env made a BC from version 3.1 to 3.2 and changed the "bin" folder from

node_modules/cross-env/bin

to

node_modules/cross-env/dist/bin

This issues when upgrading yarn/npm, or a clean install with npm. A clean install of yarn dont make version upgrade, so it read the version from yarn.lock.

So might the package.json edited to persist this change:

 "scripts": {
    "dev": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "node node_modules/cross-env/bin/dist/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch-poll": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "hot": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "production": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },

All 50 comments

No error on my end.

Oddly enough I didn't get the error on my laptop when running npm run dev just now on a fresh install. However, on my desktop machine yesterday (last night) I did get the "node_modules" error... The development environments should be setup the same on each but I'll recheck to see if I can pinpoint why one would be triggering the error over the other..

We did update the NPM script to include "node" at the beginning. That wasn't there before.

It's annoying to me that Yarn seems to require that we do all this junk, just because it won't symlink these files to the node_modules/.bin directory.

Anyways, if anyone follows these steps, and it fails, please tell me the output.

Works with both npm install and yarn. (Windows 7 and 10 with Git Bash)

@JeffreyWay What I think it would be better if there was just a laravel-mix executable and you just pass the webpack config you want to use and don't have to add the full path to node-env, env and webpack. You would simply have:

"dev": "laravel-mix dev --config=node_modules/laravel-mix/setup/webpack.config.js" 

And you could even omit --config just use the default one from mix.

I've seen something like this in vue-cli with the new vue build command.

I wonder if anybody getting this issue is using Git Bash. If so, there's an option you have to enable to allow symlinks. I know I struggled with that before I figured it out.

I'm getting the error if I use Git Bash. It runs fine if I use Cmder

This happens when running npm run dev

  位 npm run dev

  > @ dev C:\projects\test\l54
  > node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

  'node_modules' is not recognized as an internal or external command,
  operable program or batch file.

  npm ERR! Windows_NT 10.0.14393
  npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
  npm ERR! node v6.9.1
  npm ERR! npm  v3.10.8
  npm ERR! code ELIFECYCLE
  npm ERR! @ dev: `node_modules/cross-env/bin/cross-env.js 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 @ dev script 'node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --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!     node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
  npm ERR! You can get information on how to open an issue for this project with:
  npm ERR!     npm bugs
  npm ERR! Or if that isn't available, you can get their info via:
  npm ERR!     npm owner ls
  npm ERR! There is likely additional logging output above.

  npm ERR! Please include the following file with any support request:
  npm ERR!     C:\projects\test\l54\npm-debug.log

@fraserk You might want to reinstall Git Bash. Symbolic links are disabled by default.

git bash symbolic links

@nwrman - Did you add "node" to the beginning of your npm run dev script? We fixed that earlier, so I think yours is an unrelated (and solved) issue.

@cretueusebiu - Yeah, we may end up needing to do that.

@JeffreyWay I just modified my package.json file and it works, I thought it would be solved without manual configuration, I don't mind it though.

It works great, Iv'e been using mix for another non laravel project, and I had manually changed the npm commands to make it work on windows.

Works for me on Windows 10 ;).

Tested with both terminal ( cmd and cmder )

No problems on my end. I ran

npm install
npm run dev
npm run production
node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

And it all built everything successfully out of the box. I tested it on cmder, conemu in a powershell console, and git bash (deleting node_modules/ each time). I also did a test using yarn.

Sorry not being able to help.

@nwrman We updated the Laravel repo already so that it adds "node" for you.

Thanks, everyone!

A possible solution for this may be to add this to the package.json of laravel-mix:

"bin": {
  "webpack": "node_modules/.bin/webpack",
  "cross-env": "node_modules/.bin/cross-env",
  "webpack-dev-server": "node_modules/.bin/webpack-dev-server"
}

Not sure if it will work, though.

@adriaanzon - Good idea! Pretty sure you get the 5-minute hug reward. That should fix it for us.

Update: Ehh, spoke too soon. That breaks things for Webpack. :/

Hmm, just tested it out but this time it only seems to work with Yarn.

When installing with NPM, webpack, cross-env, and webpack-dev-server aren't being installed to <projectdir>/node_modules.

Yeah, for me too.

@JeffreyWay Here's what that might look like: laravel-mix.js

In your package.json you would have:

"scripts": {
  "dev": "laravel-mix",
  "watch": "laravel-mix --watch",
  "hot": "laravel-mix --hot",
  "production": "laravel-mix --production"
},

And if you want a custom Webpack config then use: "dev": "laravel-mix --config=webpack.config.js".

Thanks! I'll definitely take a look at that tonight.

Did you get an error related to "node_modules not being an external command", or anything along those lines? If so, can you try running a variant of this command?
Yes, prior to using 5.4.3 and clean up as below. (and before seeing the script you asked to run)

5.4.3 works here having done the following (id tried that and may it was 5.4.1 id tried unsuccessfully i think)

1.) I uninstalled nodejs, composer and git, Also removed left over composer / node / npm folders, essentially hunt down and remove any remaining global composer.json / global package.json if they're still there

2.) reinstalled all 3, (latest nodejs 7.40x64 )
@cklmercer s comment above -

You might want to reinstall Git Bash. Symbolic links are disabled by default

i suspect was key for me when reinstalling git. using --no-bin-links and ive always had to run it twice because of the "Maximum call stack size exceeded" message.
Whereas now i can just run "npm install" rather than "npm install --no-bin-links
N.B please correct me if i am wrong about this enabling me to leave --no-bin-links off

3.)
using gitbash console, ran:

composer clear-cache
npm cache clear
composer global require laravel/installer

4.) ran:

laravel new example
npm install
npm run dev

bingo

then installing yarn via msi https://yarnpkg.com/en/docs/install
running:

rm -Rf node_modules
yarn cache clear
yarn install
yarn run dev

also works.

Also maybe worth noting that with a windows branch of Valet, composer would not update and kept breaking because i composer removed it without first running valet uninstall - so it wasnt able to change running valet-nginx and 2 other services.

With so many environments, it could be anything, try clean reset anyway.

Something seems broken with Windows linking to node_modules within other modules.

Clean installed everything as well and get that cross-env.js can't be found.

Tried in CMD, Git Bash (w/ Symlinks enabled), Windows Ubuntu Shell (installing nodejs + npm fresh, symlinking node to nodejs).

Running the install with Yarn has the node_modules dependencies loaded correctly, resolving an issue.

maybe short path to folder e.g c:\code\ ? (rather than something buried likec:\Users\<user_home_folder>\code ) ?

jway-

fwiw yarn will create the .bin symlinks if you add all of the binary packages to the topmost package.json file, i.e., the one that ships with laravel. add cross-env, webpack, and webpack-dev-server to laravel's package.json, and yarn will create symlnks no prob.

Hi i am getting same error

`'node_modules' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! Windows_NT 10.0.14393`

i solve this problem node_modules/cross-env/bin/cross-env.js to cross-env

it works perfectly all commands

@IrsyadAdl
i change package.json file like this

package fw

no, i replace node_modules/cross-env/bin/cross-env.js to cross-env

hi here! Just did a fresh install and installed everything with yarn (no npm) and on my local Mac works perfect but when running on production (deployed with envoyer and node_modules symbolic link) fails with same error you had:

npm ERR! Failed at the @ production script 'node node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'

My scripts are:
"scripts": { "dev": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "watch": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "hot": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", "production": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" },

Any idea @JeffreyWay ?

Thanks for response @IrsyadAdl .
Did all changes but still have problem on production server. :(

npm ERR! node node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

@aspitzer is that all the output you're getting?

here I paste all @adriaanzon ! thanks for help!

npm ERR! Linux 4.4.0-57-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "production"
npm ERR! node v7.4.0
npm ERR! npm v4.0.5
npm ERR! code ELIFECYCLE
npm ERR! @ production: node node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ production script 'node node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --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! node node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.

Was wondering why "npm run hot" wasn't working.. Instant solution was to not use Yarn.. I wish this wasn't so dug down took me an hour or so to find this page searching for solutions D:

I had the error until I added Vue back into package.json. Then everything ran fine.

Facing the same error as well when running npm run dev with laravel 5.4 fresh install on window 10 x64, nodejs v4 and npm v3. After reading the comments on this thread, I reinstall with nodejs v6.9.5 and npm v4.2.0 but still facing the same error.

Reinstall with nodejs v7.5.0 and it is working fine now.

i got the same error. please help ;( im stuck

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "dev"
npm ERR! node v7.6.0
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! @ dev: node node_modules/cross-env/bin/cross-env.js 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 @ dev script 'node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --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! node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:xampphtdocsdilg-clipnpm-debug.log

I had the cross-env on Ubuntu 16.04.

As a temp resolution, I did npm install cross-env

I have Homestead on Vagrant on a Windows x64 host and ran into the same problems. What I had to do was this:

npm install --no-bin-links (Executed on the host)

In package.json:

Add /dist to all node_modules/cross-env/bin/cross-env.js references node_modules/cross-env/dist/bin/cross-env.js

  "scripts": {
    "dev": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch-poll": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "hot": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "production": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },

And:

npm rebuild node-sass --no-bin-links (Executed on the host)
(At first I ran this on the VM but then I got: Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 6.x)

So, because it is preferable to run file watchers in the host instead of the VM I ran it again on the host and it worked!

cross-env made a BC from version 3.1 to 3.2 and changed the "bin" folder from

node_modules/cross-env/bin

to

node_modules/cross-env/dist/bin

This issues when upgrading yarn/npm, or a clean install with npm. A clean install of yarn dont make version upgrade, so it read the version from yarn.lock.

So might the package.json edited to persist this change:

 "scripts": {
    "dev": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "node node_modules/cross-env/bin/dist/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch-poll": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "hot": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "production": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },

@stephandesouza thanks for your help on this. I was able to fix the error by running yarn upgrade to update the yarn.lock with the new version of cross-env.

New version of cross-env (4.0.0) is out, and it breaks everything all over again.

  "scripts": {
    "pack:dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=webpack.config.js",
    "pack:watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=webpack.config.js",
    "pack:watch-poll": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=webpack.config.js",
    "pack:hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=webpack.config.js",
    "pack:production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=webpack.config.js"
  },

Which gives this response:

$ npm run pack:dev

> @ pack:dev C:\www\vhosts\grid
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=webpack.config.js

'node_modules' is not recognized as an internal or external command,
operable program or batch file.
events.js:160
      throw er; // Unhandled 'error' event

Unlike an older project with 3.2.3 of cross-env which executes perfectly fine.

I've tried prefixing each line with node and pointing it manually to cross-env's main script, and prefixing all node_modules/ instances with ./ but that doesn't help, either.

edit: if anybody is coming here by google, i solved it by empty my whole node-modules folder ;)

original message:

I get the errors after updating:

vagrant@homestead:~/Code/projectname$ npm run dev

> @ dev /home/vagrant/Code/projectname
> node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

events.js:161
      throw er; // Unhandled 'error' event
      ^

Error: spawn node_modules/webpack/bin/webpack.js ENOENT
    at exports._errnoException (util.js:1023:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at Module.runMain (module.js:607:11)
    at run (bootstrap_node.js:418:7)
    at startup (bootstrap_node.js:139:9)
    at bootstrap_node.js:533:3

npm ERR! Linux 4.4.0-51-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev"
npm ERR! node v7.5.0
npm ERR! npm  v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `node node_modules/cross-env/dist/bin/cross-env.js 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 @ dev script 'node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --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!     node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/Code/projectname/npm-debug.log

npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'dev' ]
2 info using [email protected]
3 info using [email protected]
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: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/vagrant/Code/projectname/node_modules/.bin:/home/vagrant/.composer/vendor/bin:/home/vagrant/bin:/home/vagrant/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
10 verbose lifecycle @~dev: CWD: /home/vagrant/Code/projectname
11 silly lifecycle @~dev: Args: [ '-c',
11 silly lifecycle   'node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
12 silly lifecycle @~dev: Returned: code: 1  signal: null
13 info lifecycle @~dev: Failed to exec dev script
14 verbose stack Error: @ dev: `node node_modules/cross-env/dist/bin/cross-env.js 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 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/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:192:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/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:192:7)
14 verbose stack     at maybeClose (internal/child_process.js:890:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid @
16 verbose cwd /home/vagrant/Code/projectname
17 error Linux 4.4.0-51-generic
18 error argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev"
19 error node v7.5.0
20 error npm  v4.1.2
21 error code ELIFECYCLE
22 error @ dev: `node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
22 error Exit status 1
23 error Failed at the @ dev script 'node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the  package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

Just adding my issue as it could help others: My issue popped up when I --save a library with NPM. At this point yarn and package.json are out of sync. Running yarn upgrade will resync them. Thanks @nathanjisaac for mentioning it.

reinstalling git bash with symlinks, and added the node command to my package.json fixed the issue.

cross-env 5.0.0 solved the problem introduced in 4.0.0, it seems safe to update.

Windows 10, L5.4, npm 3.10.10, & node 6.11.0
After spending far too long on this, trying every suggestion I could find and getting nowhere, I also used
npm install cross-env
and that seems to have fixed it ( at least not getting "cross-env is not recognized as an internal or external command" )

@webmasterb4d Update your npm version. npm i -g npm

I am getting the error, Yarn is not an internal or external command when i use browserSync function rest work fine.

it's a binding issue. please issue this command in your project root
npm rebuild node-sass

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nezaboravi picture nezaboravi  路  3Comments

Cheddam picture Cheddam  路  3Comments

stefensuhat picture stefensuhat  路  3Comments

rlewkowicz picture rlewkowicz  路  3Comments

mementoneli picture mementoneli  路  3Comments