0

I'm having trouble figuring out the issue while packaging Smart Contract on the IBM Blockchain Platform on Visual Studio Code. I installed the following:

Node.js v14.16.0 npm 6.14.11 Docker version 19.03.13, build cd8016b6bc docker-compose version 1.25.5, build unknown

I successfully create a new smart contract project. When I ram command - package open project in Command Pallete. I received this error message:

> Executing task in folder demoContract: npm run build <


> demoContract@0.0.1 build /home/shubham14/Desktop/Major project - blockchain/demoContract
> tsc

sh: 1: tsc: not found

npm ERR! code ELIFECYCLE

npm ERR! syscall spawn

npm ERR! file sh

npm ERR! errno ENOENT

npm ERR! demoContract@0.0.1 build: `tsc`

npm ERR! spawn ENOENT

npm ERR! 

npm ERR! Failed at the demoContract@0.0.1 build script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:

npm ERR!     /home/shubham14/.npm/_logs/2021-03-03T11_38_29_505Z-debug.log
The terminal process "/bin/bash '-c', 'npm run build'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

**Debug-log :**
0 info it worked if it ends with ok

1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build' ]

2 info using npm@6.14.11

3 info using node@v14.16.0

4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]

5 info lifecycle demoContract@0.0.1~prebuild: demoContract@0.0.1

6 info lifecycle demoContract@0.0.1~build: demoContract@0.0.1

7 verbose lifecycle demoContract@0.0.1~build: unsafe-perm in lifecycle true

8 verbose lifecycle demoContract@0.0.1~build: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/shubham14/Desktop/Major project - blockchain/demoContract/node_modules/.bin:/home/shubham14/Desktop/jdk-14/bin:/home/shubham14/anaconda3/lib/graphviz:/home/apache-maven-3.6.3/bin:/home/shubham14/anaconda3/bin:/home/shubham14/anaconda3/condabin:/home/shubham14/jdk-14_linux-x64_bin/jdk-14/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

9 verbose lifecycle demoContract@0.0.1~build: CWD: /home/shubham14/Desktop/Major project - blockchain/demoContract

10 silly lifecycle demoContract@0.0.1~build: Args: [ '-c', 'tsc' ]

11 info lifecycle demoContract@0.0.1~build: Failed to exec build script

12 verbose stack Error: demoContract@0.0.1 build: `tsc`
12 verbose stack spawn ENOENT
12 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack     at ChildProcess.emit (events.js:315:20)
12 verbose stack     at maybeClose (internal/child_process.js:1048:16)
12 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)

13 verbose pkgid demoContract@0.0.1

14 verbose cwd /home/shubham14/Desktop/Major project - blockchain/demoContract

15 verbose Linux 5.4.0-42-generic

16 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"

17 verbose node v14.16.0

18 verbose npm  v6.14.11

19 error code ELIFECYCLE

20 error syscall spawn

21 error file sh

22 error errno ENOENT

23 error demoContract@0.0.1 build: `tsc`

23 error spawn ENOENT

24 error Failed at the demoContract@0.0.1 build script.

24 error This is probably not a problem with npm. There is likely additional logging output above.

25 verbose exit [ 1, true ]
elbik
  • 1,749
  • 2
  • 16
  • 21

1 Answers1

0

Try running npm install first (and maybe even reloading VS Code afterwards).

Jake
  • 124
  • 1