Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run dev fails on my 5.4 when configuring passport API Authentication #623

Closed
Brayantezz opened this issue Mar 27, 2017 · 24 comments
Closed

Comments

@Brayantezz
Copy link

$ npm run dev

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

The system cannot find the path specified.
events.js:160
throw er; // Unhandled 'error' event
^

Error: spawn node_modules/webpack/bin/webpack.js ENOENT
at notFoundError (C:\xampp\htdocs\TocApp\node_modules\cross-spawn\lib\enoent.js:11:11)
at verifyENOENT (C:\xampp\htdocs\TocApp\node_modules\cross-spawn\lib\enoent.js:46:16)
at ChildProcess.cp.emit (C:\xampp\htdocs\TocApp\node_modules\cross-spawn\lib\enoent.js:33:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: 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 @ dev script '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! 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 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! A complete log of this run can be found in:
npm ERR! C:\Users\BRAYAN\AppData\Roaming\npm-cache_logs\2017-03-27T08_28_13_634Z-debug.log

@ankurk91
Copy link
Contributor

@Brayantezz
Can you follow ISSSUE_TEMPLATE.md and answer those question.
This way we can help and debug better.

@JeffreyWay
Copy link
Collaborator

Yep - we need the issue template filled out.

@yaroslav-pohil
Copy link

yaroslav-pohil commented Mar 27, 2017

Hi @JeffreyWay @ankurk91
I'm having the same issue:

Laravel Mix Version: 5.4.16
Node Version (node -v): 4.4.0
NPM Version (npm -v): 2.14.20
OS: Windows 10

Description:

When i run npm run dev, i'm receiving an error:

> @ dev D:\OpenServer\domains\adtool
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

System cannot find the path specified.
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: spawn node_modules/webpack/bin/webpack.js ENOENT
    at notFoundError (D:\OpenServer\domains\adtool\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:11:11)
    at verifyENOENT (D:\OpenServer\domains\adtool\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:46:16)
    at ChildProcess.cp.emit (D:\OpenServer\domains\adtool\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:33:19)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

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 v4.4.0
npm ERR! npm  v2.14.20
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `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 @ dev script '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! 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 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 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!     D:\OpenServer\domains\adtool\npm-debug.log

File node_modules/webpack/bin/webpack.js not exists. Path node_modules/webpack not exists as well.

Steps To Reproduce:

Clean laravel instalation, then:

  1. run composer install;
  2. run npm install;
  3. run npm install cross-env -D (read it from 'npm run dev' doesn't do anything (Windows 10) laravel/framework#18446);
  4. run npm run dev.

Solution:

@Brayantezz
Node.js version was too old. After i installed Node.js 7.7.4, and reinstalled node_modules all works fine.

@ankurk91
Copy link
Contributor

ankurk91 commented Mar 28, 2017

Confirm, Just tried with:

  • Laravel mix v0.9.2
  • node v4.8.1
  • npm v2.15.11
  • OS: Ubuntu 16.04 x64
npm run dev

Produce this error

> racecloud-devDependencies@ dev /home/ankurk/projects/race-cloud
> 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

/home/ankurk/projects/race-cloud/node_modules/laravel-mix/setup/webpack.config.js:1
(function (exports, require, module, __filename, __dirname) { let path = require('path');
                                                              ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at requireConfig (/home/ankurk/projects/race-cloud/node_modules/webpack/bin/convert-argv.js:96:18)
    at /home/ankurk/projects/race-cloud/node_modules/webpack/bin/convert-argv.js:109:17
    at Array.forEach (native)

npm ERR! Linux 4.4.0-57-generic
npm ERR! argv "/home/ankurk/.nvm/versions/node/v4.8.1/bin/node" "/home/ankurk/.nvm/versions/node/v4.8.1/bin/npm" "run" "dev"
npm ERR! node v4.8.1
npm ERR! npm  v2.15.11
npm ERR! code ELIFECYCLE
npm ERR! racecloud-devDependencies@ 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 racecloud-devDependencies@ 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! This is most likely a problem with the racecloud-devDependencies 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 racecloud-devDependencies
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls racecloud-devDependencies
npm ERR! There is likely additional logging output above.

@JeffreyWay
Should we also specify minimum node js version in readme.md ?
OR
We can add something like this to package.json

"engines": {
    "node": ">=6.10.1",
    "npm": ">=3.10.10"
  },
  "engineStrict": true,

This way npm will refuse to install laravel-mix if suitable node version is not installed on machine.
Read more about engines here
OR
We can bother Travis-CI to run some tests on different version of node.

P.S.
Node version requirements is already defined in package.json

@Brayantezz
Copy link
Author

i did a fresh installation of laravel updated my node and npm and all worked fine,followed these steps

run composer install;
run npm install;
run npm install cross-env -D (read it from laravel/framework#18446);
run npm run dev.

@JPGITHUB1519
Copy link

JPGITHUB1519 commented Apr 30, 2017

Thanks, it works!. @Brayantezz

@zzzej
Copy link

zzzej commented Jul 10, 2017

Tried @Brayantezz method but didn't worked. I fixed it by requiring webpack in my local package.json file. Even though I had it installed globally.

@dk4210
Copy link

dk4210 commented Jul 13, 2017

@jrmorales can you post a sample of the require in package.json?

@dk4210
Copy link

dk4210 commented Jul 13, 2017

I gotta say @JeffreyWay I found gulp to be way easier. I'm having a hell of a time getting mix to work,

@JeffreyWay
Copy link
Collaborator

@dk4210 Then use Gulp. Or, create a new issue and explain what specifically you're having trouble with. It's almost always related to a faulty install.

@dk4210
Copy link

dk4210 commented Jul 13, 2017

Do you have a tutorial on how to switch to gulp? Forgive me I'm just a beginner.

@dk4210
Copy link

dk4210 commented Jul 13, 2017

@JeffreyWay this is my error and log if that helps.

PS C:\xampp\htdocs\automation_team> npm run dev

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

npm WARN invalid config loglevel="notice"

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

C:\xampp\htdocs\automation_team\node_modules\laravel-mix\setup\webpack.config.js:24
let WebpackConfig = require('../src/builder/WebpackConfig');
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at requireConfig (C:\xampp\htdocs\automation_team\node_modules\webpack\bin\convert-argv.js:97:18)
at C:\xampp\htdocs\automation_team\node_modules\webpack\bin\convert-argv.js:104:17
at Array.forEach (native)
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\name\AppData\Roaming\npm-cache_logs\2017-07-13T15_04_05_713Z-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! C:\Users\name\AppData\Roaming\npm-cache_logs\2017-07-13T15_04_05_745Z-debug.log
PS C:\xampp\htdocs\automation_team>

-----------------------------------Log File ------------------------------------------------------------

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\name\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'dev' ]
2 info using npm@5.2.0
3 info using node@v4.2.6
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle @~predev: @
6 info lifecycle @~dev: @
7 verbose lifecycle @~dev: unsafe-perm in lifecycle true
8 verbose lifecycle @~dev: PATH: C:\Users\name\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\xampp\htdocs\automation_team\node_modules.bin;%SystemRoot%\system32\WindowsPowerShell\v1.0;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn;c:\Program Files\Microsoft SQL Server\100\Tools\Binn;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn;c:\Program Files\Microsoft SQL Server\110\Tools\Binn;c:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn;C:\Program Files (x86)\WinMerge;C:\Program Files\Java\jdk1.7.0_51\bin;D:\work\apache-maven-3.1.1\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\nodejs;C:\xampp\php;D:\work\springsource\spring-roo-1.2.5.RELEASE\bin;C:\ProgramData\ComposerSetup\bin;C:\Program Files\Git\cmd;C:\Users\dkelly-a\AppData\Roaming\Composer\vendor\bin
9 verbose lifecycle @~dev: CWD: C:\xampp\htdocs\automation_team
10 silly lifecycle @~dev: Args: [ '/d /s /c', 'npm run development' ]
11 silly lifecycle @~dev: Returned: code: 1 signal: null
12 info lifecycle @~dev: Failed to exec dev script
13 verbose stack Error: @ dev: npm run development
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Users\name\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:289:16)
13 verbose stack at emitTwo (events.js:87:13)
13 verbose stack at EventEmitter.emit (events.js:172:7)
13 verbose stack at ChildProcess. (C:\Users\name\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
13 verbose stack at emitTwo (events.js:87:13)
13 verbose stack at ChildProcess.emit (events.js:172:7)
13 verbose stack at maybeClose (internal/child_process.js:821:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid @
15 verbose cwd C:\xampp\htdocs\automation_team
16 verbose Windows_NT 6.1.7601
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\name\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "dev"
18 verbose node v4.2.6
19 verbose npm v5.2.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ dev: npm run development
22 error Exit status 1
23 error Failed at the @ dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Thanks,
Dan

@JeffreyWay
Copy link
Collaborator

JeffreyWay commented Jul 13, 2017

Hey, Dan -

Please create a new GitHub issue and fill out the template so that we can help. I can't offer any ideas without knowing what version of Mix you have installed, and what your webpack.mix.js file looks like.

But based on this block-scope error you're seeing here:

let WebpackConfig = require('../src/builder/WebpackConfig');

I'm thinking you have an ancient version of Node installed.

@azimidev
Copy link

azimidev commented Jul 13, 2017

I had this issue i did the following steps and i have no issues anymore:

  1. Delete node_modules directory
  2. Detete package-lock.json file -> very important
  3. Run npm install
  4. Run npm run dev

My details:

npm -v => 5.0.3
node -v => v8.1.4

"laravel-mix": "^1.2.1",
"cross-env": "^5.0.1",
"vue": "^2.4.1",

@dk4210
Copy link

dk4210 commented Jul 13, 2017

Hi @JeffreyWay I think it may be best if I can just convert over to gulp. Everything I've tried wont work. I even followed @hassanazimi instructions but still no luck. I updated my node to version 6.11.1
My npm is 5.2.0
I dont know how to find the Laravel Mix Version. I ran the command npm list --depth=0 but I get a lot of "Missing" errors.

I need to compile my css files but can't.
Thanks,
Dan

@azimidev
Copy link

what error are you getting @dk4210 ? I can see your node version is old.

@dk4210
Copy link

dk4210 commented Jul 13, 2017 via email

@ruchernchong
Copy link
Contributor

You probably need node 8 for some of these new loaders to work.

@kriskornel
Copy link

I got this problem too. My node version is 6.9.1 and npm is 3.10.8 with Windows OS 64-bit.
I reinstall the laravel project and installing the newest using command composer create-project --prefer-dist laravel/laravel myproject.Now, it worked perfectly.

I notice that cross-env is required for running the laravel-mix

@ruchernchong
Copy link
Contributor

@korneliuskristianr

I notice that cross-env is required for running the laravel-mix

Only for Windows so far. Mac and Linux works fine without.

@ghost
Copy link

ghost commented Aug 27, 2017

I had the same issue as @Brayantezz. I updated to the latest node version and it fixed all the problems.

@amylashley
Copy link

It would be super sweet if the Laravel docs had a min version requirement for node/npm. Updating these solved my problem too. Maybe it does and I'm just missing it?

@jebberman
Copy link

@hassanazimi sol'n worked for me. thanks, mate.

@MelMacaluso
Copy link

I had this issue i did the following steps and i have no issues anymore:

  1. Delete node_modules directory
  2. Detete package-lock.json file -> very important
  3. Run npm install
  4. Run npm run dev

My details:

npm -v => 5.0.3
node -v => v8.1.4

"laravel-mix": "^1.2.1",
"cross-env": "^5.0.1",
"vue": "^2.4.1",

Cheers mate, that worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests