能帮我吗?我不明白为什么我打电话给-yarn时会发生这种情况: 不支持节点版本0.10.40,请使用Node.js 4.0或更高版本。 我该如何解决。我使用最新版本的Node 12.16.3和yarn 1.22.4。 也许是因为,当我打电话给-yarn install时,出现了很多错误。
yarn install v1.22.4
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistenci
es caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.7: The platform "win32" is incompatible with this module.
info "fsevents@1.2.7" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > sass-loader@7.3.1" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
[4/4] Building fresh packages...
error ***\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: ***\node-sass
Output:
Building: C:\Program Files\nodejs\node.exe ***\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 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli '***\\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@12.16.3 | 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 (***\which\which.js:13:12)
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:167:21)
gyp verb `which` failed python2 Error: not found: python2
gyp verb `which` failed at getNotFoundError ***\which\which.js:13:12)
gyp verb `which` failed at ***isexe\index.js:42:5
gyp verb `which` failed at ***\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:167: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` succeeded python C:\Users\***\AppData\Local\Programs\Python\Python38-32\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\***\AppData\Local\Programs\Python\Python38-32\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: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:303:12)
gyp ERR! stack at ChildProcess.emit (events.js:310:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "***node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=
" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! ***node_modules\node-sass
gyp ERR! node -v v12.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
答案 0 :(得分:0)
您似乎缺少了正确的Webpack版本。可以安装:
npm install webpack
或
npm install webpack@^4.0.0
您还需要可以从https://www.python.org/downloads/安装的python2
similar problem that was resolved
注意:不再支持python2,所以我想知道是否需要更新其他任何内容。