简体   繁体   English

Heroku 节点 installArchSpecificPackage 部署问题

[英]Heroku deployment issue at node installArchSpecificPackage

(Story) So my MERN app works fine on localhost and all paths and json files have been taken care of... proxy, scrips, NODE_ENV, etc... then this new dumb error showed up. (故事)所以我的 MERN 应用程序在本地主机上运行良好,所有路径和 json 文件都已得到处理...代理、脚本、NODE_ENV 等...然后出现了这个新的愚蠢错误。 I have been trying to get this to work for a month.我一直试图让这个工作一个月。 My file structure wasn't right before and I still got it to deploy by changing the deployment paths but the server was giving a 404 for the axios calls to MongoDB Atlas using Express.我的文件结构之前不正确,我仍然通过更改部署路径来部署它,但服务器使用 Express 为 axios 调用 MongoDB Atlas 提供 404。

So I put the whole thing together in the right file structure, set the environment variable for ATLAS_URI and after resolving a ton of errors I am stuck on this last one, hopefully.因此,我将所有内容放在正确的文件结构中,为 ATLAS_URI 设置环境变量,在解决了大量错误后,我希望能够解决最后一个问题。 Please help me get rid of it.请帮我摆脱它。

(Problem) Not able to deploy on heroku. It's working fine locally. (问题)无法在 heroku 上部署。它在本地工作正常。

Error Log after doing git push heroku master git push heroku master后的错误日志

Total 4619 (delta 1796), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Node.js app detected
remote:        
remote: -----> Creating runtime environment
remote:        
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:        NODE_VERBOSE=false
remote:        
remote: -----> Installing binaries
remote:        engines.node (package.json):  ^8.15.0
remote:        engines.npm (package.json):   ^6.4.1
remote:        
remote:        Resolving node version ^8.15.0...
remote:        Downloading and installing node 8.17.0
remote:        Bootstrapping npm ^6.4.1 (replacing 6.13.4)...
remote:        npm ^6.4.1 installed
remote:        
remote: -----> Restoring cache
remote:        Cached directories were not restored due to a change in version of node, npm, yarn or stack
remote:        Module installation may take longer for this build
remote:        
remote: -----> Installing dependencies
remote:        Prebuild detected (node_modules already exists)
remote:        Rebuilding any native modules
remote:        
remote:        > node@8.15.0 preinstall /tmp/build_a457d1d9/node_modules/node
remote:        > node installArchSpecificPackage
remote:        
remote:        /tmp/build_a457d1d9/node_modules/node/node_modules/.bin/node: 1: /tmp/build_a457d1d9/node_modules/node/node_modules/.bin/node: �����H: not found
remote:        /tmp/build_a457d1d9/node_modules/node/node_modules/.bin/node: 2: /tmp/build_a457d1d9/node_modules/node/node_modules/.bin/node: Syntax error: "(" unexpected
remote:        module.js:550
remote:            throw err;
remote:            ^
remote:        
remote:        Error: Cannot find module 'node-linux-x64/package.json'
remote:            at Function.Module._resolveFilename (module.js:548:15)
remote:            at Function.resolve (internal/module.js:18:19)
remote:            at ChildProcess.<anonymous> (/tmp/build_a457d1d9/node_modules/node-bin-setup/index.js:18:27)
remote:            at emitTwo (events.js:126:13)
remote:            at ChildProcess.emit (events.js:214:7)
remote:            at maybeClose (internal/child_process.js:915:16)
remote:            at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
remote:        npm ERR! code ELIFECYCLE
remote:        npm ERR! errno 1
remote:        npm ERR! node@8.15.0 preinstall: node installArchSpecificPackage
remote:        npm ERR! Exit status 1
remote:        npm ERR! 
remote:        npm ERR! Failed at the node@8.15.0 preinstall script.
remote:        npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I'm new to this.我对此很陌生。 Please tell me exactly what to do without much jargon.请准确地告诉我该怎么做,不要用太多行话。 Any help is much appreciated.任何帮助深表感谢。 Thanks!谢谢!

Okay I found out how to do this.好吧,我知道怎么做了。 Just delete the node_modules folder in the source (server.. not client) directory and try again.只需删除源(服务器..不是客户端)目录中的 node_modules 文件夹,然后重试。 It should work like a charm...它应该像一个魅力...

Found it here Error while pushing to Heroku: Cannot find module 'node-linux-x64/package.json' Thanks guys在这里找到它推送到 Heroku 时出错:找不到模块 'node-linux-x64/package.json'谢谢大家

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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