简体   繁体   中英

Unable to install "npm install --save firebase"

I am getting the following error when I run the command "npm install --save firebase"

    fsevents@1.2.4 install /Users/narenpalep/Desktop/Angular:AngularJS/Angular2/firebase-demo/node_modules/fsevents
> node install

node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.4/fse-v1.2.4-node-v67-darwin-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for fsevents@1.2.4 and node@11.2.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp)
action_after_build.target.mk:6: *** target pattern contains no `%'.  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:254:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/narenpalep/Desktop/Angular:AngularJS/Angular2/firebase-demo/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node" "--module_name=fse" "--module_path=/Users/narenpalep/Desktop/Angular:AngularJS/Angular2/firebase-demo/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64" "--napi_version=3""--node_abi_napi=napi"
gyp ERR! cwd /Users/narenpalep/Desktop/Angular:AngularJS/Angular2/firebase-demo/node_modules/fsevents
gyp ERR! node -v v11.2.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/narenpalep/Desktop/Angular:AngularJS/Angular2/firebase-demo/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node --module_name=fse --module_path=/Users/narenpalep/Desktop/Angular:AngularJS/Angular2/firebase-demo/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64--napi_version=3 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/narenpalep/Desktop/Angular:AngularJS/Angular2/firebase-demo/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:978:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
node-pre-gyp ERR! System Darwin 18.2.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/narenpalep/Desktop/Angular:AngularJS/Angular2/firebase-demo/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/narenpalep/Desktop/Angular:AngularJS/Angular2/firebase-demo/node_modules/fsevents
node-pre-gyp ERR! node -v v11.2.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/narenpalep/Desktop/Angular:AngularJS/Angular2/firebase-demo/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node --module_name=fse --module_path=/Users/narenpalep/Desktop/Angular:AngularJS/Angular2/firebase-demo/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)

> grpc@1.16.1 install /Users/narenpalep/Desktop/Angular:AngularJS/Angular2/firebase-demo/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

sh: node-pre-gyp: command not found
npm WARN @angular/fire@5.1.1 requires a peer of @angular/common@>=6.0.0 <8 butnone is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.1.1 requires a peer of @angular/core@>=6.0.0 <8 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.1.1 requires a peer of @angular/platform-browser@>=6.0.0 <8 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.1.1 requires a peer of @angular/platform-browser-dynamic@>=6.0.0 <8 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.1.1 requires a peer of rxjs@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! grpc@1.16.1 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the grpc@1.16.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/narenpalep/.npm/_logs/2018-12-08T07_31_54_719Z-debug.log


and when I do "ng serve" later I am getting the following error.


ERROR in node_modules/@angular/fire/database/interfaces.d.ts(2,26): error TS2307: Cannot find module 'firebase/app'.
node_modules/@angular/fire/firebase.app.module.d.ts(2,79): error TS2307: Cannot find module 'firebase/app'.
node_modules/@angular/fire/firestore/collection/collection.d.ts(2,27): error TS2307: Cannot find module 'firebase/app'.
node_modules/@angular/fire/firestore/document/document.d.ts(5,27): error TS2307: Cannot find module 'firebase/app'.
node_modules/@angular/fire/firestore/firestore.d.ts(7,27): error TS2307: Cannot find module 'firebase/app'.
node_modules/@angular/fire/firestore/interfaces.d.ts(2,27): error TS2307: Cannot find module 'firebase/app'.

I need some help in resolving the above issue and the reason what may have caused it. I tried searching online and installed few other google and firebase related modules and issue was not being resolved.

Delete ~/.node-gyp and ~/.npmrc directories. Also, in your project remove node_modules folder.

Then run the below command in your project directory,
npm install --save firebase

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM