NPM安装全局试图在postinstall之前移动bin

时间:2018-02-27 21:28:27

标签: javascript node.js npm babel

我有一个npm模块,在bin中指定了package.json,bin是用babel编译的文件,在安装软件包时不存在于软件包中。我使用postinstall脚本运行babel并生成mainbin指向的构建文件。当我全局安装时,我收到此错误:

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?

0 个答案:

没有答案