Dave Partner

Mobile Development => Ionic => Ionic 2.x => Topic started by: jengmun91 on October 18, 2016, 06:22:31 AM

Title: [15:19:26] typescript: node_modules/firebase/firebase.d.ts, line: 405
Post by: jengmun91 on October 18, 2016, 06:22:31 AM
1. The typings installation are installed into the desktop..BUt when tried the

[nmun@localhost ionic2Folder]$ cd signUp/
[nmun@localhost signUp]$ sudo npm install -g firebase
[sudo] password for nmun:
/usr/lib
└── firebase@3.5.0

[nmun@localhost signUp]$ sudo npm install -g typings
/usr/bin/typings -> /usr/lib/node_modules/typings/dist/bin.js
/usr/lib
└── typings@1.4.0

[nmun@localhost signUp]$ sudo typings install --save firebase
firebase@3.0.5
└── es6-promise

[nmun@localhost signUp]$ sudo typings install dt~firebase --global --save
firebase
└── (No dependencies)




2. then i tried install

[nmun@localhost signUp]$ sudo npm install angularfire2
[sudo] password for nmun:
ionic-hello-world@ /home/nmun/ionic2Folder/signUp
├── UNMET PEER DEPENDENCY @types/request@0.0.30
└─┬ angularfire2@2.0.0-beta.5
  └─┬ firebase@3.3.0
    ├── dom-storage@2.0.2
    ├─┬ faye-websocket@0.9.3
    │ └─┬ websocket-driver@0.6.4
    │   └── websocket-extensions@0.1.1
    ├─┬ jsonwebtoken@5.7.0
    │ ├─┬ jws@3.1.3
    │ │ ├─┬ base64url@1.0.6
    │ │ │ ├─┬ concat-stream@1.4.10
    │ │ │ │ ├── inherits@2.0.1
    │ │ │ │ ├─┬ readable-stream@1.1.14
    │ │ │ │ │ ├── core-util-is@1.0.2
    │ │ │ │ │ ├── isarray@0.0.1
    │ │ │ │ │ └── string_decoder@0.10.31
    │ │ │ │ └── typedarray@0.0.6
    │ │ │ └─┬ meow@2.0.0
    │ │ │   ├─┬ camelcase-keys@1.0.0
    │ │ │   │ ├── camelcase@1.2.1
    │ │ │   │ └── map-obj@1.0.1
    │ │ │   ├─┬ indent-string@1.2.2
    │ │ │   │ ├── get-stdin@4.0.1
    │ │ │   │ └─┬ repeating@1.1.3
    │ │ │   │   └─┬ is-finite@1.0.1
    │ │ │   │     └── number-is-nan@1.0.0
    │ │ │   ├── minimist@1.2.0
    │ │ │   └── object-assign@1.0.0
    │ │ └─┬ jwa@1.1.3
    │ │   ├── buffer-equal-constant-time@1.0.1
    │ │   └─┬ ecdsa-sig-formatter@1.0.5
    │ │     └── base64-url@1.2.2
    │ ├── ms@0.7.1
    │ └── xtend@4.0.1
    ├── rsvp@3.2.1
    └── xmlhttprequest@1.8.0

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
npm WARN @ngtools/webpack@1.1.0 requires a peer of typescript@2.0.2 but none was installed.
npm WARN angularfire2@2.0.0-beta.5 requires a peer of @types/request@0.0.30 but none was installed.
[nmun@localhost signUp]$ sudo npm install angularfire2 --save-dev
[sudo] password for nmun:
Sorry, try again.
[sudo] password for nmun:
Sorry, try again.
[sudo] password for nmun:
ionic-hello-world@ /home/nmun/ionic2Folder/signUp
├── UNMET PEER DEPENDENCY @types/request@0.0.30
└── angularfire2@2.0.0-beta.5

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
npm WARN @ngtools/webpack@1.1.0 requires a peer of typescript@2.0.2 but none was installed.
npm WARN angularfire2@2.0.0-beta.5 requires a peer of @types/request@0.0.30 but none was installed.




3.but it give me the  UNMET PEER DEPENDENCY @types/request@0.0.30. So i tried to
[nmun@localhost signUp]$ sudo npm install @types/request@0.0.30
ionic-hello-world@ /home/nmun/ionic2Folder/signUp
└─┬ @types/request@0.0.30
  ├── @types/form-data@0.0.32
  └── @types/node@6.0.45

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
npm WARN @ngtools/webpack@1.1.0 requires a peer of typescript@2.0.2 but none was installed.



4. then i re-run again
[nmun@localhost signUp]$ ionic serve --lab

Running 'serve:before' npm script before serve

> ionic-hello-world@ watch /home/nmun/ionic2Folder/signUp
> ionic-app-scripts watch

[11:28:32]  ionic-app-scripts 0.0.36
[11:28:32]  watch started ...
[11:28:32]  build dev started ...
[11:28:32]  clean started ...
[11:28:32]  clean finished in 3 ms
[11:28:32]  copy started ...
[11:28:32]  transpile started ...
[11:28:32]  lint started ...
[11:28:33]  tslint: src/app/app.module.ts, line: 9
            Unused import: 'firebase'

       L8:  import { Login } from '../pages/login/login';
       L9:  import * as firebase from 'firebase';

[11:28:33]  lint finished in 823 ms
[11:28:33]  typescript: typings/globals/firebase/index.d.ts, line: 323
            Duplicate identifier 'export='.

[11:28:33]  typescript: typings/modules/firebase/index.d.ts, line: 498
            Duplicate identifier 'export='.

[11:28:33]  transpile failed
[11:28:34]  copy finished in 1.27 s
[11:28:34]  watch ready in 1.29 s
Running live reload server: http://localhost:35729
Watching: www/**/, !www/lib/*/, !www/*/*.map
√ Running dev server:  http://localhost:8100
Ionic server commands, enter:
  restart or r to restart the client app from the root
  goto or g and a url to have the app navigate to the given url
  consolelogs or c to enable/disable console log output
  serverlogs or s to enable/disable server log output
  quit or q to shutdown the server and exit

5. i try to key in install angularfire2 and latest firebase version
[nmun@localhost signUp]$ sudo npm install angularfire2 && firebase@latest
[sudo] password for nmun:
ionic-hello-world@ /home/nmun/ionic2Folder/signUp
└── angularfire2@2.0.0-beta.5

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
npm WARN @ngtools/webpack@1.1.0 requires a peer of typescript@2.0.2 but none was installed.
bash: firebase@latest: command not found...


5. i re-run again still failed..
[nmun@localhost signUp]$ ionic serve --lab

Running 'serve:before' npm script before serve

> ionic-hello-world@ watch /home/nmun/ionic2Folder/signUp
> ionic-app-scripts watch

[11:40:27]  ionic-app-scripts 0.0.36
[11:40:27]  watch started ...
[11:40:27]  build dev started ...
[11:40:27]  clean started ...
[11:40:27]  clean finished in 3 ms
[11:40:27]  copy started ...
[11:40:27]  transpile started ...
[11:40:28]  lint started ...
[11:40:28]  tslint: src/app/app.module.ts, line: 9
            Unused import: 'firebase'

       L8:  import { Login } from '../pages/login/login';
       L9:  import * as firebase from 'firebase';

[11:40:28]  lint finished in 850 ms
[11:40:29]  typescript: typings/globals/firebase/index.d.ts, line: 323
            Duplicate identifier 'export='.

[11:40:29]  typescript: typings/modules/firebase/index.d.ts, line: 498
            Duplicate identifier 'export='.

[11:40:29]  transpile failed
[11:40:29]  copy finished in 1.31 s
[11:40:29]  watch ready in 1.34 s
Running live reload server: http://localhost:35729
Watching: www/**/, !www/lib/*/, !www/*/*.map
√ Running dev server:  http://localhost:8100
Ionic server commands, enter:
  restart or r to restart the client app from the root
  goto or g and a url to have the app navigate to the given url
  consolelogs or c to enable/disable console log output
  serverlogs or s to enable/disable server log output
  quit or q to shutdown the server and exit



6.  Lastly, I run thisline of code , still stating that i dun have the dependencies..
[nmun@localhost signUp]$ sudo typings install dt~firebase --global --save
[sudo] password for nmun:
firebase
└── (No dependencies)


Still have anykind of the solution..

oh ya.,..im running my code in visual studio code...i dun have some of ur file like app.code.scss and app.ts...

isit same with visual studio code...
app.scss and app.component.ts or app.module.ts??
Title: Re: [15:19:26] typescript: node_modules/firebase/firebase.d.ts, line: 405
Post by: Dave Partner on October 18, 2016, 08:25:46 AM
Try run, 'ionic serve' instead of 'ionic serve' --lab
Can I see the structure of your ionic2 project folder.

It seems your command prompt is running on the wrong folder.
I want to see a snapshot of what you have inside signUp/ folder. 

Upload image here => https://postimage.org/
Then paste link.
Title: Re: [15:19:26] typescript: node_modules/firebase/firebase.d.ts, line: 405
Post by: Dave Partner on October 18, 2016, 09:25:51 AM
Uninstall angularfire from your project, its the one causing the error => typescript: node_modules/firebase/firebase.d.ts, line: 405     

Here is another solution:
you can reference the Firebase 3 typings file that is included in the angularfire2 node package directly in your typings.json. Run:

typings install file:node_modules/angularfire2/firebase3.d.ts --save --global
this saves the reference into typings.json
NOTE: requires typings v.1+
typings install
this puts the typings files in the typings/ directory.   

One more solution  is using the "files" array in the tsconfig.json file.

 "files": [
    "node_modules/angularfire2/firebase3.d.ts"
  ],
Title: Re: [15:19:26] typescript: node_modules/firebase/firebase.d.ts, line: 405
Post by: Dave Partner on October 18, 2016, 09:39:02 AM
Step 1: package.json to contain the following versions

Quote
"dependencies": {
  "angularfire2": "^2.0.0-beta.2",
  "firebase": "^3.0.5",
  ...
},
"devDependencies": {
  "ionic-gulp-browserify-typescript": "^2.0.0", (Dunno what you can do for non-Ionic projects)
  ...
Step 2: install typings version 1.0.5 (that might be due to node version i have - v5.12.0)

Step 3: tsconfig.json to contain:

Quote
"files": [
    "node_modules/angularfire2/firebase3.d.ts"
  ],
  "exclude": [
    "node_modules",
    "typings/global",
    "typings/global.d.ts"
  ],
Step 4: typings/index.d.ts

Quote
/// <reference path="globals/es6-shim/index.d.ts" />
/// <reference path="../node_modules/angularfire2/firebase3.d.ts" />
Title: Re: [15:19:26] typescript: node_modules/firebase/firebase.d.ts, line: 405
Post by: jengmun91 on October 19, 2016, 05:10:14 AM
Try run, 'ionic serve' instead of 'ionic serve' --lab
Can I see the structure of your ionic2 project folder.

It seems your command prompt is running on the wrong folder.
I want to see a snapshot of what you have inside signUp/ folder. 

Upload image here => https://postimage.org/
Then paste link.

https://postimg.org/image/hu16y1dib/
Title: Re: [15:19:26] typescript: node_modules/firebase/firebase.d.ts, line: 405
Post by: jengmun91 on October 19, 2016, 05:12:54 AM
Hi,

this is the link of the screenshot signup/folder

https://postimg.org/image/hu16y1dib/

but just a question why mine version and ur's a bit different..