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

Fatal error: 'utility' file not found, node-gyp rebuild #1574

Closed
alexventuraio opened this issue Oct 16, 2018 · 6 comments
Closed

Fatal error: 'utility' file not found, node-gyp rebuild #1574

alexventuraio opened this issue Oct 16, 2018 · 6 comments

Comments

@alexventuraio
Copy link

  • Node Version: v6.11.5 and 3.10.10
  • Platform: macOS Mojave Version: 10.14 (18A391) Xcode v9.4.1 and Xcode v10
  • Compiler: cc -v:
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin18.0.0
Thread model: posix
InstalledDir: /Applications/Xcode_9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  • Module: node-gyp rebuild
Verbose output (from npm or node-gyp):
> contextify@0.1.15 install /Users/alex/Code/onedocway-rails/1dw-node/node_modules/contextify
> node-gyp rebuild

  CXX(target) Release/obj.target/contextify/src/contextify.o
In file included from ../src/contextify.cc:1:
In file included from /Users/alex/.node-gyp/6.11.5/include/node/node.h:42:
/Users/alex/.node-gyp/6.11.5/include/node/v8.h:21:10: fatal error: 'utility' file not found
#include <utility>
         ^~~~~~~~~
1 error generated.
make: *** [Release/obj.target/contextify/src/contextify.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/alex/.nvm/versions/node/v6.11.5/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)
gyp ERR! System Darwin 18.0.0
gyp ERR! command "/Users/alex/.nvm/versions/node/v6.11.5/bin/node" "/Users/alex/.nvm/versions/node/v6.11.5/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/alex/Code/onedocway-rails/1dw-node/node_modules/contextify
gyp ERR! node -v v6.11.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
/Users/alex/Code/onedocway-rails/1dw-node
├── UNMET PEER DEPENDENCY enzyme@3.7.0
└── UNMET PEER DEPENDENCY react@15.6.2

npm WARN enzyme-matchers@3.8.3 requires a peer of enzyme@1.x || 2.x but none was installed.
npm WARN enzyme-to-json@1.6.0 requires a peer of enzyme@^2.7.1 but none was installed.
npm WARN jest-enzyme@3.8.3 requires a peer of enzyme@1.x || 2.x but none was installed.
npm WARN react-addons-shallow-compare@0.14.7 requires a peer of react@^0.14.7 but none was installed.
npm WARN react-addons-test-utils@0.14.7 requires a peer of react@^0.14.7 but none was installed.
npm WARN redux-devtools@3.1.1 requires a peer of react@^0.14.0 but none was installed.
npm WARN slick-carousel@1.8.1 requires a peer of jquery@>=1.8.0 but none was installed.
npm ERR! Darwin 18.0.0
npm ERR! argv "/Users/alex/.nvm/versions/node/v6.11.5/bin/node" "/Users/alex/.nvm/versions/node/v6.11.5/bin/npm" "install"
npm ERR! node v6.11.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! contextify@0.1.15 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify@0.1.15 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs contextify
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls contextify
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/alex/Code/onedocway-rails/1dw-node/npm-debug.log
npm ERR! code 1
@yerassyl94
Copy link

/Users/alex/.node-gyp/6.11.5/include/node/common.gypi check out MacOS dev environment in this file

@alexventuraio
Copy link
Author

@yerassyl94 thx, it solved the problem!

@psmyrdek
Copy link

psmyrdek commented Oct 16, 2018

Let's mention that it's about bumping macOS version like in your PR to i.e. 10.9
'MACOSX_DEPLOYMENT_TARGET': '10.9', # -mmacosx-version-min=10.9

@yerassyl94 could you explain what's the root cause here?

refack pushed a commit to alexventuraio/node that referenced this issue Oct 16, 2018
It fixes an issue when running `npm install` for a project with *Node
v6.11.5* and *npm v3.10.10* on *Mac OS X 10.4 Mojave* and *Xcode v9.4.1
|| Xcode v10.0*. It asks for the 'utility' file when running
`node-gyp rebuild`.

Fixes: nodejs/node-gyp#1574
@alexventuraio
Copy link
Author

Related to #1564

@refack
Copy link
Contributor

refack commented Oct 16, 2018

FTR, possible workaround:

For users:

env CXXFLAGS="-mmacosx-version-min=10.9" npm install

For addon authors:

add this to your bindings.gyp (but as mentioned above test)

  'xcode_settings': {
    'MACOSX_DEPLOYMENT_TARGET': '10.9',
  },

@yurishkuro
Copy link

with CXXFLAGS only it didn't work for me on macOs 10.15.1, but this worked (per #1564 (comment)):

CXXFLAGS="-mmacosx-version-min=10.9" LDFLAGS="-mmacosx-version-min=10.9" npm i

niik added a commit to niik/prebuild that referenced this issue Mar 29, 2022
niik added a commit to niik/prebuild that referenced this issue Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants