我正在使用Node js进行个人项目,但是在安装node-cron时我总是遇到同样的问题。当在Heroku上部署时,它总是给我下面看到的相同的错误消息,但在本地安装时不会发生。
我试着在网上找到其他有类似问题的人,但似乎什么都没有出现。如果有人能找到解决方案,我将不胜感激!
> node-cron@2.0.3 postinstall /tmp/build_13203812b696ff71f401fd657fdd6fdd/node_modules/node-cron
remote: > opencollective-postinstall
remote:
remote: sh: 1: opencollective-postinstall: Permission denied
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 126
remote: npm ERR! node-cron@2.0.3 postinstall: `opencollective-postinstall`
remote: npm ERR! Exit status 126
remote: npm ERR!
remote: npm ERR! Failed at the node-cron@2.0.3 postinstall script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.发布于 2019-05-27 03:38:07
尝试在package.json中的postinstall脚本末尾添加|| exit 0,以确保这不会停止npm安装过程。
发布于 2020-08-06 04:16:18
实际上问题出在opencollective上,因为node-cron使用了这个,所以问题就来了。
在您的package.json中安装opencollective-postinstall npm包并添加postinstall脚本:
"postinstall": "opencollective-postinstall || exit 0"使用exit 0是为了防止即使脚本失败,进程也无法停止。
https://github.com/mattezell/ngx-infinite-scroll/commit/fc7165bd099145321235948723ee6e644ded65a8
https://stackoverflow.com/questions/56316591
复制相似问题