为什么grpc使用错误的版本?

时间:2018-09-04 15:19:18

标签: node.js ionic-framework npm grpc

当我尝试做离子服务时,收到以下消息:

$ npm run ionic:serve

QuickNurseApp@1.0.5 ionic:serve /Users/debbiefigg/Projects/QuickNurse/quick-nurse-app
node ./bin/pp envs generate local ; node_modules/.bin/ionic-app-scripts serve

Generating environment configuration for target local
Copying src/environments/environment.local.ts to src/environments/environment.ts
Done!
/Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/node_modules/node-sass/lib/binding.js:13
      throw new Error(errors.unsupportedEnvironment());
      ^

Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (64)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.7.2
    at module.exports (/Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/node_modules/node-sass/lib/binding.js:13:13)
    at Object.<anonymous> (/Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/node_modules/@ionic/app-scripts/dist/core/bundle-components.js:6:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! QuickNurseApp@1.0.5 ionic:serve: `node ./bin/pp envs generate local ; node_modules/.bin/ionic-app-scripts serve`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the QuickNurseApp@1.0.5 ionic:serve 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/debbiefigg/.npm/_logs/2018-09-04T10_07_09_563Z-debug.log

所以我用以下结果更新了node-sass:

$ npm i -g node-sass@latest

/usr/local/bin/node-sass -> /usr/local/lib/node_modules/node-sass/bin/node-sass

node-sass@4.9.3 install /usr/local/lib/node_modules/node-sass
node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.3/darwin-x64-64_binding.node
Download complete ░⸩ ⠋ :
Binary saved to /usr/local/lib/node_modules/node-sass/vendor/darwin-x64-64/binding.node
Caching binary to /Users/debbiefigg/.npm/node-sass/4.9.3/darwin-x64-64_binding.node

node-sass@4.9.3 postinstall /usr/local/lib/node_modules/node-sass
node scripts/build.js

Binary found at /usr/local/lib/node_modules/node-sass/vendor/darwin-x64-64/binding.node
Testing binary
Binary is fine
+ node-sass@4.9.3
added 175 packages from 134 contributors in 9.822s

然后我尝试删除iOS平台,因此可以重新安装它,但是却收到大量错误消息。我不知道从哪里开始解读它们的含义。我知道我有grpc v1.14.1,所以我不知道它从哪里获取v1.10.1。

顺便说一句,在尝试许多不同解决方案的前后几天,我收到了类似的消息,我诉诸于卸载Homebrew及其所有软件包以及其他各种软件包,因此我可以从一个干净的系统开始。然后使用Homebrew重新安装了所有内容,因此我知道它们在Homebrew的控制下进行了整齐地安装,但结果并没有改变,因为我再次收到了相同的消息。

这就是为什么我想出一些帮助的原因,因为我的想法已经用完了。

$ ionic cordova platforms rm ios

cordova platform remove ios --save
Removing platform ios from config.xml file...
Removing ios from cordova.platforms array in package.json
(node:12448) UnhandledPromiseRejectionWarning: CordovaError: Error: npm: Command failed with exit code 1 Error output:
node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v64-darwin-x64-unknown.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.10.1 and node@10.9.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Pre-built binaries not installable for grpc@1.10.1 and node@10.9.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file 
rm: ./Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw: No such file or directory
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.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:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:239:12)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/Cellar/node/10.9.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown"
gyp ERR! cwd /Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/node_modules/@firebase/firestore/node_modules/grpc
gyp ERR! node -v v10.9.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/10.9.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/node_modules/@firebase/firestore/node_modules/grpc/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:250:5)
node-pre-gyp ERR! System Darwin 17.7.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/10.9.0/bin/node" "/Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/node_modules/@firebase/firestore/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/node_modules/@firebase/firestore/node_modules/grpc
node-pre-gyp ERR! node -v v10.9.0
node-pre-gyp ERR! node-pre-gyp -v v0.7.0
node-pre-gyp ERR! not ok 
make: *** No rule to make target `Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.o', needed by `Release/libgrpc.a'.  Stop.
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:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:239:12)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/Cellar/node/10.9.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown"
gyp ERR! cwd /Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/node_modules/@firebase/firestore/node_modules/grpc
gyp ERR! node -v v10.9.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.10.1 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the grpc@1.10.1 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/debbiefigg/.npm/_logs/2018-09-04T10_10_06_935Z-debug.log
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-fetch/index.js:302:29
    at _rejected (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:864:24)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:890:30
    at Promise.when (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:1142:31)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:808:41)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:624:44
    at runSingle (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:137:13)
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:125:13)
    at process._tickCallback (internal/process/next_tick.js:61:11)
(node:12448) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:12448) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

1 个答案:

答案 0 :(得分:0)

好吧,由于我的答案被删除了,因为它是我的另一则帖子的重复,这是我另一则帖子的链接,因此,如果您首先遇到过该帖子,那么您可以看到答案:

Pre-built binaries not found for grpc1-10-1 and node10-9-0

当我提交每篇文章时,我还没有意识到他们最终会遇到大致相同的问题。