Copyleaks / plagiarism-report

Allow Copyleaks API users to view the plagiarism report using their downloaded data. Using this report allows users to view the report anytime without being restricted by the Copyleaks expiration policy (that deletes the reports data).
https://api.copyleaks.com
Other
17 stars 8 forks source link

error installing with NPM 7.15.1 #53

Closed mnelson4 closed 2 years ago

mnelson4 commented 3 years ago

Describe the bug Trying to install using NPM in a brand new project.

To Reproduce Steps to reproduce the behavior:

  1. Install NPM 7.15.1
  2. In a folder where NPM has never been ran before, run npm i @copyleaks/plagiarism-report
  3. See error message:
npm i @copyleaks/plagiarism-report
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: @angular/common@9.1.13
npm ERR! node_modules/@angular/common
npm ERR!   peer @angular/common@"^9.1.11" from @copyleaks/plagiarism-report@3.1.3
npm ERR!   node_modules/@copyleaks/plagiarism-report
npm ERR!     @copyleaks/plagiarism-report@"*" from the root project
npm ERR!   peer @angular/common@">=9.1.5" from @angular/flex-layout@9.0.0-beta.31
npm ERR!   node_modules/@angular/flex-layout
npm ERR!     peer @angular/flex-layout@"^9.0.0-beta.29" from @copyleaks/plagiarism-report@3.1.3
npm ERR!     node_modules/@copyleaks/plagiarism-report
npm ERR!       @copyleaks/plagiarism-report@"*" from the root project
npm ERR!   1 more (@angular/cdk)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"12.0.3" from @angular/platform-browser@12.0.3
npm ERR! node_modules/@angular/platform-browser
npm ERR!   peer @angular/platform-browser@">=9.1.5" from @angular/flex-layout@9.0.0-beta.31
npm ERR!   node_modules/@angular/flex-layout
npm ERR!     peer @angular/flex-layout@"^9.0.0-beta.29" from @copyleaks/plagiarism-report@3.1.3
npm ERR!     node_modules/@copyleaks/plagiarism-report
npm ERR!       @copyleaks/plagiarism-report@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/earlychildhood/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/earlychildhood/.npm/_logs/2021-06-05T15_55_50_646Z-debug.log

Here's the debug.log file

0 verbose cli [
0 verbose cli   '/usr/bin/node',
0 verbose cli   '/usr/bin/npm',
0 verbose cli   'i',
0 verbose cli   '@copyleaks/plagiarism-report'
0 verbose cli ]
1 info using npm@7.15.1
2 info using node@v16.3.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 0ms
6 timing config:load:builtin Completed in 0ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:/var/data/websites/dev.earlychildhoodeducator.com/static/.npmrc Completed in 0ms
10 timing config:load:project Completed in 0ms
11 timing config:load:file:/home/earlychildhood/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/usr/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:credentials Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 5ms
19 timing npm:load:configload Completed in 5ms
20 timing npm:load:setTitle Completed in 0ms
21 timing npm:load:setupLog Completed in 1ms
22 timing npm:load:cleanupLog Completed in 2ms
23 timing npm:load:configScope Completed in 0ms
24 timing npm:load:projectScope Completed in 0ms
25 timing npm:load Completed in 9ms
26 timing config:load:flatten Completed in 2ms
27 timing arborist:ctor Completed in 1ms
28 timing arborist:ctor Completed in 0ms
29 timing idealTree:init Completed in 11ms
30 timing idealTree:userRequests Completed in 2ms
31 silly idealTree buildDeps
32 silly fetch manifest @copyleaks/plagiarism-report@*
33 http fetch GET 200 https://registry.npmjs.org/@copyleaks%2fplagiarism-report 16ms (from cache)
34 silly fetch manifest @angular/common@^9.1.11
35 http fetch GET 304 https://registry.npmjs.org/@angular%2fcommon 74ms (from cache)
36 silly fetch manifest @angular/core@9.1.13
37 http fetch GET 304 https://registry.npmjs.org/@angular%2fcore 48ms (from cache)
38 silly fetch manifest rxjs@^6.5.3
39 http fetch GET 304 https://registry.npmjs.org/rxjs 27ms (from cache)
40 silly fetch manifest tslib@^1.10.0
41 http fetch GET 304 https://registry.npmjs.org/tslib 22ms (from cache)
42 silly fetch manifest zone.js@~0.10.3
43 http fetch GET 304 https://registry.npmjs.org/zone.js 38ms (from cache)
44 silly fetch manifest @angular/flex-layout@^9.0.0-beta.29
45 http fetch GET 304 https://registry.npmjs.org/@angular%2fflex-layout 30ms (from cache)
46 silly fetch manifest @angular/cdk@^9.0.0-rc.8
47 http fetch GET 304 https://registry.npmjs.org/@angular%2fcdk 37ms (from cache)
48 silly fetch manifest @angular/platform-browser@>=9.1.5
49 http fetch GET 304 https://registry.npmjs.org/@angular%2fplatform-browser 32ms (from cache)
50 silly fetch manifest @angular/animations@12.0.3
51 http fetch GET 304 https://registry.npmjs.org/@angular%2fanimations 32ms (from cache)
52 silly fetch manifest @angular/core@12.0.3
53 silly fetch manifest zone.js@~0.11.4
54 silly fetch manifest @angular/common@12.0.3
55 timing idealTree Completed in 426ms
56 timing command:install Completed in 432ms
57 verbose stack Error: unable to resolve dependency tree
57 verbose stack     at Arborist.[failPeerConflict] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1210:25)
57 verbose stack     at Arborist.[loadPeerSet] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1203:30)
57 verbose stack     at async Arborist.[loadPeerSet] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1153:11)
57 verbose stack     at async Arborist.[loadPeerSet] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1153:11)
57 verbose stack     at async Arborist.[buildDepStep] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:880:11)
57 verbose stack     at async Arborist.buildIdealTree (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:218:7)
57 verbose stack     at async Promise.all (index 1)
57 verbose stack     at async Arborist.reify (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:136:5)
57 verbose stack     at async Install.install (/usr/lib/node_modules/npm/lib/install.js:150:5)
58 verbose cwd /var/data/websites/dev.earlychildhoodeducator.com/static
59 verbose Linux 3.10.0-1127.18.2.el7.x86_64
60 verbose argv "/usr/bin/node" "/usr/bin/npm" "i" "@copyleaks/plagiarism-report"
61 verbose node v16.3.0
62 verbose npm  v7.15.1
63 error code ERESOLVE
64 error ERESOLVE unable to resolve dependency tree
65 error
66 error While resolving: ^[[1mundefined^[[22m@^[[1mundefined^[[22m
66 error Found: ^[[1m@angular/common^[[22m@^[[1m9.1.13^[[22m^[[2m^[[22m
66 error ^[[2mnode_modules/@angular/common^[[22m
66 error   ^[[35mpeer^[[39m ^[[1m@angular/common^[[22m@"^[[1m^9.1.11^[[22m" from ^[[1m@copyleaks/plagiarism-report^[[22m@^[[1m3.1.3^[[22m^[[2m^[[22m
66 error   ^[[2mnode_modules/@copyleaks/plagiarism-report^[[22m
66 error     ^[[1m@copyleaks/plagiarism-report^[[22m@"^[[1m*^[[22m" from the root project
66 error   ^[[35mpeer^[[39m ^[[1m@angular/common^[[22m@"^[[1m>=9.1.5^[[22m" from ^[[1m@angular/flex-layout^[[22m@^[[1m9.0.0-beta.31^[[22m^[[2m^[[22m
66 error   ^[[2mnode_modules/@angular/flex-layout^[[22m
66 error     ^[[35mpeer^[[39m ^[[1m@angular/flex-layout^[[22m@"^[[1m^9.0.0-beta.29^[[22m" from ^[[1m@copyleaks/plagiarism-report^[[22m@^[[1m3.1.3^[[22m^[[2m^[[22m
66 error     ^[[2mnode_modules/@copyleaks/plagiarism-report^[[22m
66 error       ^[[1m@copyleaks/plagiarism-report^[[22m@"^[[1m*^[[22m" from the root project
66 error   1 more (@angular/cdk)
66 error
66 error Could not resolve dependency:
66 error ^[[35mpeer^[[39m ^[[1m@angular/common^[[22m@"^[[1m12.0.3^[[22m" from ^[[1m@angular/platform-browser^[[22m@^[[1m12.0.3^[[22m^[[2m^[[22m
66 error ^[[2mnode_modules/@angular/platform-browser^[[22m
66 error   ^[[35mpeer^[[39m ^[[1m@angular/platform-browser^[[22m@"^[[1m>=9.1.5^[[22m" from ^[[1m@angular/flex-layout^[[22m@^[[1m9.0.0-beta.31^[[22m^[[2m^[[22m
66 error   ^[[2mnode_modules/@angular/flex-layout^[[22m
66 error     ^[[35mpeer^[[39m ^[[1m@angular/flex-layout^[[22m@"^[[1m^9.0.0-beta.29^[[22m" from ^[[1m@copyleaks/plagiarism-report^[[22m@^[[1m3.1.3^[[22m^[[2m^[[22m
66 error     ^[[2mnode_modules/@copyleaks/plagiarism-report^[[22m
66 error       ^[[1m@copyleaks/plagiarism-report^[[22m@"^[[1m*^[[22m" from the root project
66 error
66 error Fix the upstream dependency conflict, or retry
66 error this command with --force, or --legacy-peer-deps
66 error to accept an incorrect (and potentially broken) dependency resolution.
66 error
66 error See /home/earlychildhood/.npm/eresolve-report.txt for a full report.
67 verbose exit 1

Expected behavior I expected it would work, especially when it's a totally empty project with no previous package.json

Screenshots MsGC4RQ

Desktop (please complete the following information):

Additional context I hope that helps!

mnelson4 commented 3 years ago

Aha, I found a similar error on Stack Overflow, indicating NPM 7 introduced breaking changes with how peer dependencies were handled. I just tried using an older version of NPM (6.9.0) and it worked fine back then. Using npm i @copyleaks/plagiarism-report --legacy-peer-deps also worked.

So, there's a workaround. But if possible it would probably be good to update the package.json so it works with NPM 7 out-of-the-box.