Error: Cannot find module 'telegram-api/types/Message' #5

Closed
opened 2015-07-04 01:18:58 +00:00 by mamal72 · 2 comments
mamal72 commented 2015-07-04 01:18:58 +00:00 (Migrated from github.com)

Hi. I'm getting this error when I want to run the bot.

Error: Cannot find module 'telegram-api/types/Message'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/mamal/Projects/Others/TLBot/main.js:1:37)
    at Module._compile (module.js:460:26)
    at normalLoader (/home/mamal/Projects/Others/TLBot/node_modules/babel/node_modules/babel-core/lib/babel/api/register/node.js:166:5)
    at Object.require.extensions.(anonymous function) [as .js] (/home/mamal/Projects/Others/TLBot/node_modules/babel/node_modules/babel-core/lib/babel/api/register/node.js:179:7)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/mamal/Projects/Others/TLBot/index.js:2:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

It's the line 1 of main.js

import Bot from 'telegram-api/build';

I already installed dependencies. Also the Message.js file is present in the build/types folder.

Hi. I'm getting this error when I want to run the bot. ``` Error: Cannot find module 'telegram-api/types/Message' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:278:25) at Module.require (module.js:365:17) at require (module.js:384:17) at Object.<anonymous> (/home/mamal/Projects/Others/TLBot/main.js:1:37) at Module._compile (module.js:460:26) at normalLoader (/home/mamal/Projects/Others/TLBot/node_modules/babel/node_modules/babel-core/lib/babel/api/register/node.js:166:5) at Object.require.extensions.(anonymous function) [as .js] (/home/mamal/Projects/Others/TLBot/node_modules/babel/node_modules/babel-core/lib/babel/api/register/node.js:179:7) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object.<anonymous> (/home/mamal/Projects/Others/TLBot/index.js:2:1) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:501:10) at startup (node.js:129:16) at node.js:814:3 ``` It's the line 1 of main.js ``` js import Bot from 'telegram-api/build'; ``` I already installed dependencies. Also the Message.js file is present in the build/types folder.
mdibaiee commented 2015-07-04 10:52:56 +00:00 (Migrated from github.com)

This is an issue with older versions of telegram-api, it's fixed in the latest version, what version are you on?

This is an issue with older versions of `telegram-api`, it's fixed in the latest version, what version are you on?
mdibaiee commented 2015-07-04 20:03:35 +00:00 (Migrated from github.com)

Okay, it seems there was a problem with npm not publishing types folder anymore, edited the files property of package.json and it's fixed now, Thanks @mamal72! <3

Okay, it seems there was a problem with npm not publishing `types` folder anymore, edited the `files` property of package.json and it's fixed now, Thanks @mamal72! <3
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: thereadme/node-telegram-api#5
No description provided.