Npm run build - install for develop

I’m following this guide

https://pkp.sfu.ca/wiki/index.php?title=Github_Documentation_for_PKP_Contributors

when I execute

npm run build

npm ERR! Linux 4.9.0-6-amd64
npm ERR! argv “/usr/bin/node” “/usr/bin/npm” “run” “build”
npm ERR! node v4.8.7
npm ERR! npm v2.15.11
npm ERR! code ELIFECYCLE
npm ERR! OJS3@3.1.1 build: cross-env NODE_ENV=production webpack --progress --hide-modules
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the OJS3@3.1.1 build script ‘cross-env NODE_ENV=production webpack --progress --hide-modules’.
npm ERR! This is most likely a problem with the OJS3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=production webpack --progress --hide-modules
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs OJS3
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR!
npm ERR! npm owner ls OJS3
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/my-ojs-clone/npm-debug.log

I get this (/var/www/html/my-ojs-clone/npm-debug.log):

0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/bin/node’, ‘/usr/bin/npm’, ‘run’, ‘build’ ]
2 info using npm@2.15.11
3 info using node@v4.8.7
4 verbose run-script [ ‘prebuild’, ‘build’, ‘postbuild’ ]
5 info prebuild OJS3@3.1.1
6 info build OJS3@3.1.1
7 verbose unsafe-perm in lifecycle true
8 info OJS3@3.1.1 Failed to exec build script
9 verbose stack Error: OJS3@3.1.1 build: cross-env NODE_ENV=production webpack --progress --hide-modules
9 verbose stack Exit status 2
9 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:217:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:862:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:222:5)
10 verbose pkgid OJS3@3.1.1
11 verbose cwd /var/www/html/my-ojs-clone
12 error Linux 4.9.0-6-amd64
13 error argv “/usr/bin/node” “/usr/bin/npm” “run” “build”
14 error node v4.8.7
15 error npm v2.15.11
16 error code ELIFECYCLE
17 error OJS3@3.1.1 build: cross-env NODE_ENV=production webpack --progress --hide-modules
17 error Exit status 2
18 error Failed at the OJS3@3.1.1 build script ‘cross-env NODE_ENV=production webpack --progress --hide-modules’.
18 error This is most likely a problem with the OJS3 package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error cross-env NODE_ENV=production webpack --progress --hide-modules
18 error You can get information on how to open an issue for this project with:
18 error npm bugs OJS3
18 error Or if that isn’t available, you can get their info via:
18 error
18 error npm owner ls OJS3
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

what’s my problem?

Hi @cristianviza, it looks like you’re using a pretty old version of node.js on your system. That would be the first thing I’d check when debugging this. You can use nvm to update node.

Thanks. Solved update node to version 9.