Insane amount of deprecation warnings and errors by trying to install a new gatsby project.
Installed project via global installed official gatsby.
Installing new gatsby project. For example:
gatsby new tutorial-part-two https://github.com/gatsbyjs/gatsby-starter-hello-world
What should happen?
An installation.
What happened:
gatsby new tutorial-part-two https://github.com/gatsbyjs/gatsby-starter-hello-world
info Creating new site from git: https://github.com/gatsbyjs/gatsby-starter-hello-world.git
Cloning into 'tutorial-part-two'...
remote: Counting objects: 181, done.
remote: Total 181 (delta 0), reused 0 (delta 0), pack-reused 181
Receiving objects: 100% (181/181), 230.70 KiB | 304.00 KiB/s, done.
Resolving deltas: 100% (86/86), done.
success Created starter directory layout
info Installing packages...
> [email protected] install /Users/albert/Sites/tutorial-part-two/node_modules/fsevents
> node install
node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
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
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
SOLINK_MODULE(target) Release/.node
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
CXX(target) Release/obj.target/fse/fsevents.o
In file included from In file included from ../fsevents.cc../fsevents.cc::8585:
:
../src/methods.cc:14:12: warning../src/methods.cc: :14:12: warning: 'Call''Call' isis deprecateddeprecated
[-Wdeprecated-declarations][-Wdeprecated-declarations]
handler->Call(3, argv);
handler->Call(3, argv); ^
^
../../nan/nan.h../../nan/nan.h::16171617::33:: notenote: : 'Call''Call' hashas beenbeen explicitlyexplicitly markedmarked deprecateddeprecated
herehere
NAN_DEPRECATED inline v8::Local<v8::Value> NAN_DEPRECATED inline v8::Local<v8::Value>
^ ^
../../nan/nan.h:98:40: note: expanded from macro../../nan/nan.h :'NAN_DEPRECATED'98
:40: note: expanded # define NAN_DEPRECATED __attribute__((deprecated))
from ^
macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
1 warning generated.
1 warning generated.
rm: ./Release/.deps/Release/obj.target/fse/fsevents.o.d.raw: No such file or directory
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp SOLINK_MODULE(target) Release/fse.node
ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/Cellar/node/10.3.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/albert/Sites/tutorial-part-two/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" "--module_name=fse" "--module_path=/Users/albert/Sites/tutorial-part-two/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64"
gyp ERR! cwd /Users/albert/Sites/tutorial-part-two/node_modules/fsevents
gyp ERR! node -v v10.3.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/10.3.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/albert/Sites/tutorial-part-two/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/albert/Sites/tutorial-part-two/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/albert/Sites/tutorial-part-two/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:961:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
node-pre-gyp ERR! System Darwin 17.5.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/10.3.0/bin/node" "/Users/albert/Sites/tutorial-part-two/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/albert/Sites/tutorial-part-two/node_modules/fsevents
node-pre-gyp ERR! node -v v10.3.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node/10.3.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/albert/Sites/tutorial-part-two/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/albert/Sites/tutorial-part-two/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64' (1)
COPY /Users/albert/Sites/tutorial-part-two/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node
TOUCH Release/obj.target/action_after_build.stamp
npm WARN gatsby-starter-hello-world@ No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
added 1407 packages from 875 contributors and audited 13651 packages in 23.008s
found 44 vulnerabilities (15 low, 22 moderate, 5 high, 2 critical)
run `npm audit fix` to fix them, or `npm audit` for details
npm list gatsby
): [email protected]gatsby --version
): 1.1.57This isn't a Gatsby problem — looks like you need to correct your Node.js setup. Try following the instructions here: https://github.com/nodejs/node-gyp/issues/569
For anyone else that might stumble upon this in the future, the linked issue talks mostly about fixing your xcode environment, which wasn't the issue for me.
I was running node current (10.5), downgraded to LTS (currently 8.11.3) and the issue went away immediately.
Might be helpful for others in the future.
hey @shimms can you point me to how to downgrade?
Hey @andrewdyke sorry for the delay - I removed it via homebrew and then just installed it with the version specifier to force it to 8.11.3.
Same problem here:
I used nvm and it resolved with this command nvm install lts/carbon
@heyalbert were you able to fix this issue?
@shimms answer was the only thing that worked for me. On a whim I decided to upgrade to the newest LTS node version (as of November 4th 2018, that was v10.13.0... then all hell broke loose!) But isn't this actually a gatsby error? Are we stuck using v8.11.3 for our gatsby projects? Or, has anyone successfully got a project working with nodejs v10+?
@frewinchristopher after upgrading node to 10.14.2, running npm rebuild
resolve this issue for me. From npm docs:
This command runs the npm build command on the matched folders. This is useful when you install a new version of node, and must recompile all your C++ addons with the new binary.
Most helpful comment
For anyone else that might stumble upon this in the future, the linked issue talks mostly about fixing your xcode environment, which wasn't the issue for me.
I was running node current (10.5), downgraded to LTS (currently 8.11.3) and the issue went away immediately.
Might be helpful for others in the future.