报错中出现了pathon问题,gyp verb check python在PATH中检查python可执行文件"python"
gyp verb check python checking for Python executable "python" in the PATH
实际上与pathon关系不大,最主要的是以下代码:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.13.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.13.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
即node和sass版本不匹配的问题,只要修改node与sass在同一版本或者修改sass与node版本保持一致即可。
建议修改node版本使用nvm,可以管理多个node版本问题,方便node版本之间的切换
报错源数据:
Building: D:\Front-end learning\Node.js\node\node.exe D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\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 [
gyp verb cli 'D:\\Front-end learning\\Node.js\\node\\node.exe',
gyp verb cli 'D:\\2022-2023\\SSM_Spring boot_Vue\\前端课程设计\\vhr\\vuehr\\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 verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@14.15.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 (D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\which\which.js:80:29)
gyp verb `which` failed at D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\which\which.js:89:16
gyp verb `which` failed at D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\isexe\index.js:42:5
gyp verb `which` failed at D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:183:21)
gyp verb `which` failed python2 Error: not found: python2
gyp verb `which` failed at getNotFoundError (D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\which\which.js:80:29)
gyp verb `which` failed at D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\which\which.js:89:16
gyp verb `which` failed at D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\isexe\index.js:42:5
gyp verb `which` failed at D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:183:21) {
gyp verb `which` failed code: 'ENOENT'
gyp verb `which` failed }
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 (D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\which\which.js:80:29)
gyp verb `which` failed at D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\which\which.js:89:16
gyp verb `which` failed at D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\isexe\index.js:42:5
gyp verb `which` failed at D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:183:21)
gyp verb `which` failed python Error: not found: python
gyp ERR! System Windows_NT 10.0.22000
gyp ERR! command "D:\\Front-end learning\\Node.js\\node\\node.exe" "D:\\2022-2023\\SSM_Spring boot_Vue\\前端课程设计\\vhr\\vuehr\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\2022-2023\SSM_Spring boot_Vue\前端课程设计\vhr\vuehr\node_modules\node-sass
gyp ERR! node -v v14.15.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.13.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.13.0 postinstall 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\ZhuangZzi\AppData\Roaming\npm-cache\_logs\2023-06-09T12_22_39_166Z-debug.log