npm运行部署失败

npm运行部署失败,npm,blockchain,smartcontracts,nearprotocol,Npm,Blockchain,Smartcontracts,Nearprotocol,这是我上一篇文章的后续->我现在正试图通过npm运行部署,但是,它似乎在以下方面失败了 //helper.testnet.near.org, file: ./out/main.wasm An error occured Error: ENOENT: no such file or directory, open './out/main.wasm' at Object.openSync (fs.js:476:3) at Object.readFileSync (fs.js:377:

这是我上一篇文章的后续->我现在正试图通过npm运行部署,但是,它似乎在以下方面失败了

//helper.testnet.near.org, file: ./out/main.wasm
An error occured
Error: ENOENT: no such file or directory, open './out/main.wasm'
    at Object.openSync (fs.js:476:3)
    at Object.readFileSync (fs.js:377:35)
    at exports.deploy (/Users/User_Name/Desktop/nearTest/testVote/node_modules/near-cli/index.js:42:49)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Object.handler (/Users/User_Name/Desktop/nearTest/testVote/node_modules/near-cli/utils/exit-on-error.js:39:9) {
  [stack]: "Error: ENOENT: no such file or directory, open './out/main.wasm'\n" +
    '    at Object.openSync (fs.js:476:3)\n' +
    '    at Object.readFileSync (fs.js:377:35)\n' +
    '    at exports.deploy (/Users/User_Name/Desktop/nearTest/testVote/node_modules/near-cli/index.js:42:49)\n' +
    '    at processTicksAndRejections (internal/process/task_queues.js:93:5)\n' +
    '    at async Object.handler (/Users/User_Name/Desktop/nearTest/testVote/node_modules/near-cli/utils/exit-on-error.js:39:9)',
  [message]: "ENOENT: no such file or directory, open './out/main.wasm'",
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: './out/main.wasm'
}```
如果您正在使用它,正如此错误所提示的那样,所生成的二进制文件应该位于
/out/main.wasm
。目前有一个脚本,
compile
,它创建了一个从二进制文件到
out/main.wasm
的符号链接,该链接用于调试或发布。脚本中的以下内容是硬编码的,预期名称为
greeter.wasm

`./build/${debug?'debug':'release'}/greeter.wasm`

因此,我的猜测是,如果您重命名了该项目,而它却在默默地失败。在解决此问题之前,请尝试将上述内容更改为生成的wasm文件的名称。

如何知道生成的wasm文件的名称?另外,当我打开out文件夹看到里面的main.wasm时,我有点困惑。我想我已经发现问题是main.wasm存在于我的out文件夹中,但不知为什么没有注册?基本上,如果我进入mac上的finder并搜索目录,我会在out目录中看到main.wasm文件。但是,如果我通过文件树查看VS代码main.wasm不存在于out文件夹中,并且我也不能在out文件夹中创建新文件?出现错误。您应该能够在
build/(release/debug)/
文件夹中看到该文件。如前所述,创建应用程序附近的新更改将创建指向该文件的符号链接。这也可能是罪魁祸首。因此,您可以尝试在build目录中定位该文件,并将其复制到
out
中,重命名它
main.wasm
。你能
cd
进入out目录吗?