Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M2 yarn install failed? #3002

Closed
xieyezi opened this issue Mar 25, 2024 · 4 comments
Closed

M2 yarn install failed? #3002

xieyezi opened this issue Mar 25, 2024 · 4 comments

Comments

@xieyezi
Copy link

xieyezi commented Mar 25, 2024

  • Node Version:
    v18.19.1

  • Platform:
    Model Name: MacBook Air
    Model Identifier: Mac14,15
    Chip: Apple M2
    Total Number of Cores: 8 (4 performance and 4 efficiency)
    Memory: 24 GB
    System Firmware Version: 10151.1.1
    OS Loader Version: 10151.1.1

  • Compiler:
    xcode-select: note: No developer tools were found, requesting install.

  • Module:

yarn install
Verbose output (from npm or node-gyp):
(base) ➜  pietra-landing-pages git:(master) yarn
yarn install v1.22.21
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > [email protected]" has incorrect peer dependency "react@^16.8 || 17".
warning " > [email protected]" has unmet peer dependency "redux@>4.0.0".
warning " > [email protected]" has unmet peer dependency "jquery@>=1.8.0".
warning " > @graphql-codegen/[email protected]" has unmet peer dependency "graphql-tag@^2.0.0".
warning "graphql-cli > [email protected]" has incorrect peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
warning "graphql-cli > @graphql-cli/common > @graphql-tools/[email protected]" has incorrect peer dependency "graphql@^14.0.0 || ^15.0.0".
warning "graphql-cli > graphql-config > @graphql-tools/[email protected]" has incorrect peer dependency "graphql@^14.0.0 || ^15.0.0".
warning "graphql-cli > graphql-config > @graphql-tools/[email protected]" has incorrect peer dependency "graphql@^14.0.0 || ^15.0.0".
warning "graphql-cli > graphql-config > @graphql-tools/[email protected]" has incorrect peer dependency "graphql@^14.0.0 || ^15.0.0".
warning "graphql-cli > graphql-config > @graphql-tools/[email protected]" has incorrect peer dependency "graphql@^14.0.0 || ^15.0.0".
warning "graphql-cli > graphql-config > @graphql-tools/[email protected]" has incorrect peer dependency "graphql@^14.0.0 || ^15.0.0".
warning "graphql-cli > graphql-config > @graphql-tools/[email protected]" has incorrect peer dependency "graphql@^14.0.0 || ^15.0.0".
warning "graphql-cli > graphql-config > @graphql-tools/graphql-file-loader > @graphql-tools/[email protected]" has incorrect peer dependency "graphql@^14.0.0 || ^15.0.0".
warning "graphql-cli > graphql-config > @graphql-tools/merge > @graphql-tools/[email protected]" has incorrect peer dependency "graphql@^14.0.0 || ^15.0.0".
warning "graphql-cli > graphql-config > @graphql-tools/url-loader > @graphql-tools/[email protected]" has incorrect peer dependency "graphql@^14.0.0 || ^15.0.0".
warning "graphql-cli > graphql-config > @graphql-tools/url-loader > @graphql-tools/[email protected]" has incorrect peer dependency "graphql@^14.0.0 || ^15.0.0".
warning "graphql-cli > graphql-config > @graphql-tools/url-loader > [email protected]" has incorrect peer dependency "graphql@>=0.11 <=15".
warning "graphql-cli > graphql-config > @graphql-tools/url-loader > @graphql-tools/delegate > @graphql-tools/[email protected]" has incorrect peer dependency "graphql@^14.0.0 || ^15.0.0".
warning "graphql-cli > graphql-config > @graphql-tools/url-loader > @graphql-tools/delegate > @graphql-tools/[email protected]" has incorrect peer dependency "graphql@^14.0.0 || ^15.0.0".
warning " > [email protected]" has unmet peer dependency "webpack@^5.0.0".
[4/4] 🔨  Building fresh packages...
[1/2] ⠂ isolated-vm
error /Users/xieyezi/parsec/piretra/pietra-landing-pages/node_modules/isolated-vm: Command failed.
Exit code: 1
Command: prebuild-install || (node-gyp rebuild --release -j max && node-gyp clean)
Arguments: 
Directory: /Users/xieyezi/parsec/piretra/pietra-landing-pages/node_modules/isolated-vm
Output:
prebuild-install warn install No prebuilt binaries found (target=18.19.1 runtime=node arch=arm64 libc= platform=darwin)
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info find Python using Python version 3.12.2 found at "/opt/homebrew/opt/[email protected]/bin/python3.12"

gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.12
gyp info spawn args [
gyp info spawn args '/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/xieyezi/parsec/piretra/pietra-landing-pages/node_modules/isolated-vm/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/xieyezi/Library/Caches/node-gyp/18.19.1/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/xieyezi/Library/Caches/node-gyp/18.19.1',
gyp info spawn args '-Dnode_gyp_dir=/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/xieyezi/Library/Caches/node-gyp/18.19.1/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/xieyezi/parsec/piretra/pietra-landing-pages/node_modules/isolated-vm',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

Traceback (most recent call last):
  File "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1496, in XcodeVersion
    version_list = GetStdoutQuiet(["xcodebuild", "-version"]).splitlines()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1557, in GetStdoutQuiet
    raise GypError("Error %d running %s" % (job.returncode, cmdlist[0]))
gyp.common.GypError: Error 1 running xcodebuild

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 45, in <module>
    sys.exit(gyp.script_main())
             ^^^^^^^^^^^^^^^^^
  File "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 688, in script_main
    return main(sys.argv[1:])
           ^^^^^^^^^^^^^^^^^^
  File "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 680, in main
    return gyp_main(args)
           ^^^^^^^^^^^^^^
  File "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 665, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2648, in GenerateOutput
    writer.Write(
  File "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 899, in Write
    self.WriteCopies(spec["copies"], extra_outputs, part_of_all)
  File "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1295, in WriteCopies
    env = self.GetSortedXcodeEnv()
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2266, in GetSortedXcodeEnv
    return gyp.xcode_emulation.GetSortedXcodeEnv(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1882, in GetSortedXcodeEnv
    env = _GetXcodeEnv(
          ^^^^^^^^^^^^^
  File "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1737, in _GetXcodeEnv
    "XCODE_VERSION_ACTUAL": XcodeVersion()[0],
                            ^^^^^^^^^^^^^^
  File "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1507, in XcodeVersion
    version = CLTVersion()  # macOS Catalina returns 11.0.0.0.1.1567737322
              ^^^^^^^^^^^^
  File "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1545, in CLTVersion
    return re.search(regex, output).groupdict()["version"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'groupdict'
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.<anonymous> (/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:271:18)
gyp ERR! stack at ChildProcess.emit (node:events:517:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:292:12)
gyp ERR! System Darwin 23.0.0
gyp ERR! command "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/bin/node" "/Users/xieyezi/Library/Application Support/fnm/node-versions/v18.19.1/installation/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release" "-j" "max"
gyp ERR! cwd /Users/xieyezi/parsec/piretra/pietra-landing-pages/node_modules/isolated-vm
gyp ERR! node -v v18.19.1
gyp ERR! node-gyp -v v10.0.1
gyp ERR! not ok

@xieyezi
Copy link
Author

xieyezi commented Mar 25, 2024

I have confirmed that I have executed commands like "rm -rf node_modules," "yarn cache clean," deleted "yarn.lock," and re-executed "yarn install," but I still encounter this issue.

@cclauss
Copy link
Contributor

cclauss commented Mar 25, 2024

xcode-select: note: No developer tools were found, requesting install.

Install them as discussed in README.md.

@xieyezi
Copy link
Author

xieyezi commented Mar 25, 2024

I have already solved this issue, but I am not sure exactly how I did it. Here are the steps I took:

  1. Deleted node_modules.
  2. run yarn cache clean.
  3. Switched to a higher version of Node, such as 21.4.0.
  4. Reinstalled Python via brew.
  5. Reinstalled Xcode command line tools.
  6. Updated node-gyp as per the instructions in the node-gyp documentation: https://github.com/nodejs/node-gyp/blob/main/docs/Updating-npm-bundled-node-gyp.md.
  7. run yarn install

@xieyezi xieyezi closed this as completed Mar 25, 2024
@cclauss
Copy link
Contributor

cclauss commented Mar 25, 2024

Step 5 was the key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants