LoginSignup
1
1

More than 5 years have passed since last update.

yarn install でハマった

Last updated at Posted at 2019-03-24

yarn installしたらエラーになりました。
結論としては、Webpackfseventsがnode.jsの古いバージョンに依存しているので、node.jsのバージョンを11.9.0から10.15.1にしたらインストールできました。

user_name-Mac:app_name user_name$ yarn install
yarn install v1.13.0
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "@rails/webpacker > postcss-cssnext@3.1.0" has unmet peer dependency "caniuse-lite@^1.0.30000697".
warning " > webpack-dev-server@2.11.2" has unmet peer dependency "webpack@^2.2.0 || ^3.0.0".
warning "webpack-dev-server > webpack-dev-middleware@1.12.2" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0".
[4/4] 🔨  Building fresh packages...
[-/3] ⠁ waiting...
[2/3] ⠁ fsevents
warning Error running install script for optional dependency: "/Users/user_name/Projects/app_name/node_modules/fsevents: Command failed.
Exit code: 1
Command: node install
Arguments: 
Directory: /Users/user_name/Projects/app_name/node_modules/fsevents
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.10.0
node-pre-gyp info using node@11.9.0 | darwin | x64
node-pre-gyp info check checked for \"/Users/user_name/Projects/app_name/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node\" (not found)
node-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.4/fse-v1.2.4-node-v67-darwin-x64.tar.gz
node-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.4/fse-v1.2.4-node-v67-darwin-x64.tar.gz
node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.4/fse-v1.2.4-node-v67-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for fsevents@1.2.4 and node@11.9.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp http 404 status code downloading tarball https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.4/fse-v1.2.4-node-v67-darwin-x64.tar.gz 
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@11.9.0 | darwin | x64
gyp info ok 
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@11.9.0 | darwin | x64
gyp info spawn /usr/bin/python
gyp info spawn args [ '/Users/user_name/Projects/app_name/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/user_name/Projects/app_name/node_modules/fsevents/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/user_name/Projects/app_name/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/user_name/.node-gyp/11.9.0/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/user_name/.node-gyp/11.9.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/user_name/Projects/app_name/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/user_name/.node-gyp/11.9.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/user_name/Projects/app_name/node_modules/fsevents',
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=.' ]
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Traceback (most recent call last):
  File \"/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/gyp_main.py\", line 16, in <module>
    sys.exit(gyp.script_main())
  File \"/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/__init__.py\", line 545, in script_main
    return main(sys.argv[1:])
  File \"/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/__init__.py\", line 538, in main
    return gyp_main(args)
  File \"/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/__init__.py\", line 523, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File \"/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py\", line 2170, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File \"/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py\", line 795, in Write
    self.Pchify))
  File \"/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py\", line 1190, in WriteSources
    cflags = self.xcode_settings.GetCflags(configname)
  File \"/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py\", line 551, in GetCflags
    archs = self.GetActiveArchs(self.configname)
  File \"/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py\", line 420, in GetActiveArchs
    xcode_archs_default = GetXcodeArchsDefault()
  File \"/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py\", line 118, in GetXcodeArchsDefault
    xcode_version, _ = XcodeVersion()
  File \"/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py\", line 1265, in XcodeVersion
    version = re.match(r'(\\d\\.\\d\\.?\\d*)', version).groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/user_name/Projects/app_name/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Darwin 17.7.0
gyp ERR! command \"/usr/local/Cellar/node/11.9.0/bin/node\" \"/Users/user_name/Projects/app_name/node_modules/node-gyp/bin/node-gyp.js\" \"configure\" \"--fallback-to-build\" \"--module=/Users/user_name/Projects/app_name/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node\" \"--module_name=fse\" \"--module_path=/Users/user_name/Projects/app_name/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64\" \"--napi_version=4\" \"--node_abi_napi=napi\" \"--python=/usr/bin/python\"
gyp ERR! cwd /Users/user_name/Projects/app_name/node_modules/fsevents
gyp ERR! node -v v11.9.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/11.9.0/bin/node /Users/user_name/Projects/app_name/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/user_name/Projects/app_name/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node --module_name=fse --module_path=/Users/user_name/Projects/app_name/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64 --napi_version=4 --node_abi_napi=napi --python=/usr/bin/python' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/user_name/Projects/app_name/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:978:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
node-pre-gyp ERR! System Darwin 17.7.0
node-pre-gyp ERR! command \"/usr/local/Cellar/node/11.9.0/bin/node\" \"/Users/user_name/Projects/app_name/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"
node-pre-gyp ERR! cwd /Users/user_name/Projects/app_name/node_modules/fsevents
node-pre-gyp ERR! node -v v11.9.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/Cellar/node/11.9.0/bin/node /Users/user_name/Projects/app_name/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/user_name/Projects/app_name/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node --module_name=fse --module_path=/Users/user_name/Projects/app_name/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64 --napi_version=4 --node_abi_napi=napi --python=/usr/bin/pyt[-/3] ⠐ waiting...
[-/3] ⠐ waiting...
error /Users/user_name/Projects/app_name/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments: 
Directory: /Users/user_name/Projects/app_name/node_modules/node-sass
Output:
Building: /usr/local/Cellar/node/11.9.0/bin/node /Users/user_name/Projects/app_name/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 [ '/usr/local/Cellar/node/11.9.0/bin/node',
gyp verb cli   '/Users/user_name/Projects/app_name/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.6.2
gyp info using node@11.9.0 | darwin | 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 "/usr/bin/python" in the PATH
gyp verb `which` succeeded /usr/bin/python /usr/bin/python
gyp verb check python version `/usr/bin/python -c "import platform; print(platform.python_version());"` returned: "2.7.10\n"
gyp verb get node dir no --target version specified, falling back to host node version: 11.9.0
gyp verb command install [ '11.9.0' ]
gyp verb install input version string "11.9.0"
gyp verb install installing version: 11.9.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 11.9.0
gyp verb build dir attempting to create "build" dir: /Users/user_name/Projects/app_name/node_modules/node-sass/build
gyp verb build dir "build" dir needed to be created? /Users/user_name/Projects/app_name/node_modules/node-sass/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /Users/user_name/Projects/app_name/node_modules/node-sass/build/config.gypi
gyp verb config.gypi checking for gypi file: /Users/user_name/Projects/app_name/node_modules/node-sass/config.gypi
gyp verb common.gypi checking for gypi file: /Users/user_name/Projects/app_name/node_modules/node-sass/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/bin/python
gyp info spawn args [ '/Users/user_name/Projects/app_name/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/user_name/Projects/app_name/node_modules/node-sass/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/user_name/Projects/app_name/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/user_name/.node-gyp/11.9.0/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/user_name/.node-gyp/11.9.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/user_name/Projects/app_name/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/user_name/.node-gyp/11.9.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/user_name/Projects/app_name/node_modules/node-sass',
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=.' ]
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Traceback (most recent call last):
  File "/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/gyp_main.py", line 16, in <module>
    sys.exit(gyp.script_main())
  File "/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 545, in script_main
    return main(sys.argv[1:])
  File "/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 538, in main
    return gyp_main(args)
  File "/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 523, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2170, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 795, in Write
    self.Pchify))
  File "/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1190, in WriteSources
    cflags = self.xcode_settings.GetCflags(configname)
  File "/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 551, in GetCflags
    archs = self.GetActiveArchs(self.configname)
  File "/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 420, in GetActiveArchs
    xcode_archs_default = GetXcodeArchsDefault()
  File "/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 118, in GetXcodeArchsDefault
    xcode_version, _ = XcodeVersion()
  File "/Users/user_name/Projects/app_name/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1265, in XcodeVersion
    version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/user_name/Projects/app_name/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/Cellar/node/11.9.0/bin/node" "/Users/user_name/Projects/app_name/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/user_name/Projects/app_name/node_modules/node-sass
gyp ERR! node -v v11.9.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

参考

https://github.com/yarnpkg/yarn/issues/5962
https://www.npmjs.com/package/fsevents
https://www.npmjs.com/package/node-pre-gyp

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1