0

I tried installing SASS, I tried reinstalling Node, I tried NPM install globally.

I made this project a few months ago. I cloned it from GitHub and it seems to be okay as far as that goes.

I also keep getting this error when trying to npm start the application:

'react-scripts' is not recognized as an internal or external command, operable program or batch file.
npm ERR! code 1
npm ERR! path C:\Users\Dylan\Documents\ALL CODE\national-parks\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:\Users\Dylan\Documents\ALL CODE\national-parks\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:\\Users\\Dylan\\Documents\\ALL CODE\\national-parks\\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 node-gyp@3.8.0
npm ERR! gyp info using node@16.15.1 | 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 "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed  python2 Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python
npm ERR! gyp verb `which` failed     at getNotFoundError (C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed  python Error: not found: python
npm ERR! gyp verb `which` failed     at getNotFoundError (C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb could not find "python". checking python launcher
npm ERR! gyp verb could not find "python". 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 "python", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\node-gyp\lib\configure.js:484:19)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\node-gyp\lib\configure.js:509:16)
npm ERR! gyp ERR! stack     at callback (C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\graceful-fs\polyfills.js:299:20)
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Dylan\\Documents\\ALL CODE\\national-parks\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\Users\Dylan\Documents\ALL CODE\national-parks\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.15.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

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Dylan\AppData\Local\npm-cache\_logs\2022-10-04T19_51_13_932Z-debug-0.log
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437

1 Answers1

-1

You can follow the pointers in the npm error log. It tells you that python is not found on your system. Try to install python2 (see the EOL release https://www.python.org/downloads/release/python-2718/), then see what npm tells you.

cmc
  • 44
  • 1
  • 8
  • Not a good solution - the Node-sass package is deprecated and shouldn't be used. – AKX Oct 04 '22 at 20:20
  • please feel free to share a better one. edit: when I saw the comment, there was some gibberish. Well I think the question is how to get the project running, not which deprecated packages to replace. especially when they're struggling with following the instruction on npm error log, replacing dependencies might be a little much to ask – cmc Oct 04 '22 at 20:20
  • I did, in the comment to the question. – AKX Oct 04 '22 at 20:21
  • 1
    if we're going that route, how about telling them that python2 is EOL? i think that the question is "how do i get that code that I cloned running", not "how can I improve it by replacing deprecated dependencies". but I might have misunderstood. – cmc Oct 04 '22 at 20:25
  • Installed Python2 but still nothing. Also still showing the same errors as far as Python not being found and npm install failing. – Dylan Guidry Oct 04 '22 at 20:38
  • Did you add python to $PATH? See this question: https://stackoverflow.com/questions/6318156/adding-python-to-path-on-windows If you have, you might want to reopen the terminal or reboot – cmc Oct 04 '22 at 20:44
  • @cmc The point is OP wouldn't have needed to install python2 at all in this case. We can assume by the presence of React-scripts that either node-sass or sass is required by its (Webpack's) scss loader, so just removing the node-sass dep and installing sass instead would likely have done the trick. – AKX Oct 04 '22 at 21:00
  • well then please go ahead and tell them how – cmc Oct 06 '22 at 08:10