Building frontend code

Iā€™m trying to build nextcloudā€™s vue.js code, as explained here: server/README.md at master Ā· nextcloud/server Ā· GitHub but couldnā€™t succed

I ran ā€œmake dev-setupā€ and got some dependency issue, so I run it with ā€œnpm ci --forceā€.

After that I ran ā€œmake build-jsā€ but it fails with ā€œsh: 1: webpack: not foundā€. Any idea why?

Running ā€œnpm i webpackā€ tells me everything is up-to-date?!?

Thanks for report :roll_eyes:

I think there are some issues with peer deps, which the new npm is more strict about.

Iā€™ll try to fix that as soon as my distro ships npm 7 :crossed_fingers:

Yes, that was it.

Iā€™m using npm 7.4 and I had to add ā€˜ā€“legacy-peer-depsā€™ to my ā€œnpm ciā€ command:

(from Makefile)
npm-init:
npm ci --legacy-peer-deps

1 Like

Cool. Mind sharing the output of npm ci of a clean master branch installation? Iā€™d like to see what npm is complaining about, maybe I can fix that even with npm 6.

cyrille@vm-cyrille-debian:/var/www/nextcloud$ npm ci
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /usr/bin/node /usr/share/nodejs/npm/bin/npm-cli.js install --cache=/home/cyrille/.npm/_cacache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit
npm ERR! npm ERR! code ERESOLVE
npm ERR! npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! npm ERR!
npm ERR! npm ERR! Found: webpack@4.46.0
npm ERR! npm ERR! node_modules/webpack
npm ERR! npm ERR! dev webpack@"^4.16.2" from the root project
npm ERR! npm ERR! peer webpack@ā€œ2 || 3 || 4ā€ from babel-loader@7.1.5
npm ERR! npm ERR! node_modules/babel-loader
npm ERR! npm ERR! dev babel-loader@"^7.1.5" from the root project
npm ERR! npm ERR! 1 more (css-loader)
npm ERR! npm ERR!
npm ERR! npm ERR! Could not resolve dependency:
npm ERR! npm ERR! dev extract-text-webpack-plugin@"^3.0.2" from the root project
npm ERR! npm ERR!
npm ERR! npm ERR! Conflicting peer dependency: webpack@3.12.0
npm ERR! npm ERR! node_modules/webpack
npm ERR! npm ERR! peer webpack@"^3.1.0" from extract-text-webpack-plugin@3.0.2
npm ERR! npm ERR! node_modules/extract-text-webpack-plugin
npm ERR! npm ERR!
npm ERR! npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! npm ERR!
npm ERR! npm ERR! See /home/cyrille/.npm/_cacache/eresolve-report.txt for a full report.
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! /home/cyrille/.npm/_cacache/_logs/2021-01-15T09_24_04_521Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR! /home/cyrille/.npm/_logs/2021-01-15T09_24_09_794Z-debug.log
cyrille@vm-cyrille-debian:/var/www/nextcloud$

1 Like