错误描述:

C:\Users\Y\AppData\Roaming\npm\yarn.cmd install
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "@vue/cli-plugin-unit-mocha > mocha-webpack@2.0.0-beta.0" has unmet peer dependency "webpack@^4.0.0".
warning " > sass-loader@7.1.0" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
[4/4] Building fresh packages...
[-/4] ⠁ waiting...
[2/4] ⠂ yorkie
[-/4] ⠂ waiting...
error D:\code\tiku-develop\source\front-end\tiku\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments: 
Directory: D:\code\tiku-develop\source\front-end\tiku\node_modules\node-sass
Output:
Building: C:\Program Files\nodejs\node.exe D:\code\tiku-develop\source\front-end\tiku\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:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'D:\\code\\tiku-develop\\source\\front-end\\tiku\\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.8.0
gyp info using node@10.24.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:\code\tiku-develop\source\front-end\tiku\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\code\tiku-develop\source\front-end\tiku\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\code\tiku-develop\source\front-end\tiku\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\code\tiku-develop\source\front-end\tiku\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\code\tiku-develop\source\front-end\tiku\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\code\tiku-develop\source\front-end\tiku\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:153:21)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (D:\code\tiku-develop\source\front-end\tiku\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\code\tiku-develop\source\front-end\tiku\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\code\tiku-develop\source\front-end\tiku\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\code\tiku-develop\source\front-end\tiku\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\code\tiku-develop\source\front-end\tiku\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\code\tiku-develop\source\front-end\tiku\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:153:21)
gyp verb `which` failed   stack:
gyp verb `which` failed    'Error: not found: python2\n    at getNotFoundError (D:\\code\\tiku-develop\\source\\front-end\\tiku\\node_modules\\which\\which.js:13:12)\n    at F (D:\\code\\tiku-develop\\source\\front-end\\tiku\\node_modules\\which\\which.js:68:19)\n    at E (D
:\\code\\tiku-develop\\source\\front-end\\tiku\\node_modules\\which\\which.js:80:29)\n    at D:\\code\\tiku-develop\\source\\front-end\\tiku\\node_modules\\which\\which.js:89:16\n    at D:\\code\\tiku-develop\\source\\front-end\\tiku\\node_modules\\isexe\\index.js:42:5\n    at D:\\code\\tiku-develop\\source\\front-end\\tiku\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:153:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Users\Y\AppData\Local\Programs\Python\Python311\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\Y\AppData\Local\Programs\Python\Python311\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:294:12)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Windows_NT 10.0.22621
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\code\\tiku-develop\\source\\front-end\\tiku\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\code\tiku-develop\source\front-end\tiku\node_modules\node-sass
gyp ERR! node -v v10.24.1
gyp ERR! node-gyp -v v3.8.0
                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                   

进程已结束,退出代码为 1

yarn install命令出错,原因是node-sass版本与node版本不对应

nvm 切换了版本但是jenkins_Python

通过安装nvm管理node版本

使用nvm对node版本进行管理和切换

安装 nvm-window github.com/coreybutler…,win10默认添加系统环境和用户环境,若命令行不能使用nvm,需自行添加环境

使用镜像
在 nvm 的安装目录下找到settings.txt文件

通过nvm 安装和使用 node.js
在 nvm 通过 install 命令安装不同版本的 node.js,比如要安装 12.1.0 版本的 node.js:

nvm install 12.1.0

切换到某个版本可以使用 use 命令,如:

nvm use 12.1.0

切换完毕后,可以输入 node -v 和 npm -v,可以看到版本已经切换成要使用的版本。

其他更多nvm命令

nvm arch [32|64]: 显示node是运行在32位还是64位模式。指定32或64来覆盖默认体系结构。
-nvm install [arch]:该可以是node.js版本或最新稳定版本latest。(可选[arch])指定安装32位或64位版本(默认为系统arch)。设置[arch]为all以安装32和64位版本。在命令后面添加–insecure,可以绕过远端下载服务器的SSL验证。
nvm list [available]:列出已经安装的node.js版本。可选的available,显示可下载版本的部分列表。这个命令可以简写为nvm ls [available]。
nvm on: 启用node.js版本管理。
nvm off: 禁用node.js版本管理(不卸载任何东西)
nvm proxy [url]: 设置用于下载的代理。留[url]空白,以查看当前的代理。设置[url]为none删除代理。
nvm node_mirror [url]:设置node镜像,默认为https://nodejs.org/dist/.。可以设置为淘宝的镜像https://npm.taobao.org/mirrors/node/
nvm npm_mirror [url]:设置npm镜像,默认为https://github.com/npm/npm/archive/。可以设置为淘宝的镜像https://npm.taobao.org/mirrors/npm/
nvm uninstall : 卸载指定版本的nodejs。
nvm use [version] [arch]: 切换到使用指定的nodejs版本。可以指定32/64位[arch]。
-nvm use :将继续使用所选版本,但根据提供的值切换到32/64位模式
nvm root [path]: 设置 nvm 存储node.js不同版本的目录 ,如果未设置,将使用当前目录。
-nvm version: 显示当前运行的nvm版本,可以简写为nvm v
se :将继续使用所选版本,但根据提供的值切换到32/64位模式
nvm root [path]: 设置 nvm 存储node.js不同版本的目录 ,如果未设置,将使用当前目录。
-nvm version: 显示当前运行的nvm版本,可以简写为nvm v