运行命令truffle init时出错

时间:2018-04-21 04:09:41

标签: node.js ethereum solidity smartcontracts truffle

我是智能合约编程的新手,最近在节点上使用npm安装了松露(9.11.1)当我第一次运行命令truffle init时,我收到了这个错误:

Error: Cannot find module 'original-require'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.Module._load (internal/modules/cjs/loader.js:475:25)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.<anonymous> (C:\Users\saura\AppData\Roaming\npm\node_modules\truffle\build\webpack:\external "original-require":1:1)
    at __webpack_require__ (C:\Users\saura\AppData\Roaming\npm\node_modules\truffle\build\webpack:\webpack\bootstrap 1e465420bd4a8d34abd9:19:1)
    at Object.<anonymous> (C:\Users\saura\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\truffle-config\index.js:8:1)
    at Object.<anonymous> (C:\Users\saura\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:2394:30)
    at __webpack_require__ (C:\Users\saura\AppData\Roaming\npm\node_modules\truffle\build\webpack:\webpack\bootstrap 1e465420bd4a8d34abd9:19:1)
    at Object.<anonymous> (C:\Users\saura\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\truffle-core\cli.js:3:1)

有任何解决此错误的建议。

1 个答案:

答案 0 :(得分:1)

我认为你需要运行这个命令:

npm install original-require