nothingworksinc / ticketbeast

Back to the lesson videos:
https://course.testdrivenlaravel.com/lessons
552 stars 11 forks source link

having problems with node-sass #91

Open nikocraft opened 6 years ago

nikocraft commented 6 years ago

I just bought the course, first run composer install and then tried to run yarn to get all the necessary javascript stuff. I end up with the error below. How do I get around it? Has anyone else had this? Do I actually need to run yarn to get javascript stuff or is that not required to complete the course? I'm not sure since the author does not mention these steps, I am doing what I normally do with laravel application.

yarn_fail

[4/4] Building fresh packages... [1/1] ⠈ node-sass: checking for Python executable "python2" in the PATH [-/1] ⠈ waiting... [-/1] ⠈ waiting... [-/1] ⠈ waiting... error C:\laragon\www\ticketlearn\node_modules\node-sass: Command failed. Exit code: 1 Command: node scripts/build.js Arguments: Directory: C:\laragon\www\ticketlearn\node_modules\node-sass Output: Building: C:\laragon\bin\nodejs\node-v8\node.exe C:\laragon\www\ticketlearn\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library= gyp info it worked if it ends with ok gyp verb cli [ 'C:\laragon\bin\nodejs\node-v8\node.exe', gyp verb cli 'C:\laragon\www\ticketlearn\node_modules\node-gyp\bin\node-gyp.js', gyp verb cli 'rebuild', gyp verb cli '--verbose', gyp verb cli '--libsass_ext=', gyp verb cli '--libsass_cflags=', gyp verb cli '--libsass_ldflags=', gyp verb cli '--libsass_library=' ] gyp info using node-gyp@3.4.0 gyp info using node@8.9.1 | win32 | x64 gyp verb command rebuild [] gyp verb command clean [] gyp verb clean removing "build" directory gyp verb command configure [] gyp verb check python checking for Python executable "python2" in the PATH gyp verb which failed Error: not found: python2 gyp verb which failed at getNotFoundError (C:\laragon\www\ticketlearn\node_modules\which\which.js:14:12) gyp verb which failed at F (C:\laragon\www\ticketlearn\node_modules\which\which.js:69:19) gyp verb which failed at E (C:\laragon\www\ticketlearn\node_modules\which\which.js:81:29) gyp verb which failed at C:\laragon\www\ticketlearn\node_modules\which\which.js:90:16 gyp verb which failed at C:\laragon\www\ticketlearn\node_modules\isexe\index.js:44:5 gyp verb which failed at C:\laragon\www\ticketlearn\node_modules\isexe\windows.js:29:5 gyp verb which failed at FSReqWrap.oncomplete (fs.js:152:21) gyp verb which failed python2 { Error: not found: python2 gyp verb which failed at getNotFoundError (C:\laragon\www\ticketlearn\node_modules\which\which.js:14:12) gyp verb which failed at F (C:\laragon\www\ticketlearn\node_modules\which\which.js:69:19) gyp verb which failed at E (C:\laragon\www\ticketlearn\node_modules\which\which.js:81:29) gyp verb which failed at C:\laragon\www\ticketlearn\node_modules\which\which.js:90:16 gyp verb which failed at C:\laragon\www\ticketlearn\node_modules\isexe\index.js:44:5 gyp verb which failed at C:\laragon\www\ticketlearn\node_modules\isexe\windows.js:29:5 gyp verb which failed at FSReqWrap.oncomplete (fs.js:152:21) code: 'ENOENT' } gyp verb check python checking for Python executable "python" in the PATH gyp verb which failed Error: not found: python gyp verb which failed at getNotFoundError (C:\laragon\www\ticketlearn\node_modules\which\which.js:14:12) gyp verb which failed at F (C:\laragon\www\ticketlearn\node_modules\which\which.js:69:19) gyp verb which failed at E (C:\laragon\www\ticketlearn\node_modules\which\which.js:81:29) gyp verb which failed at C:\laragon\www\ticketlearn\node_modules\which\which.js:90:16 gyp verb which failed at C:\laragon\www\ticketlearn\node_modules\isexe\index.js:44:5 gyp verb which failed at C:\laragon\www\ticketlearn\node_modules\isexe\windows.js:29:5 gyp verb which failed at FSReqWrap.oncomplete (fs.js:152:21) gyp verb which failed python { Error: not found: python gyp verb which failed at getNotFoundError (C:\laragon\www\ticketlearn\node_modules\which\which.js:14:12) gyp verb which failed at F (C:\laragon\www\ticketlearn\node_modules\which\which.js:69:19) gyp verb which failed at E (C:\laragon\www\ticketlearn\node_modules\which\which.js:81:29) gyp verb which failed at C:\laragon\www\ticketlearn\node_modules\which\which.js:90:16 gyp verb which failed at C:\laragon\www\ticketlearn\node_modules\isexe\index.js:44:5 gyp verb which failed at C:\laragon\www\ticketlearn\node_modules\isexe\windows.js:29:5 gyp verb which failed at FSReqWrap.oncomplete (fs.js:152:21) code: 'ENOENT' } gyp verb could not find "python". checking python launcher gyp verb could not find "python". guessing location gyp verb ensuring that file exists: C:\Python27\python.exe gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at failNoPython (C:\laragon\www\ticketlearn\node_modules\node-gyp\lib\configure.js:449:14) gyp ERR! stack at C:\laragon\www\ticketlearn\node_modules\node-gyp\lib\configure.js:404:11 gyp ERR! stack at C:\laragon\www\ticketlearn\node_modules\graceful-fs\polyfills.js:264:29 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21) gyp ERR! System Windows_NT 10.0.17134 gyp ERR! command "C:\laragon\bin\nodejs\node-v8\node.exe" "C:\laragon\www\ticketlearn\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd C:\laragon\www\ticketlearn\node_modules\node-sass gyp ERR! node -v v8.9.1

orkhanahmadov commented 6 years ago
gyp verb which failed Error: not found: python2

Do you have Python installed?

nikocraft commented 6 years ago

I do now and still get new errors:

C:\laragon\www\ticketlearn λ yarn yarn install v1.3.2 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@1.0.14: The platform "win32" is incompatible with this module. info "fsevents@1.0.14" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning "laravel-elixir > vinyl-map > bl@0.7.0" has unmet peer dependency "stream-browserify@*". warning "laravel-elixir-vue-2 > sass-loader@4.0.2" has unmet peer dependency "node-sass@^3.4.2". warning "laravel-elixir-vue-2 > sass-loader@4.0.2" has unmet peer dependency "webpack@^1.12.6 || ^2.1.0-beta". [4/4] Building fresh packages... [1/1] ⠄ node-sass: '-Goutput_dir=.' ] [-/1] ⡀ waiting... [-/1] ⡀ waiting... [-/1] ⡀ waiting... error C:\laragon\www\ticketlearn\node_modules\node-sass: Command failed. Exit code: 1 Command: node scripts/build.js Arguments: Directory: C:\laragon\www\ticketlearn\node_modules\node-sass Output: Building: C:\laragon\bin\nodejs\node-v8\node.exe C:\laragon\www\ticketlearn\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library= gyp info it worked if it ends with ok gyp verb cli [ 'C:\laragon\bin\nodejs\node-v8\node.exe', gyp verb cli 'C:\laragon\www\ticketlearn\node_modules\node-gyp\bin\node-gyp.js', gyp verb cli 'rebuild', gyp verb cli '--verbose', gyp verb cli '--libsass_ext=', gyp verb cli '--libsass_cflags=', gyp verb cli '--libsass_ldflags=', gyp verb cli '--libsass_library=' ] gyp info using node-gyp@3.4.0 gyp info using node@8.9.1 | win32 | x64 gyp verb command rebuild [] gyp verb command clean [] gyp verb clean removing "build" directory gyp verb command configure [] gyp verb check python checking for Python executable "python2" in the PATH gyp verb which succeeded python2 C:\Program Files\Python2\python2.EXE gyp verb check python version C:\Program Files\Python2\python2.EXE -c "import platform; print(platform.python_version());" returned: "2.5.2\r\n" gyp verb get node dir no --target version specified, falling back to host node version: 8.9.1 gyp verb command install [ '8.9.1' ] gyp verb install input version string "8.9.1" gyp verb install installing version: 8.9.1 gyp verb install --ensure was passed, so won't reinstall if already installed gyp verb install version is already installed, need to check "installVersion" gyp verb got "installVersion" 9 gyp verb needs "installVersion" 9 gyp verb install version is good gyp verb get node dir target node version installed: 8.9.1 gyp verb build dir attempting to create "build" dir: C:\laragon\www\ticketlearn\node_modules\node-sass\build gyp verb build dir "build" dir needed to be created? C:\laragon\www\ticketlearn\node_modules\node-sass\build gyp verb build/config.gypi creating config file gyp verb build/config.gypi writing out config file: C:\laragon\www\ticketlearn\node_modules\node-sass\build\config.gypi gyp verb config.gypi checking for gypi file: C:\laragon\www\ticketlearn\node_modules\node-sass\config.gypi gyp verb common.gypi checking for gypi file: C:\laragon\www\ticketlearn\node_modules\node-sass\common.gypi gyp verb gyp gyp format was not specified; forcing "msvs" gyp info spawn C:\Program Files\Python2\python2.EXE gyp info spawn args [ 'C:\laragon\www\ticketlearn\node_modules\node-gyp\gyp\gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'msvs', gyp info spawn args '-G', gyp info spawn args 'msvs_version=auto', gyp info spawn args '-I', gyp info spawn args 'C:\laragon\www\ticketlearn\node_modules\node-sass\build\config.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\laragon\www\ticketlearn\node_modules\node-gyp\addon.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\Users\maxnb\.node-gyp\8.9.1\include\node\common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=C:\Users\maxnb\.node-gyp\8.9.1', gyp info spawn args '-Dnode_gyp_dir=C:\laragon\www\ticketlearn\node_modules\node-gyp', gyp info spawn args '-Dnode_lib_file=node.lib', gyp info spawn args '-Dmodule_root_dir=C:\laragon\www\ticketlearn\node_modules\node-sass', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'C:\laragon\www\ticketlearn\node_modules\node-sass\build', gyp info spawn args '-Goutput_dir=.' ] Traceback (most recent call last): File "C:\laragon\www\ticketlearn\node_modules\node-gyp\gyp\gyp_main.py", line 13, in import gyp File "C:\laragon\www\ticketlearn\node_modules\node-gyp\gyp\pylib\gyp__init__.py", line 8, in import gyp.input File "C:\laragon\www\ticketlearn\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 888 except ImportError as e: ^ SyntaxError: invalid syntax gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (C:\laragon\www\ticketlearn\node_modules\node-gyp\lib\configure.js:305:16) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Windows_NT 10.0.17134 gyp ERR! command "C:\laragon\bin\nodejs\node-v8\node.exe" "C:\laragon\www\ticketlearn\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd C:\laragon\www\ticketlearn\node_modules\node-sass gyp ERR! node -v v8.9.1

nikocraft commented 6 years ago

why do I need python? I got another laravel project and I do not have any problems there to build node-sass. Does this has to do with this project using gulp, since I do not use gulp in my private laravel project, but I use webpack and mix.

EmilMoe commented 6 years ago

And you tried npm rebuild node-sass? that solves 90% of the cases with node-sass

nikocraft commented 6 years ago

@EmilMoe yes that is all good, but I dont think mixing yarn and npm is good. Is there equivalent method I can use with yarn to rebuild node-sass?