推送到Heroku时出错:找不到模块"node-linux-x64/package.json" [英] Error while pushing to Heroku: Cannot find module 'node-linux-x64/package.json'

查看:215
本文介绍了推送到Heroku时出错:找不到模块"node-linux-x64/package.json"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将完整的Javascript应用程序部署到Heroku时,出现以下错误:

When deploying a fullstack Javascript app to Heroku, I receive the following error:

Error: Cannot find module 'node-linux-x64/package.json'

还有一个语法错误,但我不认为这是原因.

There's also a syntax error, but I don't believe that's the cause.

我是Mac用户,所以我不确定发生了什么.我检查了语法错误,但一无所获.我也尝试过卸载并重新安装Node等.

I'm a Mac user, so I'm unsure of what's going on. I've checked for the syntax error, but found nothing. I also tried uninstalling and reinstalling Node, etc...

输出:

remote: -----> Installing dependencies
remote:        Prebuild detected (node_modules already exists)
remote:        Rebuilding any native modules
remote:
remote:        > node@12.4.0 preinstall /tmp/build_133f585dc02170b5c24a22d3bb3002bd/node_modules/node
remote:        > node installArchSpecificPackage
remote:
remote:        /tmp/build_133f585dc02170b5c24a22d3bb3002bd/node_modules/node/node_modules/.bin/node: 1: /tmp/build_133f585dc02170b5c24a22d3bb3002bd/node_modules/node/node_modules/.bin/node: �����: not found
remote:        /tmp/build_133f585dc02170b5c24a22d3bb3002bd/node_modules/node/node_modules/.bin/node: 41: /tmp/build_133f585dc02170b5c24a22d3bb3002bd/node_modules/node/node_modules/.bin/node: Syntax error: ")" unexpected
remote:        internal/modules/cjs/loader.js:638
remote:            throw err;
remote:            ^
remote:
remote:        Error: Cannot find module 'node-linux-x64/package.json'
remote:            at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
remote:            at Function.resolve (internal/modules/cjs/helpers.js:33:19)
remote:            at ChildProcess.<anonymous> (/tmp/build_133f585dc02170b5c24a22d3bb3002bd/node_modules/node-bin-setup/index.js:18:27)
remote:            at ChildProcess.emit (events.js:198:13)
remote:            at maybeClose (internal/child_process.js:982:16)
remote:            at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
remote:        npm ERR! code ELIFECYCLE
remote:        npm ERR! errno 1
remote:        npm ERR! node@12.4.0 preinstall: `node installArchSpecificPackage`
remote:        npm ERR! Exit status 1
remote:        npm ERR!
remote:        npm ERR! Failed at the node@12.4.0 preinstall script.
remote:        npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote:        npm ERR! A complete log of this run can be found in:
remote:        npm ERR!     /tmp/npmcache.nPBvI/_logs/2019-06-25T15_20_23_924Z-debug.log
remote:
remote: -----> Build failed
remote:
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys

推荐答案

我最终删除了我安装在package.json中的节点依赖项,它的工作原理很吸引人.谢谢你们的回答,希望这对遇到此问题的其他人有所帮助.

I ended up deleting the node dependency I installed in my package.json and it worked like a charm. Thanks for the answers guys, hope this helps anyone else that runs into this.

这篇关于推送到Heroku时出错:找不到模块"node-linux-x64/package.json"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆