Error: Cannot find module 'transformer-module'

spark

when I using ttsc command to compile the typescript project, shows error:

> yarn tscbuild
yarn run v1.22.17
$ ttsc

/Users/John/source/reddwarf/frontend/js-wheel/node_modules/resolve/lib/sync.js:111
    var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
              ^
Error: Cannot find module 'transformer-module' from '/Users/John/source/reddwarf/frontend/js-wheel'
    at Function.resolveSync [as sync] (/Users/John/source/reddwarf/frontend/js-wheel/node_modules/resolve/lib/sync.js:111:15)
    at PluginCreator.resolveFactory (/Users/John/source/reddwarf/frontend/js-wheel/node_modules/ttypescript/lib/PluginCreator.js:158:34)
    at PluginCreator.createTransformers (/Users/John/source/reddwarf/frontend/js-wheel/node_modules/ttypescript/lib/PluginCreator.js:120:32)
    at Object.newEmit [as emit] (/Users/John/source/reddwarf/frontend/js-wheel/node_modules/ttypescript/lib/patchCreateProgram.js:76:52)
    at emitFilesAndReportErrors (/Users/John/source/reddwarf/frontend/js-wheel/node_modules/typescript/lib/typescript.js:126134:23)

Am I missing something? I did not found the package named transformer-module. I have already installed ttypescript from the instructions from here https://www.npmjs.com/package/ttypescript. what should I do to fixed this issue? the transformer-module was the plugin of ttypescript. it should be installed by ttypescript.

Pioupia

Referring to the examples provided by ttypescript, and the little information in your question.

I think you have misunderstood how the module works.

The transform key of the plugins object in your tsconfig.json file must be a relative or absolute path to your file. You probably keep the value transform-module specified on their documentation.

For example:

{
    "compilerOptions": {
        "target": "es5",
        "declaration": true,
        "module": "commonjs",
        "strict": true,
        "outDir": "dist",
        "plugins": [
            {
                "transform": "./src/transformers/transformer.ts" /* this line here */
            }
        ]
    },
    "include": ["src/**/*", "node_modules/ttypescript/**/*"],
    "exclude": ["src/transformers/**/*"]
}

Source: their examples (https://github.com/cevek/ttypescript/blob/master/packages/ttypescript-examples/tsconfig.json)

Otherwise, feel free to give more context such as a minimal reproducible example

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Error: Cannot find module './'

From Dev

error 'MODULE NOT FOUND', Cannot find module

From Dev

Error: Cannot find module 'commander'

From Dev

Error: Cannot find module 'mongodb'

From Javascript

Error: Cannot find module html

From Dev

Error: Cannot find module './args'

From Dev

Phonegap error: Cannot find module

From Dev

NPM - Error: Cannot find module '../'

From Dev

Error: Cannot find module 'libxmljs'

From Dev

Error: Cannot find module './development'

From Dev

Error: Cannot find module './algs'

From Dev

Error: Cannot find module 'ms'

From Dev

Error: Cannot find module './pulp'

From Dev

Error: Cannot find module ' in Protractor

From Dev

Error: Cannot find module 'cors'

From Dev

TypeScript cannot find module error

From Dev

Error: Cannot find module 'togeojson'

From Dev

Error - Cannot find module 'broccoli'

From Dev

Error: Cannot find module './lodash'

From Dev

Error: Cannot find module 'AsyncDependencyToInitialChunkWarning'

From Dev

Error: Error: Cannot find module ' in angular js?

From Dev

react-native bundling failed: Error: Cannot find module /metro-react-native-babel-transformer/src/index.js

From Dev

Error: Cannot find module 'app/MyComponent/MyComponent.module' Error: Cannot find module

From Dev

Heroku error: 'cannot find module 'express'

From Dev

TypeScript error: Cannot find module 'moment'

From Dev

After Firebase deploy - Error: cannot find module

From Dev

Cannot find Python error "ImportError: No module"

From Dev

Parsing error : Cannot find module 'next/babel'

From Dev

Error when run the test "Cannot find module "