1

I recently started to learn Laravel and today I run into an error when setting up my Laravel project (using windows). I tried to find a suitable solution online but none of them works.

Commands:

  • composer create-project laravel/laravel quickstart-v2 --prefer-dist "5.2.*"
  • composer update
  • npm install

Node -V: v12.14.1 npm -V: 7.20.3

Error after running "npm install":

npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: request has been deprecated,
npm ERR! code 1
npm ERR! path C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli   'C:\\xampp\\htdocs\\laravel-project\\quickstart-v2\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "D:\Library\Python\Python27\python.exe" in the PATH
npm ERR! gyp verb `which` failed Error: not found: D:\Library\Python\Python27\python.exe
npm ERR! gyp verb `which` failed     at getNotFoundError (C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
npm ERR! gyp verb `which` failed  D:\Library\Python\Python27\python.exe Error: not found: D:\Library\Python\Python27\python.exe
npm ERR! gyp verb `which` failed     at getNotFoundError (C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21) {
npm ERR! gyp verb `which` failed   stack: 'Error: not found: D:\\Library\\Python\\Python27\\python.exe\n' +
npm ERR! gyp verb `which` failed     '    at getNotFoundError (C:\\xampp\\htdocs\\laravel-project\\quickstart-v2\\node_modules\\which\\which.js:13:12)\n' +
npm ERR! gyp verb `which` failed     '    at F (C:\\xampp\\htdocs\\laravel-project\\quickstart-v2\\node_modules\\which\\which.js:68:19)\n' +
npm ERR! gyp verb `which` failed     '    at E (C:\\xampp\\htdocs\\laravel-project\\quickstart-v2\\node_modules\\which\\which.js:80:29)\n' +
npm ERR! gyp verb `which` failed     '    at C:\\xampp\\htdocs\\laravel-project\\quickstart-v2\\node_modules\\which\\which.js:89:16\n' +
npm ERR! gyp verb `which` failed     '    at C:\\xampp\\htdocs\\laravel-project\\quickstart-v2\\node_modules\\isexe\\index.js:42:5\n' +
npm ERR! gyp verb `which` failed     '    at C:\\xampp\\htdocs\\laravel-project\\quickstart-v2\\node_modules\\isexe\\windows.js:36:5\n' +
npm ERR! gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:158:21)',
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb could not find "D:\Library\Python\Python27\python.exe". checking python launcher
npm ERR! gyp verb could not find "D:\Library\Python\Python27\python.exe". guessing location
npm ERR! gyp verb ensuring that file exists: C:\Python27\python.exe
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "D:\Library\Python\Python27\python.exe", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack     at PythonFinder.failNoPython (C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\node-gyp\lib\configure.js:484:19)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\node-gyp\lib\configure.js:509:16)
npm ERR! gyp ERR! stack     at callback (C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\node-gyp\node_modules\graceful-fs\polyfills.js:299:20)
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:158:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\xampp\\htdocs\\laravel-project\\quickstart-v2\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\xampp\htdocs\laravel-project\quickstart-v2\node_modules\node-sass
npm ERR! gyp ERR! node -v v12.14.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

Any suggestions on how to fix it or how to interpret the error?

Thank you in advance!

Cheers!

3
  • 1
    It seems as if it cannot find a python installation on your computer. Do you have python installed? Check this out, if you have it installed, but it some directory where npm isnt looking for it stackoverflow.com/questions/34372618/… Commented Aug 5, 2021 at 8:29
  • Are you sure you installed python and set the ENV variable correctly? Btw. why are you using laravel 5.2? Commented Aug 5, 2021 at 8:29
  • 1
    I would recommend to learn Laravel with the latest version (8), don't use a older node version like suggested before Commented Aug 5, 2021 at 8:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.