我用JS编写了一个命令行实用程序,可用于将数据备份到IPFS。
https://www.npmjs.com/package/ipfs-backup
当我试图用npm install -g ipfs-backup
安装它时,我遇到了一个错误,导致无法安装该包。
终端正在输出以下内容:
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path C:UsersjwhitAppDataRoamingnpmnode_modulesipfs-backupnode index.js
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, chmod 'C:UsersjwhitAppDataRoamingnpmnode_modulesipfs-backupnode index.js'
npm ERR! enoent This is related to npm not being able to find a file.
问题是在我的package.json文件中我有
"bin": {
"ipfs-backup": "node index.js",
"ipfs-restore": "node restore.js"
}
而不是
"bin": {
"ipfs-backup": "./index.js",
"ipfs-restore": "./restore.js"
}
它现在安装和运行正常。