Failed to start node development server

Hi all,

By the moment we are trying to do a first run of the 17th version of the portal in a VM.

We have already deployed the portal server and now we’re trying to run the portal ui. We have followed the steps here dcc-portal/dcc-portal-ui/README.md at develop · icgc-dcc/dcc-portal · GitHub but when trying to start node development server (npm run dev) the following error appears:

As it is said in the error I’ll quote here the content in the mentioned log file (as a new user I cannot attach more than one image):

0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/bin/node’, ‘/usr/bin/npm’, ‘run’, ‘dev’ ]
2 info using npm@2.15.1
3 info using node@v0.10.48
4 verbose node symlink /usr/bin/node
5 verbose run-script [ ‘predev’, ‘dev’, ‘postdev’ ]
6 info predev dcc-portal-ui@4.2.6-SNAPSHOT
7 verbose unsafe-perm in lifecycle true
8 info dcc-portal-ui@4.2.6-SNAPSHOT Failed to exec predev script
9 verbose stack Error: dcc-portal-ui@4.2.6-SNAPSHOT predev: npm run checkhost
9 verbose stack Exit status 1
9 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:217:16)
9 verbose stack at EventEmitter.emit (events.js:98:17)
9 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack at ChildProcess.emit (events.js:98:17)
9 verbose stack at maybeClose (child_process.js:766:16)
9 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:833:5)
10 verbose pkgid dcc-portal-ui@4.2.6-SNAPSHOT
11 verbose cwd /transplant/peris/dcc-portal-4.3.17/dcc-portal-4.3.17/dcc-portal-ui
12 error Linux 3.2.0-29-virtual
13 error argv “/usr/bin/node” “/usr/bin/npm” “run” “dev”
14 error node v0.10.48
15 error npm v2.15.1
16 error code ELIFECYCLE
17 error dcc-portal-ui@4.2.6-SNAPSHOT predev: npm run checkhost
17 error Exit status 1
18 error Failed at the dcc-portal-ui@4.2.6-SNAPSHOT predev script ‘npm run checkhost’.
18 error This is most likely a problem with the dcc-portal-ui package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error npm run checkhost
18 error You can get information on how to open an issue for this project with:
18 error npm bugs dcc-portal-ui
18 error Or if that isn’t available, you can get their info via:
18 error
18 error npm owner ls dcc-portal-ui
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

Thanks for your attention,

Lorena

Hi Lorena,

Thanks for the detailed report!

Please install a version of node that is newer than 4.4.0, and a version of npm that is newer than 3

Instructions here for installing node via nvm

And afterwards upgrade npm by running
npm install npm@latest -g

I’ll make sure to add this to our readme

Hi Chang,

First of all, thank you for your quickly answer.

It has solved our problem completely :slight_smile:

From that point I have continued the portal setup to run it but I’m facing another error that I don’t know how to solve while running the npm run dev command:

I’ve tried to upload the version of some of the packages.json which contained the os.tmpDir() call and also I’ve tried to replace it with the command os.tmpdir() previously installing the npm library os-tmpdir:
npm install --save os-tmpdir

But the same error appears again. Do you know what can I do to solve it?

Best regards,

Lorena

Hi Lorena,

Could you confirm for us which git branch you’re on?

I suspect you may have checked out our master branch, which is unfortunately not updated very often (and still has grunt server as the dev task) and can be quite stale

If that’s the case, please try checking out the develop branch and running npm install again (you may have to delete the contents of the node_modules folder first)

Hi Chang,

We are in develop branch of the 4.3.17 release of the portal.

Regards,

Lorena

Ah I see

We’ve since updated our UI build process and that problem should no longer exist on the latest develop branch, but we haven’t made a release yet.

Would you be able to clone the latest develop branch and try from there? (clone from git@github.com:icgc-dcc/dcc-portal.git, and re-run npm install)

Ok, thank you very much.

We will start again cloning from that repository you suggest. Keep in touch! :slight_smile:

Hi again Chang,

We have downloaded the last version of the portal through the link you gave us, compiled everything but again, when running the npm run dev command, a new error appears:

Do you know what can we do to try to solve it?

Thank you in advance and best regards,

Lorena

Hi Lorena,

A fix for this was pushed to the repo and merged into develop. Give it a pull and another try.

Hi Dusan,

Thanks for the quickly response and solution again.
With this fix we have been successful in the deployment of the portal ui.

Regards,

Lorena