Doccano: npm run build not working: missing script: build

Created on 10 Dec 2019  ·  6Comments  ·  Source: doccano/doccano

How to reproduce the problem
Follow the install guide from github README.

_Install from source
I want to remember you that this is the hardest setup way. You have to install Python/Node.js and type many commands.
Install Python
Install Node.js
Get the source code of doccano: git clone https://github.com/chakki-works/doccano.git
Move to doccano directory: cd doccano
Create environment for doccano: virtualenv venv
Activate environment: source venv/bin/activate
Install required packages: pip install -r requirements.txt
Move server directory: cd app/server
Build frontend library: npm install
Build frontend source code: npm run build
Back to server directory: cd ../
Initialize doccano: python manage.py migrate
Create user: python manage.py createsuperuser
Run doccano: python manage.py runserver
Stop doccano: Ctrl+C
Re-Launch doccano: python manage.py runserver (Confirm you are at app/server directory and environment is active)._

Here is where I've got into trouble:
_Move server directory: cd app/server
Build frontend library: npm install
Build frontend source code: npm run build_

So, I do npm install and get:
npm WARN doccano No repository field.
npm WARN doccano No license field.

up to date in 1.114s
found 0 vulnerabilities

After I do npm run build:
npm ERR! missing script: build

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-12-10T18_05_07_427Z-debug.log

And here's what the log has:

_0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose stack Error: missing script: build
4 verbose stack at run (/usr/lib/node_modules/npm/lib/run-script.js:155:19)
4 verbose stack at /usr/lib/node_modules/npm/lib/run-script.js:63:5
4 verbose stack at /usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:116:5
4 verbose stack at /usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:435:5
4 verbose stack at checkBinReferences_ (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:391:45)
4 verbose stack at final (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:433:3)
4 verbose stack at then (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:161:5)
4 verbose stack at /usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:382:12
4 verbose stack at /usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:115:16
4 verbose stack at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
5 verbose cwd /opt/text_annotation_tool/doccano/app/server
6 verbose Linux 4.15.0-66-generic
7 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
8 verbose node v12.13.1
9 verbose npm v6.12.1
10 error missing script: build
11 verbose exit [ 1, true ]_

As the installation guide mentions the frontend, I went in doccano/frontend and did npm install; npm run build there, and it went well. Anyway, when I try to open the main doccano server page, I get the following:
image

Thank you for the help!

# copy-paste the error message here

Your Environment
python 3
node -v =12.13.1

npm -v = 6.12.1

  • Operating System:
  • Python Version Used:
  • When you install doccano:
  • How did you install doccano (Heroku button etc):
question

Most helpful comment

Installation instruction was based on before ver 1.0. We fixed it and please execute npm build at frontend directory.

Thank you. I did that, it didnt fix it though. Webpack-stats.json is still missing.
Anyway, I managed to use docker, so it's fine.

All 6 comments

Installation instruction was based on before ver 1.0. We fixed it and please execute npm build at frontend directory.

Installation instruction was based on before ver 1.0. We fixed it and please execute npm build at frontend directory.

Thank you. I did that, it didnt fix it though. Webpack-stats.json is still missing.
Anyway, I managed to use docker, so it's fine.

  • npm run build
    npm ERR! missing script: build

npm ERR! A complete log of this run can be found in:
npm ERR! /var/lib/jenkins/.npm/_logs/2020-08-06T04_35_17_732Z-debug.log
Build step 'Shell ausführen' marked build as failure

@Prateekmaithil19 did you get it resolved ? let if know if yes, i am too getting this error.

@Prateekmaithil19 i am facing this issue, have found any solution ?

npm run build:local or npm run build:production

extra parameter is required as shown above. It fixed my problem

Was this page helpful?
0 / 5 - 0 ratings