ERPNext installation is failing on freshly installed Ubuntu 22.04.1 LTS

Hello,

I am trying to install ERPNext 13 on a fresh system. The OS is Ubuntu 22.04.1 LTS.

I am following the steps listed by Humenth on Github.

But the installation is failing at Step #15. Here instead of version 14 I want to install version 13.

bench init erp13 --verbose --version version-13

Here is the error part of the output.

gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/home/erpnext/erp13/apps/frappe/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/home/erpnext/erp13/apps/frappe/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/home/erpnext/erp13/apps/frappe/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /home/erpnext/erp13/apps/frappe/node_modules/which/which.js:89:16
gyp verb `which` failed     at /home/erpnext/erp13/apps/frappe/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /home/erpnext/erp13/apps/frappe/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:206:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/home/erpnext/erp13/apps/frappe/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/home/erpnext/erp13/apps/frappe/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/home/erpnext/erp13/apps/frappe/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /home/erpnext/erp13/apps/frappe/node_modules/which/which.js:89:16
gyp verb `which` failed     at /home/erpnext/erp13/apps/frappe/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /home/erpnext/erp13/apps/frappe/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:206:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (/home/erpnext/erp13/apps/frappe/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/home/erpnext/erp13/apps/frappe/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/home/erpnext/erp13/apps/frappe/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /home/erpnext/erp13/apps/frappe/node_modules/which/which.js:89:16
gyp verb `which` failed     at /home/erpnext/erp13/apps/frappe/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /home/erpnext/erp13/apps/frappe/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:206:21)
gyp verb `which` failed  python Error: not found: python
gyp verb `which` failed     at getNotFoundError (/home/erpnext/erp13/apps/frappe/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/home/erpnext/erp13/apps/frappe/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/home/erpnext/erp13/apps/frappe/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /home/erpnext/erp13/apps/frappe/node_modules/which/which.js:89:16
gyp verb `which` failed     at /home/erpnext/erp13/apps/frappe/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /home/erpnext/erp13/apps/frappe/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:206:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/home/erpnext/erp13/apps/frappe/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/home/erpnext/erp13/apps/frappe/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack     at F (/home/erpnext/erp13/apps/frappe/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/home/erpnext/erp13/apps/frappe/node_modules/which/which.js:80:29)
gyp ERR! stack     at /home/erpnext/erp13/apps/frappe/node_modules/which/which.js:89:16
gyp ERR! stack     at /home/erpnext/erp13/apps/frappe/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /home/erpnext/erp13/apps/frappe/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:206:21)
gyp ERR! System Linux 5.15.0-47-generic
gyp ERR! command "/home/erpnext/.nvm/versions/node/v16.17.0/bin/node" "/home/erpnext/erp13/apps/frappe/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/erpnext/erp13/apps/frappe/node_modules/node-sass
gyp ERR! node -v v16.17.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 


Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/bench/commands/make.py", line 68, in init
    init(
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/render.py", line 105, in wrapper_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/system.py", line 79, in init
    get_app(
  File "/usr/local/lib/python3.10/dist-packages/bench/app.py", line 432, in get_app
    app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bench/app.py", line 230, in install
    install_app(
  File "/usr/local/lib/python3.10/dist-packages/bench/app.py", line 569, in install_app
    bench.run("yarn install", cwd=app_path)
  File "/usr/local/lib/python3.10/dist-packages/bench/bench.py", line 47, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/__init__.py", line 155, in exec_cmd
    raise CommandFailedError
bench.exceptions.CommandFailedError

But version 14 is getting installed properly.

What must be the problem and how to solve it?

TIA

Yogi Yang

Hi,

What do the commands python3 -V and npm -v gyp return?

Hello,

Python 3.10.4

8.5.1

TIA

Yogi Yang

whats the output for

which python3

or

which python2

Hello,

The commands return following.

erpnext@ubuntu22d:~$ which python3
/usr/bin/python3
erpnext@ubuntu22d:~$ which python2

Python2 returns nothing!

TIA

Yogi Yang

and what the output for

npm config ls

and

npm config ls -l

Hello,

erpnext@ubuntu22d:~$ npm config ls
; node bin location = /home/erpnext/.nvm/versions/node/v16.17.0/bin/node
; node version = v16.17.0
; npm local prefix = /home/erpnext
; npm version = 8.15.0
; cwd = /home/erpnext
; HOME = /home/erpnext
; Run `npm config ls -l` to show all defaults.
rpnext@ubuntu22d:~$ npm config ls -l
; "default" config from default values

_auth = (protected) 
access = null 
all = false 
allow-same-version = false 
also = null 
audit = true 
audit-level = null 
auth-type = "legacy" 
before = null 
bin-links = true 
browser = null 
ca = null 
cache = "/home/erpnext/.npm" 
cache-max = null 
cache-min = 0 
cafile = null 
call = "" 
cert = null 
ci-name = null 
cidr = null 
color = true 
commit-hooks = true 
depth = null 
description = true 
dev = false 
diff = [] 
diff-dst-prefix = "b/" 
diff-ignore-all-space = false 
diff-name-only = false 
diff-no-prefix = false 
diff-src-prefix = "a/" 
diff-text = false 
diff-unified = 3 
dry-run = false 
editor = "vi" 
engine-strict = false 
fetch-retries = 2 
fetch-retry-factor = 10 
fetch-retry-maxtimeout = 60000 
fetch-retry-mintimeout = 10000 
fetch-timeout = 300000 
force = false 
foreground-scripts = false 
format-package-lock = true 
fund = true 
git = "git" 
git-tag-version = true 
global = false 
global-style = false 
globalconfig = "/home/erpnext/.nvm/versions/node/v16.17.0/etc/npmrc" 
heading = "npm" 
https-proxy = null 
if-present = false 
ignore-scripts = false 
include = [] 
include-staged = false 
include-workspace-root = false 
init-author-email = "" 
init-author-name = "" 
init-author-url = "" 
init-license = "ISC" 
init-module = "/home/erpnext/.npm-init.js" 
init-version = "1.0.0" 
init.author.email = "" 
init.author.name = "" 
init.author.url = "" 
init.license = "ISC" 
init.module = "/home/erpnext/.npm-init.js" 
init.version = "1.0.0" 
install-links = false 
json = false 
key = null 
legacy-bundling = false 
legacy-peer-deps = false 
link = false 
local-address = null 
location = "user" 
lockfile-version = null 
loglevel = "notice" 
logs-dir = null 
logs-max = 10 
; long = false ; overridden by cli
maxsockets = 15 
message = "%s" 
metrics-registry = "https://registry.npmjs.org/" 
node-options = null 
node-version = "v16.17.0" 
noproxy = [""] 
npm-version = "8.15.0" 
offline = false 
omit = [] 
omit-lockfile-registry-resolved = false 
only = null 
optional = null 
otp = null 
pack-destination = "." 
package = [] 
package-lock = true 
package-lock-only = false 
parseable = false 
prefer-offline = false 
prefer-online = false 
prefix = "/home/erpnext/.nvm/versions/node/v16.17.0" 
preid = "" 
production = null 
progress = true 
proxy = null 
read-only = false 
rebuild-bundle = true 
registry = "https://registry.npmjs.org/" 
save = true 
save-bundle = false 
save-dev = false 
save-exact = false 
save-optional = false 
save-peer = false 
save-prefix = "^" 
save-prod = false 
scope = "" 
script-shell = null 
searchexclude = "" 
searchlimit = 20 
searchopts = "" 
searchstaleness = 900 
shell = "/bin/bash" 
shrinkwrap = true 
sign-git-commit = false 
sign-git-tag = false 
sso-poll-frequency = 500 
sso-type = "oauth" 
strict-peer-deps = false 
strict-ssl = true 
tag = "latest" 
tag-version-prefix = "v" 
timing = false 
tmp = "/tmp" 
umask = 0 
unicode = false 
update-notifier = true 
usage = false 
user-agent = "npm/{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}" 
userconfig = "/home/erpnext/.npmrc" 
version = false 
versions = false 
viewer = "man" 
which = null 
workspace = [] 
workspaces = null 
workspaces-update = true 
yes = null 

; "cli" config from command line options

long = true

TIA

Yogi Yang

ok its not showing the /usr/bin directory where the python is installed.

try the below

npm config set python python3

and then try the bench command

I followed a guide that said to install ERPNExt 14 on Ubuntu 22, where it indicated that I should install node 16 and there was my suffering…h until I downgraded it to version 14 and everything worked as it should.

Hello,

As I am not an expert in Linux. I will need your assistance in downgrading.

Can you please guide me, how to downgrade NodeJS from 16.x to 14.x?

TIA

Yogi Yang

1 Like

Locate the Binaries
The first step toward uninstalling NodeJS in Ubuntu is finding the folder that houses its binaries. That will enable you to confirm whether NodeJS was uninstalled.

which node
find $(echo $PATH | sed ‘s/: / /g’) -name “node” ---- (Remove space after the : dots)

Uninstall NodeJS
After locating the node binaries, the next step is to remove them.

Option 1: Remove the Path
sudo rm /usr/bin/node

Option 2: Uninstall with the apt or apt-get Command
sudo apt-get remove nodejs

Option 3: Remove All Packages with the purge Command
sudo apt-get purge nodejs
or
sudo apt-get purge – auto-remove nodejs

Let’s reinstall NodeJS

1 Like

Hello @Leo_Sarmiento,

Thanks I managed to setup ERPNExt 13 and 14.

As per your suggestion I installed NodeJS 14 and I did not have to remove NodeJS 16.

I just set NodeJs 14 as default NodeJS.

TIA

Yogi Yang

2 Likes