我正在尝试完成twilio / arduino教程(https://www.twilio.com/blog/2014/11/go-old-school-build-a-pager-using-arduino-node-js-and-twilio.html)但是在安装串行端口依赖项时遇到错误。我已经尝试过sudo,同样的问题一直出现在终端上。
这是终端显示的内容:
> serialport@1.4.6 install /Users/josefina/Desktop/Page a Poem/node_modules/serialport
> node-pre-gyp install --fallback-to-build
node-pre-gyp info it worked if it ends with ok
node-pre-gyp verb cli [ '/usr/local/bin/node',
node-pre-gyp verb cli '/Users/josefina/Desktop/Page a Poem/node_modules/serialport/node_modules/.bin/node-pre-gyp',
node-pre-gyp verb cli 'install',
node-pre-gyp verb cli '--fallback-to-build' ]
node-pre-gyp info using node-pre-gyp@0.5.19
node-pre-gyp info using node@8.10.0 | darwin | x64
node-pre-gyp verb command install []
node-pre-gyp info check checked for "/Users/josefina/Desktop/Page a Poem/node_modules/serialport/build/serialport/v1.4.6/Release/node-v57-darwin-x64/serialport.node" (not found)
node-pre-gyp http GET https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/node-v57-darwin-x64.tar.gz
node-pre-gyp http 404 https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/node-v57-darwin-x64.tar.gz
node-pre-gyp http Pre-built binary not available for your system (falling back to source compile with node-gyp)
node-pre-gyp verb command build [ 'rebuild' ]
(node:6835) [DEP0006] DeprecationWarning: child_process: options.customFds option is deprecated. Use options.stdio instead.
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
CXX(target) Release/obj.target/serialport/src/serialport.o
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:189:68: error: too many arguments to function call, expected at
most 2, have 4
return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv);
~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~
/Users/josefina/.node-gyp/8.10.0/include/node/v8.h:5921:3: note: 'New' declared
here
static Local<Signature> New(
^
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:244:32: warning: 'CompileUnbound' is deprecated
[-Wdeprecated-declarations]
return v8::ScriptCompiler::CompileUnbound(
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8.h:1404:10: note:
'CompileUnbound' has been explicitly marked deprecated here
static V8_DEPRECATED("Use maybe version",
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8config.h:321:29: note: expanded
from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:253:32: warning: 'CompileUnbound' is deprecated
[-Wdeprecated-declarations]
return v8::ScriptCompiler::CompileUnbound(
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8.h:1404:10: note:
'CompileUnbound' has been explicitly marked deprecated here
static V8_DEPRECATED("Use maybe version",
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8config.h:321:29: note: expanded
from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:259:31: warning: 'New' is deprecated [-Wdeprecated-declarations]
return v8::BooleanObject::New(value).As<v8::BooleanObject>();
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8.h:4845:3: note: 'New' has been
explicitly marked deprecated here
V8_DEPRECATED("Pass an isolate", static Local<Value> New(bool value));
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8config.h:321:29: note: expanded
from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:271:3: error: redefinition of 'NanNew'
NanNew<v8::StringObject, v8::Handle<v8::String> >(
^
../../nan/nan.h:264:3: note: previous definition is here
NanNew<v8::StringObject, v8::Local<v8::String> >(
^
../../nan/nan.h:289:36: error: redefinition of 'NanNew'
NAN_INLINE v8::Local<v8::RegExp> NanNew(
^
../../nan/nan.h:283:36: note: previous definition is here
NAN_INLINE v8::Local<v8::RegExp> NanNew(
^
../../nan/nan.h:301:36: error: redefinition of 'NanNew'
NAN_INLINE v8::Local<v8::RegExp> NanNew(
^
../../nan/nan.h:295:36: note: previous definition is here
NAN_INLINE v8::Local<v8::RegExp> NanNew(
^
../../nan/nan.h:309:42: warning: 'ToUint32' is deprecated
[-Wdeprecated-declarations]
v8::Isolate::GetCurrent(), val)->ToUint32();
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8.h:2340:10: note: 'ToUint32' has
been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Uint32> ToUint32() const);
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8config.h:321:29: note: expanded
from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:315:42: warning: 'ToUint32' is deprecated
[-Wdeprecated-declarations]
v8::Isolate::GetCurrent(), val)->ToUint32();
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8.h:2340:10: note: 'ToUint32' has
been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Uint32> ToUint32() const);
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8config.h:321:29: note: expanded
from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:320:60: warning: 'ToInt32' is deprecated
[-Wdeprecated-declarations]
return v8::Int32::New(v8::Isolate::GetCurrent(), val)->ToInt32();
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8.h:2341:10: note: 'ToInt32' has
been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Int32> ToInt32() const);
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8config.h:321:29: note: expanded
from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:325:60: warning: 'ToInt32' is deprecated
[-Wdeprecated-declarations]
return v8::Int32::New(v8::Isolate::GetCurrent(), val)->ToInt32();
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8.h:2341:10: note: 'ToInt32' has
been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Int32> ToInt32() const);
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8config.h:321:29: note: expanded
from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:365:24: warning: 'NewFromOneByte' is deprecated
[-Wdeprecated-declarations]
return v8::String::NewFromOneByte(
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8.h:2679:10: note:
'NewFromOneByte' has been explicitly marked deprecated here
static V8_DEPRECATED(
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8config.h:321:29: note: expanded
from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:376:24: warning: 'NewFromOneByte' is deprecated
[-Wdeprecated-declarations]
return v8::String::NewFromOneByte(
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8.h:2679:10: note:
'NewFromOneByte' has been explicitly marked deprecated here
static V8_DEPRECATED(
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8config.h:321:29: note: expanded
from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:385:24: warning: 'NewFromOneByte' is deprecated
[-Wdeprecated-declarations]
return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), arg);
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8.h:2679:10: note:
'NewFromOneByte' has been explicitly marked deprecated here
static V8_DEPRECATED(
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8config.h:321:29: note: expanded
from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:391:24: warning: 'NewFromOneByte' is deprecated
[-Wdeprecated-declarations]
return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), arg);
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8.h:2679:10: note:
'NewFromOneByte' has been explicitly marked deprecated here
static V8_DEPRECATED(
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8config.h:321:29: note: expanded
from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:477:24: warning: 'NewExternal' is deprecated
[-Wdeprecated-declarations]
return v8::String::NewExternal(v8::Isolate::GetCurrent(), resource);
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8.h:2718:10: note: 'NewExternal'
has been explicitly marked deprecated here
static V8_DEPRECATED("Use maybe version",
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8config.h:321:29: note: expanded
from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:481:19: error: no type named 'ExternalAsciiStringResource' in
'v8::String'; did you mean 'ExternalStringResource'?
v8::String::ExternalAsciiStringResource *resource) {
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
ExternalStringResource
/Users/josefina/.node-gyp/8.10.0/include/node/v8.h:2588:19: note:
'ExternalStringResource' declared here
class V8_EXPORT ExternalStringResource
^
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:480:36: error: redefinition of 'NanNew'
NAN_INLINE v8::Local<v8::String> NanNew(
^
../../nan/nan.h:475:36: note: previous definition is here
NAN_INLINE v8::Local<v8::String> NanNew(
^
../../nan/nan.h:482:24: warning: 'NewExternal' is deprecated
[-Wdeprecated-declarations]
return v8::String::NewExternal(v8::Isolate::GetCurrent(), resource);
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8.h:2718:10: note: 'NewExternal'
has been explicitly marked deprecated here
static V8_DEPRECATED("Use maybe version",
^
/Users/josefina/.node-gyp/8.10.0/include/node/v8config.h:321:29: note: expanded
from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
In file included from ../src/serialport.cpp:3:
In file included from ../src/serialport.h:5:
../../nan/nan.h:495:27: error: redefinition of '_NanEscapeScopeHelper'
NAN_INLINE v8::Local<T> _NanEscapeScopeHelper(v8::Local<T> val) {
^
../../nan/nan.h:490:27: note: previous definition is here
NAN_INLINE v8::Local<T> _NanEscapeScopeHelper(v8::Handle<T> val) {
^
../../nan/nan.h:511:12: error: no matching function for call to
'_NanEscapeScopeHelper'
return NanEscapeScope(NanNew(v8::Undefined(v8::Isolate::GetCurrent())));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:499:43: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEscapeScopeHelper(val))
^~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:495:27: note: candidate template ignored: substitution failure
[with T = v8::Primitive]
NAN_INLINE v8::Local<T> _NanEscapeScopeHelper(v8::Local<T> val) {
^
../../nan/nan.h:516:12: error: no matching function for call to
'_NanEscapeScopeHelper'
return NanEscapeScope(NanNew(v8::Null(v8::Isolate::GetCurrent())));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:499:43: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEscapeScopeHelper(val))
^~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:495:27: note: candidate template ignored: substitution failure
[with T = v8::Primitive]
NAN_INLINE v8::Local<T> _NanEscapeScopeHelper(v8::Local<T> val) {
^
../../nan/nan.h:521:12: error: no matching function for call to
'_NanEscapeScopeHelper'
return NanEscapeScope(NanNew(v8::True(v8::Isolate::GetCurrent())));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:499:43: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEscapeScopeHelper(val))
^~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:495:27: note: candidate template ignored: substitution failure
[with T = v8::Boolean]
NAN_INLINE v8::Local<T> _NanEscapeScopeHelper(v8::Local<T> val) {
^
../../nan/nan.h:526:12: error: no matching function for call to
'_NanEscapeScopeHelper'
return NanEscapeScope(NanNew(v8::False(v8::Isolate::GetCurrent())));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:499:43: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEscapeScopeHelper(val))
^~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:495:27: note: candidate template ignored: substitution failure
[with T = v8::Boolean]
NAN_INLINE v8::Local<T> _NanEscapeScopeHelper(v8::Local<T> val) {
^
../../nan/nan.h:567:20: error: no type named 'GCEpilogueCallback' in
'v8::Isolate'
v8::Isolate::GCEpilogueCallback callback
~~~~~~~~~~~~~^
../../nan/nan.h:573:20: error: no type named 'GCEpilogueCallback' in
'v8::Isolate'
v8::Isolate::GCEpilogueCallback callback) {
~~~~~~~~~~~~~^
../../nan/nan.h:578:20: error: no type named 'GCPrologueCallback' in
'v8::Isolate'
v8::Isolate::GCPrologueCallback callback
~~~~~~~~~~~~~^
../../nan/nan.h:584:20: error: no type named 'GCPrologueCallback' in
'v8::Isolate'
v8::Isolate::GCPrologueCallback callback) {
~~~~~~~~~~~~~^
../../nan/nan.h:663:15: error: no type named 'WeakCallbackData' in namespace
'v8'
const v8::WeakCallbackData<T, _NanWeakCallbackInfo<T, P> > &data) {
~~~~^
../../nan/nan.h:663:31: error: expected ')'
const v8::WeakCallbackData<T, _NanWeakCallbackInfo<T, P> > &data) {
^
../../nan/nan.h:662:41: note: to match this '('
static void _NanWeakCallbackDispatcher(
^
../../nan/nan.h:664:42: error: use of undeclared identifier 'data'
_NanWeakCallbackInfo<T, P> *info = data.GetParameter();
^
../../nan/nan.h:755:13: error: no member named 'smalloc' in namespace 'node'
, node::smalloc::FreeCallback callback
~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
13 warnings and 20 errors generated.
make: *** [Release/obj.target/serialport/src/serialport.o] Error 1
gyp 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 emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 16.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--name=serialport" "--configuration=Release" "--module_name=serialport" "--version=1.4.6" "--major=1" "--minor=4" "--patch=6" "--runtime=node" "--node_abi=node-v57" "--platform=darwin" "--target_platform=darwin" "--arch=x64" "--target_arch=x64" "--module_main=./serialport" "--host=https://node-serialport.s3.amazonaws.com/" "--module_path=/Users/josefina/Desktop/Page a Poem/node_modules/serialport/build/serialport/v1.4.6/Release/node-v57-darwin-x64" "--remote_path=./serialport/v1.4.6/Release/" "--package_name=node-v57-darwin-x64.tar.gz" "--staged_tarball=build/stage/serialport/v1.4.6/Release/node-v57-darwin-x64.tar.gz" "--hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/" "--hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/node-v57-darwin-x64.tar.gz"
gyp ERR! cwd /Users/josefina/Desktop/Page a Poem/node_modules/serialport
gyp ERR! node -v v8.10.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/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.6 --major=1 --minor=4 --patch=6 --runtime=node --node_abi=node-v57 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/Users/josefina/Desktop/Page a Poem/node_modules/serialport/build/serialport/v1.4.6/Release/node-v57-darwin-x64 --remote_path=./serialport/v1.4.6/Release/ --package_name=node-v57-darwin-x64.tar.gz --staged_tarball=build/stage/serialport/v1.4.6/Release/node-v57-darwin-x64.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/node-v57-darwin-x64.tar.gz' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/josefina/Desktop/Page a Poem/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:76:29)
node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Darwin 16.0.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/josefina/Desktop/Page a Poem/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/josefina/Desktop/Page a Poem/node_modules/serialport
node-pre-gyp ERR! node -v v8.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.5.19
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.6 --major=1 --minor=4 --patch=6 --runtime=node --node_abi=node-v57 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/Users/josefina/Desktop/Page a Poem/node_modules/serialport/build/serialport/v1.4.6/Release/node-v57-darwin-x64 --remote_path=./serialport/v1.4.6/Release/ --package_name=node-v57-darwin-x64.tar.gz --staged_tarball=build/stage/serialport/v1.4.6/Release/node-v57-darwin-x64.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/node-v57-darwin-x64.tar.gz' (1)
npm WARN arduino-pager@0.0.0 No description
npm WARN arduino-pager@0.0.0 No repository field.
npm WARN arduino-pager@0.0.0 No license field.
npm WARN serialport@1.4.6 had bundled packages that do not match the required version(s). They have been replaced with non-bundled versions.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! serialport@1.4.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@1.4.6 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/josefina/.npm/_logs/2018-03-16T16_31_56_626Z-debug.log
Josefina:Page a Poem josefina$
答案 0 :(得分:0)
您需要安装并启用命令行工具:
xcode-select --install
sudo xcode-select --switch /Library/Developer/CommandLineTools