Since the application is developed and published in the local environment built by dot installation, an error occurred when I tried to install heroku. [[For beginners] How to reliably deploy rails app using heroku [Definitive edition]](https://qiita.com/kazukimatsumoto/items/a0daa7281a3948701c39#%E8%87%AA%E5%88%86% E3% 81% AE% E7% 92% B0% E5% A2% 83) I was referring to this article. However, when I installed heroku, the development environment for this article was completely different, so I couldn't go any further and had to fight the error.
I didn't make a copy of the error because I was desperate to resolve it, but I think I got an error like this.
↓ Last sentence of error Your path is missing /usr/local/bin, you need to add this to use this installer.
It is said that there is no path for
/ usr / local / bin, so it seems that you need to create a path.
Check the path
$ echo $PATH
I will check the path, but it seems that it is useless if there is
/ usr / local / bin: but there is no
/ usr / local / bin.
sudo is a command with high authority in my interpretation.
There is also a difference between
# has higher authority. (Because I was able to do what I couldn't do with
Refer to the following for the
sudo settings required to set the path.
What you want to set after building the virtual environment-Memo-
This is kinder to set
Inherit the PATH of the executing user when sudo on CentOS
$ sudo visudo
Since it was necessary to operate the vi editor after executing, I referred to the following. How to use the vi editor
$ heroku --version
When I check the version of heroku, I get the following error ...
/usr/local/lib/heroku/node_modules/@oclif/command/lib/index.js:3 const path = require("path"); ^^^^^ SyntaxError: Use of const in strict mode. at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (/usr/local/lib/heroku/bin/run:5:1) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32)
It seems that the version of Node.js is too old.
$ node -v
When I checked it, it was
I've tried many things and I'm sorry if it doesn't work as a direct solution.
npm was not installed, so I installed it. Also install
I don't know if I need
npm to get
Heroku, but I installed it for now.
$ sudo yum install nodejs npm
Go towards great authority.
$ sudo -s
The one on the left changes from
The one you need to install (honestly, I'm not sure, but specify the version to install in the number part of
# curl --silent --location https://rpm.nodesource.com/setup_11.x | bash
From here, I've been installing and uninstalling repeatedly, so I'm sorry if the procedure is wrong. I referred to the following. I want you to read it ahead. Story and solution for nodejs version upgrade on yum
Delete the old rpm.
# rm /etc/yum.repos.d/nodesource-el.repo
# yum -y remove nodejs
Delete the cache.
# yum clean all
# yum -y install nodejs
Check the version.
# node -v v11.15.0
It's a success! And get out of great authority.
# su vagrant
Also check the version of heroku
$ heroku -v heroku/7.44.0 linux-x64 node-v11.15.0
Other reference articles. https://qiita.com/daskepon/items/16a77868d38f8e585840 https://inaba.hatenablog.com/entry/2018/11/13/023933
Article with almost the same error https://teratail.com/questions/256490
We would like to thank all the site administrators for their reference.