Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run build not working: missing script: build #494

Closed
vcjob opened this issue Dec 10, 2019 · 10 comments
Closed

npm run build not working: missing script: build #494

vcjob opened this issue Dec 10, 2019 · 10 comments
Labels
question Further information is requested

Comments

@vcjob
Copy link

vcjob commented Dec 10, 2019

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 npm@6.12.1
3 info using node@v12.13.1
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):
@icoxfog417 icoxfog417 added the question Further information is requested label Dec 11, 2019
@icoxfog417
Copy link
Contributor

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

@vcjob
Copy link
Author

vcjob commented Dec 11, 2019

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.

@Prateekmaithil19
Copy link

  • 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

@sushmitasen11
Copy link

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

@ShahanMirza
Copy link

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

@Rkauri
Copy link

Rkauri commented Nov 3, 2020

npm run build:local or npm run build:production

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

@andriimazur93
Copy link

Have someone found how to solve this issue?

@xneoSavage
Copy link

face with it issue too

@Hironsan
Copy link
Member

The following document will be useful.

@aniketr11
Copy link

imageScreenshot 2022-04-05 060003

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

10 participants