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