解决报错:npm ERR! code 1

时间:2025-01-19 08:35:14
npm ERR! code 1
npm ERR! path D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\ /d /s /c node scripts/
npm ERR! Building: D:\3node\ D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\node-gyp\bin\ 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   'D:\\3node\\',
npm ERR! gyp verb cli   'D:\\1taichu\\1-project\\yunnan\\yunnan-yzm\\node_modules\\node-gyp\\bin\\',
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@12.13.1 | win32 | ia32
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 download using dist-url /dist
npm ERR! gyp verb check python checking for Python executable "C:\Users\Acer\Anaconda3\python37" in the PATH
npm ERR! gyp verb `which` failed Error: not found: C:\Users\Acer\Anaconda3\python37
npm ERR! gyp verb `which` failed     at getNotFoundError (D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\which\:13:12)
npm ERR! gyp verb `which` failed     at F (D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\which\:68:19)
npm ERR! gyp verb `which` failed     at E (D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\which\:80:29)
npm ERR! gyp verb `which` failed     at D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\which\:89:16
npm ERR! gyp verb `which` failed     at D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\isexe\:42:5
npm ERR! gyp verb `which` failed     at D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\isexe\:36:5
npm ERR! gyp verb `which` failed     at (:158:21)
npm ERR! gyp verb `which` failed  C:\Users\Acer\Anaconda3\python37 Error: not found: C:\Users\Acer\Anaconda3\python37
npm ERR! gyp verb `which` failed     at getNotFoundError (D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\which\:13:12)
npm ERR! gyp verb `which` failed     at F (D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\which\:68:19)
npm ERR! gyp verb `which` failed     at E (D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\which\:80:29)
npm ERR! gyp verb `which` failed     at D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\which\:89:16
npm ERR! gyp verb `which` failed     at D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\isexe\:42:5
npm ERR! gyp verb `which` failed     at D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\isexe\:36:5
npm ERR! gyp verb `which` failed     at (:158:21) {
npm ERR! gyp verb `which` failed   stack: 'Error: not found: C:\\Users\\Acer\\Anaconda3\\python37\n' +
npm ERR! gyp verb `which` failed     '    at getNotFoundError (D:\\1taichu\\1-project\\yunnan\\yunnan-yzm\\node_modules\\which\\:13:12)\n' +
npm ERR! gyp verb `which` failed     '    at F (D:\\1taichu\\1-project\\yunnan\\yunnan-yzm\\node_modules\\which\\:68:19)\n' +
npm ERR! gyp verb `which` failed     '    at E (D:\\1taichu\\1-project\\yunnan\\yunnan-yzm\\node_modules\\which\\:80:29)\n' +
npm ERR! gyp verb `which` failed     '    at D:\\1taichu\\1-project\\yunnan\\yunnan-yzm\\node_modules\\which\\:89:16\n' +
npm ERR! gyp verb `which` failed     '    at D:\\1taichu\\1-project\\yunnan\\yunnan-yzm\\node_modules\\isexe\\:42:5\n' +
npm ERR! gyp verb `which` failed     '    at D:\\1taichu\\1-project\\yunnan\\yunnan-yzm\\node_modules\\isexe\\:36:5\n' +
npm ERR! gyp verb `which` failed     '    at (:158:21)',
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb could not find "C:\Users\Acer\Anaconda3\python37". checking python launcher
npm ERR! gyp verb could not find "C:\Users\Acer\Anaconda3\python37". guessing location
npm ERR! gyp verb ensuring that file exists: C:\Python27\
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "C:\Users\Acer\Anaconda3\python37", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack     at (D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\node-gyp\lib\:484:19)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\node-gyp\lib\:509:16)
npm ERR! gyp ERR! stack     at callback (D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\graceful-fs\:306:20)
npm ERR! gyp ERR! stack     at (:158:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19045
npm ERR! gyp ERR! command "D:\\3node\\" "D:\\1taichu\\1-project\\yunnan\\yunnan-yzm\\node_modules\\node-gyp\\bin\\" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd D:\1taichu\1-project\yunnan\yunnan-yzm\node_modules\node-sass
npm ERR! gyp ERR! node -v v12.13.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