简体   繁体   中英

Global NPM package not installing

I have written a command line utility in JS which can be used to backup data to IPFS.

https://www.npmjs.com/package/ipfs-backup

When I am attempting to install it with npm install -g ipfs-backup I am getting an error which prevents the package from being installed.

The terminal is outputting the following:

npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path C:\Users\jwhit\AppData\Roaming\npm\node_modules\ipfs-backup\node index.js
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, chmod 'C:\Users\jwhit\AppData\Roaming\npm\node_modules\ipfs-backup\node index.js'
npm ERR! enoent This is related to npm not being able to find a file.

The issue turned out to be that within my package.json file I had

"bin": {
    "ipfs-backup": "node index.js",
    "ipfs-restore": "node restore.js"
}

instead of

"bin": {
    "ipfs-backup": "./index.js",
    "ipfs-restore": "./restore.js"
}

It installs and functions correctly now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM