Error in Syntax "bench init erpnext && cd erpnext"

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/opt/bench/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/bench/bench-repo/bench/commands/make.py”, line 30, in init
python = python)
File “/opt/bench/bench-repo/bench/utils.py”, line 52, in init
raise ValueError(‘Bench Instance {path} already exists.’.format(path = path))
ValueError: Bench Instance erpnext already exists.

I have no idea, why this error happen
Please give me clue to fix my error because i have been search it for 2 days but still can’t solve this error

It looks like you have installed bench but not erpnext, and are now trying to install bench again. You can probably just delete the subdirectory called “frappe-bench”, and then run the command again

Thanks, but when i delete frappe-bench and erpnext. I run command

  1. cd /opt/bench. And then
  2. bench init erpnext. But, error happen again

bench@andrewdavewt-X450LCP:~$ bench init erpnext
INFO:bench.utils:virtualenv -q env -p /usr/bin/python
Already using interpreter /usr/bin/python
INFO:bench.utils:env/bin/pip -q install --upgrade pip
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
WARNING: The directory ‘/opt/bench/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
WARNING: The directory ‘/opt/bench/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
INFO:bench.utils:env/bin/pip -q install wheel
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
WARNING: The directory ‘/opt/bench/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
WARNING: The directory ‘/opt/bench/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
INFO:bench.utils:env/bin/pip -q install six
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
WARNING: The directory ‘/opt/bench/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
WARNING: The directory ‘/opt/bench/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
INFO:bench.utils:env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
WARNING: The directory ‘/opt/bench/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
WARNING: The directory ‘/opt/bench/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
INFO:bench.app:getting app frappe
INFO:bench.utils:git clone https://github.com/frappe/frappe.git --origin upstream
Cloning into ‘frappe’…
remote: Enumerating objects: 29, done.
remote: Counting objects: 100% (29/29), done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 178266 (delta 12), reused 8 (delta 3), pack-reused 178237
Receiving objects: 100% (178266/178266), 197.00 MiB | 923.00 KiB/s, done.
Resolving deltas: 100% (136385/136385), done.
Checking connectivity… done.
(‘installing’, u’frappe’)
INFO:bench.app:installing frappe
INFO:bench.utils:erpnext/env/bin/pip install -q -e erpnext/apps/frappe
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
WARNING: The directory ‘/opt/bench/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
WARNING: The directory ‘/opt/bench/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
WARNING: Building wheel for markdown2 failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/07’
WARNING: Building wheel for maxminddb-geolite2 failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/94’
WARNING: Building wheel for html2text failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/eb’
WARNING: Building wheel for email-reply-parser failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/d1’
WARNING: Building wheel for watchdog failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/e2’
WARNING: Building wheel for bleach-whitelist failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/be’
WARNING: Building wheel for zxcvbn-python failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/0d’
WARNING: Building wheel for PyPDF2 failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/53’
WARNING: Building wheel for openpyxl failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/82’
WARNING: Building wheel for pyqrcode failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/54’
WARNING: Building wheel for pypng failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/a4’
WARNING: Building wheel for future failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/0c’
WARNING: Building wheel for google-api-python-client failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/6c’
WARNING: Building wheel for maxminddb failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/58’
WARNING: Building wheel for simplegeneric failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/a9’
WARNING: Building wheel for PyYAML failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/ad’
WARNING: Building wheel for pathtools failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/0b’
WARNING: Building wheel for et-xmlfile failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/2a’
WARNING: Building wheel for cssutils failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/a4’
WARNING: Building wheel for httplib2 failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/9d’
WARNING: Building wheel for scandir failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/91’
WARNING: Building wheel for pycparser failed: [Errno 13] Permission denied: ‘/opt/bench/.cache/pip/wheels/f2’
Updating node packages…
INFO:bench.utils:yarn install
yarn install v1.16.0
warning Skipping preferred cache folder “/opt/bench/.cache/yarn” because it is not writable.
warning Selected the next writable cache folder in the list, will be “/tmp/.yarn-cache-1001”.
[1/4] Resolving packages…
[2/4] Fetching packages…
[3/4] Linking dependencies…
warning " > bootstrap@4.3.1" has unmet peer dependency “jquery@1.9.1 - 3”.
warning " > bootstrap@4.3.1" has unmet peer dependency “popper.js@^1.14.7”.
[4/4] Building fresh packages…
[1/2] ⠐ cypress
error /opt/bench/erpnext/apps/frappe/node_modules/cypress: Command failed.
Exit code: 1
Command: node index.js --exec install
Arguments:
Directory: /opt/bench/erpnext/apps/frappe/node_modules/cypress
Output:
Cypress cannot write to the cache directory due to file permissions

Failed to access /opt/bench/.cache/Cypress:

EACCES: permission denied, mkdir ‘/opt/bench/.cache/Cypress’

Platform: linux (Ubuntu Linux - 16.04)
Cypress Version: 3.1.5

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/opt/bench/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/bench/bench-repo/bench/commands/make.py”, line 30, in init
python = python)
File “/opt/bench/bench-repo/bench/utils.py”, line 83, in init
update_node_packages(bench_path=path)
File “/opt/bench/bench-repo/bench/utils.py”, line 452, in update_node_packages
update_yarn_packages(bench_path)
File “/opt/bench/bench-repo/bench/utils.py”, line 465, in update_yarn_packages
exec_cmd(‘yarn install’, cwd=app_path)
File “/opt/bench/bench-repo/bench/utils.py”, line 159, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: yarn install

i have search and trace the error one by one, but i not found any clue. Please give me a little advice to solve this error that can help me so much. Thank You

Try this…

npm config set prefix ‘~/.npm’
export PATH=~/.npm/bin:$PATH
source ~/.profile
npm install -g yarn
bench update --requirements
bench setup socketio
bench build
bench update --reset
bench update

thanks a lot Bro. You help me so much. I’m sorry that i’m late to reply your message.
by the way, how can you find solution on my error. That was awesome and if you don’t mind, can you share some ways for me to solve every error in ubuntu terminal. What must i learn to become an expert programmer like you, especially language in ubuntu terminal

There isn’t really a fixed method to fixing the problems. You basically have to check each time and work out a way to fix things, but luckily the community here are extremely helpful. If you post on the forum, there are many people who can try to help you, and you will soon be helping others

okey, thanks a lot bro. I will learn more to solve error