leo108 / php_cas_server

PHP CAS Server
MIT License
219 stars 47 forks source link

Error in helpers.php when installing on Windows ampps #23

Closed Ezyweb-uk closed 5 years ago

Ezyweb-uk commented 5 years ago

I'm trying to install php_cas_server on ampps on Windows 10, but http://my-local-domain/cas/login gives the following error:

ErrorException in helpers.php line 343: file_get_contents(D:\www\phpcasserver\public\build/rev-manifest.json): failed to open stream: No such file or directory (View: D:\www\phpcasserver\resources\views\layouts\app.blade.php)

I've installed Python 2.7 and I've run the following commands to install other components:

npm install --no-bin-links
npm audit fix
npm install -g --production windows-build-tools
npm install gulp --global
npm install node-sass@latest
npm install laravel-elixir --save-dev

npm install --no-bin-links outputs npm WARN acorn-dynamic-import@4.0.0 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.

Also tried npm i -g gulp-cli but I'm still stuck with the missing rev-manifest.json error. Any ideas please?

leo108 commented 5 years ago

you have to run npm run prod after you have installed gulp-cli

Ezyweb-uk commented 5 years ago

Thank you for your guidance, it's much appreciated! I've checked that gulp-cli is already installed, gulp -v returns the following:

CLI version 2.0.1
Local version 4.0.0

npm -v shows 6.4.1 node -v shows v8.12.0

I have now run npm install --production and the exact output is:

npm WARN acorn-dynamic-import@4.0.0 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.

audited 17910 packages in 13.682s found 7 vulnerabilities (4 moderate, 2 high, 1 critical) run npm audit fix to fix them, or npm audit for details

When I navigate to http://phpcasserver.local/cas/login which is a local ampps server address I get the same ErrorException in helpers.php (I tested in Chrome and Firefox in case it was a browser cache issue).

leo108 commented 5 years ago

you need to run npm run prod instead of npm install --production

Ezyweb-uk commented 5 years ago

Thank you again, and for a helpful reply so soon! I've run that command and got the following output.

npm run prod

> @ prod D:\www\phpcasserver
> gulp --production

[13:28:28] Using gulpfile D:\www\phpcasserver\gulpfile.js
[13:28:28] Starting 'default'...
[13:28:28] 'default' errored after 3.43 ms
[13:28:28] TypeError: gulp.hasTask is not a function
    at D:\www\phpcasserver\node_modules\run-sequence\index.js:19:22
    at Array.forEach (<anonymous>)
    at verifyTaskSets (D:\www\phpcasserver\node_modules\run-sequence\index.js:13:11)
    at runSequence (D:\www\phpcasserver\node_modules\run-sequence\index.js:92:2)
    at D:\www\phpcasserver\node_modules\laravel-elixir\tasks\default.js:18:16
    at taskWrapper (D:\www\phpcasserver\node_modules\undertaker\lib\set-task.js:13:15)
    at bound (domain.js:301:14)
    at runBound (domain.js:314:12)
    at asyncRunner (D:\www\phpcasserver\node_modules\async-done\index.js:55:18)
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ prod: `gulp --production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ prod 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\nick\AppData\Roaming\npm-cache\_logs\2018-11-01T13_28_28_838Z-debug.log

So I'm getting the following errors: TypeError: gulp.hasTask is not a function and error code ELIFECYCLE. The log file is below. 2018-11-01T13_28_28_838Z-debug.log

This SO article says that gulp 4.0.0 introduced breaking changes and suggests installing gulp 3.9.1.

Ezyweb-uk commented 5 years ago

Installing gulp 3.9.1 instead of 4.0.0 fixed the error in helpers.php and now the login page loads!

I ran npm install --save-dev gulp@3.9.1 followed by npm run prod and, although multiple errors relating to toast.exe were reported, this app now works.

Thanks for your help Leo!

ctenot-sekrata commented 4 years ago

hi did you solve the issue. I have follow the same process and I still have the issue

running "npm install --save-dev gulp@3.9.1" I have the follow output:

npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5 npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.

11 packages are looking for funding run npm fund for details

found 13 vulnerabilities (3 low, 2 moderate, 8 high) run npm audit fix to fix them, or npm audit for details

already try npm audit fix => not working

but at the end the webpage, I have the helpers.php error I m on Mac OS with MAMP

Many thanks in advance for your help Chris