我正在尝试使用&sudo npm install -g --unsafe-perm vcremote'安装vcremote。但低于错误:
/usr/local/bin/vcremote -> /usr/local/lib/node_modules/vcremote/bin/vcremote
> thread-sleep@1.0.4 install /usr/local/lib/node_modules/vcremote/node_modules/thread-sleep
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! UNCAUGHT EXCEPTION
node-pre-gyp ERR! stack Error: Cannot find module 'internal/fs'
node-pre-gyp ERR! stack at Function.Module._resolveFilename (module.js:472:15)
node-pre-gyp ERR! stack at Function.Module._load (module.js:420:25)
node-pre-gyp ERR! stack at Module.require (module.js:500:17)
node-pre-gyp ERR! stack at require (internal/module.js:20:19)
node-pre-gyp ERR! stack at evalmachine.<anonymous>:17:20
node-pre-gyp ERR! stack at Object.<anonymous> (/usr/local/lib/node_modules/vcremote/node_modules/thread-sleep/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/fs.js:11:1)
node-pre-gyp ERR! stack at Module._compile (module.js:573:32)
node-pre-gyp ERR! stack at Object.Module._extensions..js (module.js:582:10)
node-pre-gyp ERR! stack at Module.load (module.js:490:32)
node-pre-gyp ERR! stack at tryModuleLoad (module.js:449:12)
node-pre-gyp ERR! System Darwin 15.6.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/vcremote/node_modules/thread-sleep/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/vcremote/node_modules/thread-sleep
node-pre-gyp ERR! node -v v7.1.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.9
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR! <https://github.com/mapbox/node-pre-gyp/issues>
> node-ios-device@0.5.2 install /usr/local/lib/node_modules/vcremote/node_modules/node-ios-device
> node-gyp rebuild
CXX(target) Release/obj.target/node_module_version/src/node-module-version.o
LINK(target) Release/node_module_version
CXX(target) Release/obj.target/node_ios_device/src/ios-device.o
In file included from ../src/ios-device.cpp:8:
In file included from ../../nan/nan.h:182:
../../nan/nan_maybe_43_inl.h:221:17: warning: 'CloneElementAt' is deprecated [-Wdeprecated-declarations]
return array->CloneElementAt(GetCurrentContext(), index);
^
/Users/Sibridge/.node-gyp/7.1.0/include/node/v8.h:3056:36: note: 'CloneElementAt' has been explicitly marked deprecated here
MaybeLocal<Object> CloneElementAt(Local<Context> context,
^
In file included from ../src/ios-device.cpp:8:
In file included from ../../nan/nan.h:188:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:40:29: warning: 'New' is deprecated [-Wdeprecated-declarations]
return v8::BooleanObject::New(value).As<v8::BooleanObject>();
^
/Users/Sibridge/.node-gyp/7.1.0/include/node/v8.h:4048:56: note: 'New' has been explicitly marked deprecated here
V8_DEPRECATED("Pass an isolate", static Local<Value> New(bool value));
^
In file included from ../src/ios-device.cpp:8:
../../nan/nan.h:590:20: error: no type named 'GCEpilogueCallback' in 'v8::Isolate'
v8::Isolate::GCEpilogueCallback callback
~~~~~~~~~~~~~^
../../nan/nan.h:596:20: error: no type named 'GCEpilogueCallback' in 'v8::Isolate'
v8::Isolate::GCEpilogueCallback callback) {
~~~~~~~~~~~~~^
../../nan/nan.h:601:20: error: no type named 'GCPrologueCallback' in 'v8::Isolate'
v8::Isolate::GCPrologueCallback callback
~~~~~~~~~~~~~^
../../nan/nan.h:607:20: error: no type named 'GCPrologueCallback' in 'v8::Isolate'
v8::Isolate::GCPrologueCallback callback) {
~~~~~~~~~~~~~^
../../nan/nan.h:1927:15: warning: 'SetAccessor' is deprecated [-Wdeprecated-declarations]
return obj->SetAccessor(
^
/Users/Sibridge/.node-gyp/7.1.0/include/node/v8.h:2761:22: note: 'SetAccessor' has been explicitly marked deprecated here
bool SetAccessor(Local<Name> name,
^
3 warnings and 4 errors generated.
make: *** [Release/obj.target/node_ios_device/src/ios-device.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: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:215:12)
gyp ERR! System Darwin 15.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/vcremote/node_modules/node-ios-device
gyp ERR! node -v v7.1.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
/usr/local/lib
└── (empty)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: thread-sleep@1.0.4 (node_modules/vcremote/node_modules/thread-sleep):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: thread-sleep@1.0.4 install: `node-pre-gyp install --fallback-to-build`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 7
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "--unsafe-perm=true" "vcremote"
npm ERR! node v7.1.0
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! node-ios-device@0.5.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-ios-device@0.5.2 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 node-ios-device 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 node-ios-device
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-ios-device
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Sibridge/npm-debug.log
npm ERR! code 1
我已经尝试过卸载并重新安装node-gyp,但它没有用。
如何解决?
答案 0 :(得分:1)
看起来微软已经提交了一个错误(参见https://connect.microsoft.com/VisualStudio/Feedback/Details/3110480)。看来这是一个过时依赖的问题,不适用于较新的(> 6.5)版本的节点。
有关于如何手动更新依赖关系的详细步骤 https://social.msdn.microsoft.com/Forums/vstudio/en-US/77545f82-6f66-47d6-b00c-02d73089cb00/installing-vcremote?forum=vcgeneral
您需要将ioslib依赖关系更新为1.0.3,将node-ios-device更新为1.1.0。这对我有用。降级到节点6.5可能也有效。