Error while installing frappe on my ubuntu 16.04 server!

While installing frappe it give a npm error while doing this command: bench init frappe-bench && cd frappe-bench
this is the error:

frappe@ubuntu:~$ bench init frappe-bench && cd frappe-bench
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==9.0.3
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
INFO:bench.utils:./env/bin/pip -q install wheel
INFO:bench.utils:./env/bin/pip -q install six
INFO:bench.utils:./env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
INFO:bench.app:getting app frappe
INFO:bench.utils:git clone https://github.com/frappe/frappe.git   --origin upstream
Cloning into 'frappe'...
remote: Counting objects: 147262, done.
remote: Compressing objects: 100% (53/53), done.
remote: Total 147262 (delta 26), reused 39 (delta 21), pack-reused 147188
Receiving objects: 100% (147262/147262), 157.74 MiB | 1.74 MiB/s, done.
Resolving deltas: 100% (111218/111218), done.
Checking connectivity... done.
('installing', u'frappe')
INFO:bench.app:installing frappe
INFO:bench.utils:frappe-bench/env/bin/pip install -q  -e frappe-bench/apps/frappe --no-cache-dir
Updating node packages...
Please install yarn using below command and try again.
`npm install -g yarn`
/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.23) or chardet (3.0.4) doesn't match a supported version!
  RequestsDependencyWarning)
Please install yarn using below command and try again.
npm install -g yarn

> frappe@ production /home/frappe/frappe-bench/apps/frappe
> FRAPPE_ENV=production node rollup/build.js

module.js:549
    throw err;
    ^

Error: Cannot find module 'chalk'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/frappe/frappe-bench/apps/frappe/rollup/build.js:3:15)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frappe@ production: `FRAPPE_ENV=production node rollup/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the frappe@ production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/frappe/.npm/_logs/2018-06-09T12_38_50_823Z-debug.log
INFO:bench.utils:setting up backups
no crontab for frappe
INFO:bench.utils:setting up auto update
Bench frappe-bench initialized

Any help?

You should try looking at the forums before opening a new thread!
A simple search would’ve revealed that using bench setup requirements fixes the problem. :slight_smile:

sudo npm install -g yarn

@codingCoffee I am not sure if you solved @Elie 's problem. Running bench setup requirements at this point leaves me with:

➜  frappe-dev bench setup requirements
Updating Python libraries...
INFO:bench.utils:./env/bin/pip install --upgrade pip==9.0.3
/bin/sh: ./env/bin/pip: No such file or directory
Traceback (most recent call last):
  File "/Users/dominik/.pyenv/versions/2.7.14/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/Users/dominik/Dev/frappe-dev/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/Users/dominik/.local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/dominik/.local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/dominik/.local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/dominik/.local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/dominik/.local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/dominik/.local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/dominik/Dev/frappe-dev/bench-repo/bench/commands/setup.py", line 161, in setup_requirements
    setup_python_requirements()
  File "/Users/dominik/Dev/frappe-dev/bench-repo/bench/commands/setup.py", line 167, in setup_python_requirements
    update_requirements()
  File "/Users/dominik/Dev/frappe-dev/bench-repo/bench/utils.py", line 425, in update_requirements
    exec_cmd("{pip} install --upgrade pip==9.0.3".format(pip=pip))
  File "/Users/dominik/Dev/frappe-dev/bench-repo/bench/utils.py", line 159, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip install --upgrade pip==9.0.3

I figured out what was missing and installed it manually after which you can do your bench init.

Install missing node packages: npm install chalk rollup rollup-plugin-multi-entry rollup-plugin-commonjs rollup-plugin-node-resolve rollup-plugin-uglify

I think the bench setup requirements error and the necessity of running this command (which is not mentioned in any of the tutorials) should be addressed.

I am currently stuck with this on a setup:

> frappe@ production /Users/dominik/Dev/frappe-dev/frappe-bench/apps/frappe
> FRAPPE_ENV=production node rollup/build.js

Production mode
fs.js:119
    throw err;
    ^

Error: ENOENT: no such file or directory, open '/Users/dominik/Dev/frappe-dev/frappe-bench/apps/frappe/node_modules/moment/min/moment-with-locales.min.js'
    at Object.openSync (fs.js:443:3)
    at Object.readFileSync (fs.js:348:35)
    at input_files.map.file_name (/Users/dominik/Dev/frappe-dev/frappe-bench/apps/frappe/rollup/build.js:84:39)
    at Array.map (<anonymous>)
    at files_to_concat.forEach.output_file (/Users/dominik/Dev/frappe-dev/frappe-bench/apps/frappe/rollup/build.js:78:36)
    at Array.forEach (<anonymous>)
    at concatenate_files (/Users/dominik/Dev/frappe-dev/frappe-bench/apps/frappe/rollup/build.js:75:18)
    at Object.<anonymous> (/Users/dominik/Dev/frappe-dev/frappe-bench/apps/frappe/rollup/build.js:24:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frappe@ production: `FRAPPE_ENV=production node rollup/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frappe@ production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dominik/.npm/_logs/2018-07-25T17_25_48_965Z-debug.log
INFO:bench.utils:setting up backups
INFO:bench.utils:setting up auto update
Bench frappe-bench initialized

“npm ERR! A complete log of this run can be found in:
npm ERR! /Users/dominik/.npm/_logs/2018-07-25T17_25_48_965Z-debug.log”

Perhaps this offers clues?

Can you please elaborate! I have never faced this error. Also, from your 1st error traekback it seems you’re missing the ./env directory itself!

Well I agree with you that it should be mentioned in some tutorial somewhere, but it is not really a mandatory command which needs to be executed.

About your second traceback, I think @netchampfaris could comment on how to fix it! According to me bench setup requirements should do the trick. Can you replicate this error, or post the exact steps you followed to face it !?

If you haven’t set up frappe bench, before you initialize it there is no ./env

“If you haven’t set up frappe bench, before you initialize it there is no ./env”

Agreed. But subsequently here below, env and or pip are not active - that you need to fix no (in your case)?

"
➜ frappe-dev bench setup requirements
Updating Python libraries…
INFO:bench.utils:./env/bin/pip install --upgrade pip==9.0.3
/bin/sh: ./env/bin/pip: No such file or directory
"

edit: This may help diagnose and fix your env problem http://cheng.logdown.com/posts/2015/06/14/-usr-bin-pip-no-such-file-or-directory

There’s this too Bench update fails: /bin/sh: 1: ./env/bin/pip: not found - #4 by johnskywalker

1 Like

@dominik Have you solved the problem?
I am getting same erros during installation.

Before bench init executing “npm install -g yarn” will fix this issue.

Could you be more specific inside which folder?

1 Like