Skip to content

NPM Error - Missing script: "tsc" #101

Open
@adrianaryaputra

Description

@adrianaryaputra

Hello, i got following Error Output while creating new project :

npm ERR! Missing script: "tsc"
npm ERR! 
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ad/.npm/_logs/2021-10-02T16_49_07_972Z-debug.log
node:child_process:826
    err = new Error(msg);
          ^

Error: Command failed: npm run tsc --init --resolveJsonModule --target es6
npm ERR! Missing script: "tsc"
npm ERR! 
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ad/.npm/_logs/2021-10-02T16_49_07_972Z-debug.log

    at checkExecSyncError (node:child_process:826:11)
    at Object.execSync (node:child_process:900:15)
    at PackageManager.createTsconfig (/usr/local/lib/node_modules/slappey/lib/Manager.js:43:32)
    at PackageManager.installDependencies (/usr/local/lib/node_modules/slappey/lib/Manager.js:51:25)
    at PackageManager.initializeNPM (/usr/local/lib/node_modules/slappey/lib/Manager.js:34:21)
    at PackageManager.<anonymous> (/usr/local/lib/node_modules/slappey/lib/Manager.js:27:24)
    at Generator.next (<anonymous>)
    at /usr/local/lib/node_modules/slappey/lib/Manager.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/local/lib/node_modules/slappey/lib/Manager.js:4:12) {
  status: 1,
  signal: null,
  output: [
    null,
    Buffer(0) [Uint8Array] [],
    Buffer(222) [Uint8Array] [
      110, 112, 109,  32,  69,  82,  82,  33,  32,  77, 105, 115,
      115, 105, 110, 103,  32, 115,  99, 114, 105, 112, 116,  58,
       32,  34, 116, 115,  99,  34,  10, 110, 112, 109,  32,  69,
       82,  82,  33,  32,  10, 110, 112, 109,  32,  69,  82,  82,
       33,  32,  84, 111,  32, 115, 101, 101,  32,  97,  32, 108,
      105, 115, 116,  32, 111, 102,  32, 115,  99, 114, 105, 112,
      116, 115,  44,  32, 114, 117, 110,  58,  10, 110, 112, 109,
       32,  69,  82,  82,  33,  32,  32,  32, 110, 112, 109,  32,
      114, 117, 110,  10,
      ... 122 more items
    ]
  ],
  pid: 90159,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(222) [Uint8Array] [
    110, 112, 109,  32,  69,  82,  82,  33,  32,  77, 105, 115,
    115, 105, 110, 103,  32, 115,  99, 114, 105, 112, 116,  58,
     32,  34, 116, 115,  99,  34,  10, 110, 112, 109,  32,  69,
     82,  82,  33,  32,  10, 110, 112, 109,  32,  69,  82,  82,
     33,  32,  84, 111,  32, 115, 101, 101,  32,  97,  32, 108,
    105, 115, 116,  32, 111, 102,  32, 115,  99, 114, 105, 112,
    116, 115,  44,  32, 114, 117, 110,  58,  10, 110, 112, 109,
     32,  69,  82,  82,  33,  32,  32,  32, 110, 112, 109,  32,
    114, 117, 110,  10,
    ... 122 more items
  ]
}

error log :

0 verbose cli [
0 verbose cli   '/usr/local/bin/node',
0 verbose cli   '/usr/local/bin/npm',
0 verbose cli   'run',
0 verbose cli   'tsc',
0 verbose cli   '--init',
0 verbose cli   '--resolveJsonModule',
0 verbose cli   '--target',
0 verbose cli   'es6'
0 verbose cli ]
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/home/ad/Project/_discordbot/wov-stalker/wov-stalker/.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:/home/ad/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 7ms
19 timing npm:load:configload Completed in 7ms
20 timing npm:load:setTitle Completed in 0ms
21 timing npm:load:setupLog Completed in 0ms
22 timing config:load:flatten Completed in 2ms
23 timing npm:load:cleanupLog Completed in 2ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 0ms
26 timing npm:load Completed in 11ms
27 timing command:run-script Completed in 12ms
28 verbose stack Error: Missing script: "tsc"
28 verbose stack
28 verbose stack To see a list of scripts, run:
28 verbose stack   npm run
28 verbose stack     at RunScript.run (/usr/local/lib/node_modules/npm/lib/run-script.js:104:13)
29 verbose cwd /home/ad/Project/_discordbot/wov-stalker/wov-stalker
30 verbose Linux 5.7.6-050706-generic
31 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "tsc" "--init" "--resolveJsonModule" "--target" "es6"
32 verbose node v16.9.1
33 verbose npm  v7.21.1
34 error Missing script: "tsc"
34 error
34 error To see a list of scripts, run:
34 error   npm run
35 verbose exit 1

my quick fix:
changing following line on Manager.js:

createTsconfig() {
        var _a;
        return child_process_1.execSync(`${(_a = this.config) === null || _a === void 0 ? void 0 : _a.manager} run tsc --init --resolveJsonModule --target es6`, { cwd: this.filePath });
    }

into

createTsconfig() {
        var _a;
        return child_process_1.execSync(`tsc --init --resolveJsonModule --target es6`, { cwd: this.filePath });
    }

install tsc as global module, and run slappey normally.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions