【问题标题】:IBM blockchain platform Visual Studio Code : Error while Packaging Smart ContractIBM 区块链平台 Visual Studio Code:打包智能合约时出错
【发布时间】:2021-03-03 11:48:47
【问题描述】:

我在 Visual Studio Code 上的 IBM Blockchain Platform 上打包智能合约时遇到了问题。我安装了以下内容:

Node.js v14.16.0 npm 6.14.11 Docker 版本 19.03.13,构建 cd8016b6bc docker-compose 版本 1.25.5,构建未知

我成功创建了一个新的智能合约项目。当我 ram 命令 - 在 Command Pallete 中打包打开项目。 我收到此错误消息:

> 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 ]

【问题讨论】:

    标签: npm visual-studio-code hyperledger-fabric blockchain ibm-blockchain


    【解决方案1】:

    尝试先运行npm install(甚至可能在之后重新加载 VS Code)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-23
      • 1970-01-01
      • 1970-01-01
      • 2022-06-18
      • 1970-01-01
      • 1970-01-01
      • 2021-07-29
      相关资源
      最近更新 更多