question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm run build not working: missing script: build

See original GitHub issue

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):

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
ShahanMirzacommented, Oct 6, 2020

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

4reactions
vcjobcommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm ERR! Missing script: "build" [Solved] | bobbyhadz
To solve the npm ERR! Missing script: build error, make sure to add a `build` command to the `scripts` object in your `package.json`...
Read more >
Using "npm run build" fails with "npm ERR! missing script: build"
config.js, I got the following error: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API...
Read more >
What does it mean when you get the NPM error missing script
It means in your “package.json” (in the folder in which you run “npm run build”), there's NO “build” script. A quick check: run...
Read more >
Npm run build not found - Laracasts
Im trying to runnpm run build but I get an error: λ npm run build npm ERR! missing script: build These are the...
Read more >
[Solved] npm err! missing script: start - ItsJavaScript
How to fix npm err! missing script: start · Solution 1 – Add the Start Scripts in package.json · Solution 2 – Ensure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found