我有一个npm模块,在bin
中指定了package.json
,bin是用babel编译的文件,在安装软件包时不存在于软件包中。我使用postinstall
脚本运行babel
并生成main
和bin
指向的构建文件。当我全局安装时,我收到此错误:
npm ERR! path /Users/treggi/.nvm/versions/node/v9.2.0/lib/node_modules/my-module-reggi/lib/functionality/bin.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/treggi/.nvm/versions/node/v9.2.0/lib/node_modules/my-module-reggi/lib/functionality/bin.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/treggi/.npm/_logs/2018-02-27T21_23_05_056Z-debug.log
➜ Desktop code /Users/treggi/.npm/_logs/2018-02-27T21_23_05_056Z-debug.log
如何使用babel编译的javascript文件作为bin?