René's URL Explorer Experiment


Title: Cannot find module X... · Issue #10567 · microsoft/TypeScript · GitHub

Open Graph Title: Cannot find module X... · Issue #10567 · microsoft/TypeScript

X Title: Cannot find module X... · Issue #10567 · microsoft/TypeScript

Description: TypeScript Version: 1.8.0 Code I have two projects. One I'm building general gulp tasks in. One I'm consuming those general gulp tasks. Project 1 contains a class called TasksTools that lives in a file called tasksTools.ts import { exist...

Open Graph Description: TypeScript Version: 1.8.0 Code I have two projects. One I'm building general gulp tasks in. One I'm consuming those general gulp tasks. Project 1 contains a class called TasksTools that lives in a ...

X Description: TypeScript Version: 1.8.0 Code I have two projects. One I'm building general gulp tasks in. One I'm consuming those general gulp tasks. Project 1 contains a class called TasksTools that liv...

Mail addresses
notifications@github.com
reply@reply.github.com
TypeScript@noreply.github.com
kruz79@gmail.com
author@noreply.github.com

Opengraph URL: https://github.com/microsoft/TypeScript/issues/10567

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cannot find module X...","articleBody":"\u003c!-- BUGS: Please use this template. -->\n\n\u003c!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\n\n\u003c!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\n\n**TypeScript Version:**  1.8.0\n\n**Code**\nI have two projects.  One I'm building general gulp tasks in.  One I'm consuming those general gulp tasks.\n\nProject 1 contains a class called TasksTools that lives in a file called **tasksTools.ts**\n\n``` ts\nimport { existsSync, lstatSync, readdirSync } from 'fs';\nimport * as gulp from 'gulp';\nimport * as util from 'gulp-util';\nimport * as isstream from 'isstream';\nimport { join } from 'path';\nimport * as tildify from 'tildify';\n\nexport class TasksTools {\n    private _gulpConfig: any;\n\n    constructor(config: any) {\n        this._gulpConfig = config;\n    }\n\n    /**\n     * Loads the tasks within the given path.\n     * @param {string} path - The path to load the tasks from.\n     * @param {any} config      - The configuration file.\n     */\n    public loadTasksFromDir(path: string, config: any): void {\n        this._readDir(path, taskname => this.registerTask(taskname, path, config));\n    }\n\n    /**\n     * Registers the task by the given taskname and path.\n     * @param {string} taskname - The name of the task.\n     * @param {string} path     - The path of the task.\n     * @param {any} config      - The configuration file.\n     */\n    public registerTask(taskname: string, path: string, config: any): void {\n        const TASK = join(path, taskname);\n        gulp.task(taskname, (done: any) => {\n            const task = require(TASK);\n            if (task.length > 0) {\n                return task(config, done);\n            }\n\n            const taskReturnedValue = task();\n            if (isstream(taskReturnedValue)) {\n                return taskReturnedValue;\n            }\n\n            // TODO: add promise handling if needed at some point.\n\n            done();\n        });\n    }\n\n    /**\n     * Reads the files in the given root directory and executes the given callback per found file.\n     * @param {string}   root - The root directory to read.\n     * @param {function} cb   - The callback to execute per found file.\n     */\n    private _readDir(root: string, cb: (taskname: string) => void): void {\n        if (!existsSync(root)) {\n            return;\n        }\n\n        walk(root);\n\n        function walk(path: string) {\n            let files = readdirSync(path);\n            for (let i = 0; i \u003c files.length; i += 1) {\n                let file = files[i];\n                let curPath = join(path, file);\n                if (lstatSync(curPath).isFile() && /\\.ts$/.test(file)) {\n                    let taskname = file.replace(/\\.ts$/, '');\n                    cb(taskname);\n                }\n                else if (lstatSync(curPath).isDirectory()) { // recurse\n                    walk(curPath);\n                }\n            }\n        }\n    }\n}\n```\n\nit also has a definitions file that lives in a file called **index.d.ts**\n\n``` ts\ndeclare module \"@mtm/mtm-ng2-gulp-tasks\" {\nexport class TasksTools {\n        public constructor(config: any)\n\n        /**\n            * Loads the tasks within the given path.\n            * @param {string} path - The path to load the tasks from.\n            * @param {any} config       - The configuration file.\n            */\n        public loadTasksFromDir(path: string, config: any): void\n\n        /**\n            * Registers the task by the given taskname and path.\n            * @param {string} taskname - The name of the task.\n            * @param {string} path     - The path of the task.\n            * @param {any} config       - The configuration file.\n            */\n        public registerTask(taskname: string, path: string, config: any): void\n    }\n}\n```\n\nso I wrap these up and make an NPM library.  Then I import that lib into project 2\nHere is my gulp file **gulpfile.ts**\n\n``` ts\nimport * as gulp from 'gulp';\nimport * as config from './gulp.config';\nimport * as runSequence from 'run-sequence';\nimport * as util from 'gulp-util';\n// This line doesn't work\nimport { TasksTools } from '@mtm/mtm-ng2-gulp-tasks';\n\n// If I uncomment this line it works\n//import { TasksTools } from './node_modules/@mtm/mtm-ng2-gulp-tasks/utils/momentum.utils';\n\nlet _gulpConfig = new config.ProjectConfig();\nlet _taskTools = new TasksTools(_gulpConfig);\n\n// Load Default Tasks\n_taskTools.loadTasksFromDir(_gulpConfig.MOMENTUM_TASKS_DIR, _gulpConfig);\n\n// Load Project Tasks\n_taskTools.loadTasksFromDir(_gulpConfig.PROJECT_TASKS_DIR, _gulpConfig);\n```\n\nNow when I try to run this I get the error\n\n**Failed to run \"C:\\TFS\\Dev\\Momentum.Torques\\Client\\Gulp\\mtm-ng2-gulp-tasks\\mtm-ng2-gulp-tasks-test\\Gulpfile.js\"...\ncmd.exe /c gulp --tasks-simple\nmodule.js:442\n    throw err;\n    ^\nError: Cannot find module '@mtm/mtm-ng2-gulp-tasks'**\n\n**Expected behavior:**\nI expect that this would work\n**Actual behavior:** \nIt did not work\n","author":{"url":"https://github.com/MCKRUZ","@type":"Person","name":"MCKRUZ"},"datePublished":"2016-08-26T19:51:54Z","url":"https://github.com/microsoft/TypeScript/issues/10567"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ae9fe5fb-4ec9-b454-a870-bc169222ee96
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC17E:345E84:477EF4:62D27D:6B049F7E
html-safe-nonceb65ab90ce073d7f8175cc50ce7cf9a81929c1ffc4359098c37ab5d8953e6830b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTdFOjM0NUU4NDo0NzdFRjQ6NjJEMjdEOjZCMDQ5RjdFIiwidmlzaXRvcl9pZCI6IjI4NjIzMzcxNTYxMzgxODA0NzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac389999a6ae61a65c789462ce6fcd3dce0bacb43f30d7231a462be8f070a674c0
hovercard-subject-tagissue:173530271
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/10567/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2a8900b2522df4856b8d571a079ca0a41ed41352a20cb44481d003138e1735fb/microsoft/TypeScript/issues/10567
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2a8900b2522df4856b8d571a079ca0a41ed41352a20cb44481d003138e1735fb/microsoft/TypeScript/issues/10567
og:image:altTypeScript Version: 1.8.0 Code I have two projects. One I'm building general gulp tasks in. One I'm consuming those general gulp tasks. Project 1 contains a class called TasksTools that lives in a ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameMCKRUZ
hostnamegithub.com
expected-hostnamegithub.com
None9784b6f42e2d5eac4e394fa88cad134c0dc5b6662b4ff2787a1ed1ef5a96331d
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3fd14143b75b2af7b76bbd23b069867d091adfcc
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/10567#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F10567
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F10567
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/10567
Reloadhttps://github.com/microsoft/TypeScript/issues/10567
Reloadhttps://github.com/microsoft/TypeScript/issues/10567
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests318 (318)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/10567
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/10567
Cannot find module X...https://github.com/microsoft/TypeScript/issues/10567#top
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
TypeScript 2.0.2https://github.com/microsoft/TypeScript/milestone/24
https://github.com/MCKRUZ
Matt Kruczek (MCKRUZ)https://github.com/MCKRUZ
on Aug 26, 2016https://github.com/microsoft/TypeScript/issues/10567#issue-173530271
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Aug 26, 2016https://github.com/microsoft/TypeScript/issues/10567#issuecomment-242836064
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
Needs More InfoThe issue still hasn't been fully clarifiedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20More%20Info%22
on Aug 27, 2016https://github.com/microsoft/TypeScript/issues/10567#event-769589692
https://github.com/MCKRUZ
Matt Kruczek (MCKRUZ)https://github.com/MCKRUZ
on Aug 29, 2016https://github.com/microsoft/TypeScript/issues/10567#issuecomment-243124612
https://github.com/MCKRUZ/GulpTypescriptErrorhttps://github.com/MCKRUZ/GulpTypescriptError
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Aug 29, 2016https://github.com/microsoft/TypeScript/issues/10567#issuecomment-243194692
https://github.com/MCKRUZ
Matt Kruczek (MCKRUZ)https://github.com/MCKRUZ
on Aug 29, 2016https://github.com/microsoft/TypeScript/issues/10567#issuecomment-243224455
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Aug 29, 2016https://github.com/microsoft/TypeScript/issues/10567#issuecomment-243229909
#9538https://github.com/microsoft/TypeScript/issues/9538
#9646https://github.com/microsoft/TypeScript/pull/9646
https://github.com/MCKRUZ
Matt Kruczek (MCKRUZ)https://github.com/MCKRUZ
on Aug 29, 2016https://github.com/microsoft/TypeScript/issues/10567#issuecomment-243231868
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Aug 29, 2016https://github.com/microsoft/TypeScript/issues/10567#issuecomment-243232516
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Aug 29, 2016https://github.com/microsoft/TypeScript/issues/10567#issuecomment-243232677
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
Needs More InfoThe issue still hasn't been fully clarifiedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20More%20Info%22
on Aug 29, 2016https://github.com/microsoft/TypeScript/issues/10567#event-771180859
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Aug 29, 2016https://github.com/microsoft/TypeScript/issues/10567#event-771180903
https://github.com/MCKRUZ
Matt Kruczek (MCKRUZ)https://github.com/MCKRUZ
on Aug 29, 2016https://github.com/microsoft/TypeScript/issues/10567#issuecomment-243233171
https://github.com/MCKRUZ
Matt Kruczek (MCKRUZ)https://github.com/MCKRUZ
on Aug 29, 2016https://github.com/microsoft/TypeScript/issues/10567#issuecomment-243233405
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
on Aug 29, 2016https://github.com/microsoft/TypeScript/issues/10567#event-771397179
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Aug 29, 2016https://github.com/microsoft/TypeScript/issues/10567#event-771397207
https://github.com/MCKRUZ
Matt Kruczek (MCKRUZ)https://github.com/MCKRUZ
on Aug 31, 2016https://github.com/microsoft/TypeScript/issues/10567#issuecomment-243743837
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Aug 31, 2016https://github.com/microsoft/TypeScript/issues/10567#issuecomment-243836814
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Aug 31, 2016https://github.com/microsoft/TypeScript/issues/10567#issuecomment-243840988
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Aug 31, 2016https://github.com/microsoft/TypeScript/issues/10567#event-774005144
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
on Aug 31, 2016https://github.com/microsoft/TypeScript/issues/10567#event-774005250
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.1https://github.com/microsoft/TypeScript/milestone/20
on Aug 31, 2016https://github.com/microsoft/TypeScript/issues/10567#event-774005304
https://github.com/MCKRUZ
Matt Kruczek (MCKRUZ)https://github.com/MCKRUZ
on Aug 31, 2016https://github.com/microsoft/TypeScript/issues/10567#issuecomment-243842302
#10567https://github.com/microsoft/TypeScript/issues/10567
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Aug 31, 2016https://github.com/microsoft/TypeScript/issues/10567#issuecomment-243842625
https://blogs.msdn.microsoft.com/typescript/2016/08/30/announcing-typescript-2-0-rc/https://blogs.msdn.microsoft.com/typescript/2016/08/30/announcing-typescript-2-0-rc/
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.0.2https://github.com/microsoft/TypeScript/milestone/24
TypeScript 2.1https://github.com/microsoft/TypeScript/milestone/20
on Aug 31, 2016https://github.com/microsoft/TypeScript/issues/10567#event-774012717
microsofthttps://github.com/microsoft
on Jun 19, 2018https://github.com/microsoft/TypeScript/issues/10567#event-1689911298
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/10567
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/10567
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
TypeScript 2.0.2https://github.com/microsoft/TypeScript/milestone/24
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.