M220JS mflix-js npm install

Hi everyone,
I have been stuck here. Can anyone help me out?

PS C:\Users\Angel\mflix-js> npm install
npm WARN config global --global, --local are deprecated. Use --location=global instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: eslint-config-react-app@2.1.0
npm ERR! Found: babel-eslint@9.0.0
npm ERR! node_modules/babel-eslint
npm ERR! babel-eslint@"^9.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer babel-eslint@"^7.2.3" from eslint-config-react-app@2.1.0
npm ERR! node_modules/eslint-config-react-app
npm ERR! eslint-config-react-app@"^2.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: babel-eslint@7.2.3
npm ERR! node_modules/babel-eslint
npm ERR! peer babel-eslint@"^7.2.3" from eslint-config-react-app@2.1.0
npm ERR! node_modules/eslint-config-react-app
npm ERR! eslint-config-react-app@"^2.1.0" 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 C:\Users\Angel\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Angel\AppData\Local\npm-cache_logs\2022-07-03T18_18_50_933Z-debug-0.log

there are breaking version changes in libraries.
delete (or rename) package-lock.json and install with npm install --legacy-peer-deps

Thanks, Yilmaz_Durmaz. I’m on Windows. I have have tried that multiple times, but it didn’t work for me.

I then deleted the files, installed Node v16 and Npm v8, downloaded the mflix-js again, and tried npm install, but I got a different error that suggests that npm is not working on my windows machine at the moment because I tried npm install and start on other projects on my machine, but it’s giving me the same error.

So, I believe it is the nodejs and npm latest version installation change that has created the error. My previous node version was node 14…, and the mflix-js project ran successfully on it, and it passed the connection test.

It was when I encountered errors while working on projection test of the mflix-js project that I thought I should update my nodejs and npm. When I finished installing new updates, I got stuck with the current errors. I’ll share more later.

Thanks a lot for your time.

I did not think you had node.js version older than 16 :slight_smile: in that case libraries is possible they did not update correctly.

In this case, first, make sure you have node 16+ and npm 8+ available in your terminal. then delete both package-lock.json along with node_modules folder. do not change anything else and install again with npm install --legacy-peer-deps. all your progress should work fine (validate them all again to make sure).

beyond that, there should be only one more error you would meet related to wtimeout in write concern topic, a version difference of project test suite versus mongodb javascript driver. check the error when you get there and you will also find the solution here in the forums.

OK @Yilmaz_Durmaz,

I will do as you have said and report results back here. I feel very encouraged by your response!

Many thanks.

Hi @Yilmaz_Durmaz
I have deleted package-lock.json and tried install with npm install --legacy-peer-deps, but the following is what I get now:

PS C:\Users\Angel\mflix-js> npm install --legacy-peer-deps
npm WARN config global --global, --local are deprecated. Use --location=global instead.
node:internal/modules/cjs/loader:933
const err = new Error(message);
^

Error: Cannot find module ‘./functions/valid’
Require stack:

  • C:\Users\Angel\AppData\Roaming\npm\node_modules\npm\node_modules\semver\index.js
  • C:\Users\Angel\AppData\Roaming\npm\node_modules\npm\lib\cli.js
  • C:\Users\Angel\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object. (C:\Users\Angel\AppData\Roaming\npm\node_modules\npm\node_modules\semver\index.js:12:10)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions…js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [
    ‘C:\Users\Angel\AppData\Roaming\npm\node_modules\npm\node_modules\semver\index.js’,
    ‘C:\Users\Angel\AppData\Roaming\npm\node_modules\npm\lib\cli.js’,
    ‘C:\Users\Angel\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js’
    ]
    }
    PS C:\Users\Angel\mflix-js>

Please what can I do next?

there seems a problem with your installation. your previous one may not be uninstalled, or new one may not be installed properly.

did you also delete node_modules folder in ``mflix-js`? try that before continuing.

If that fails and you don’t have a need for these installations, try uninstalling any nodejs versions and also remove C:\Users\Angel\AppData\Roaming\npm and C:\Users\Angel\AppData\Roaming\npm-cache folders.

In case you use nvm or similar nodejs manager, you may need to refer their manuals. if not, you may want to consider nvm-windows in https://github.com/coreybutler/nvm-windows.

then reinstall nodejs and repeat the process for the M220JS.

Yes, it seems.

And yes, I deleted the node_modules folder in “mflix-js”.

I have also tried uninstalling and reinstalling the nodejs version, and I have removed C:\Users\Angel\AppData\Roaming\npm and C:\Users\Angel\AppData\Roaming\npm-cache folders.

I’'ll look up nvm-windows.

Many thanks

Hi @Yilmaz_Durmaz
It’s running again with the following warning:

PS C:\Users\Angel\mflix-js> npm start
npm WARN config global --global, --local are deprecated. Use --location=global instead.

server@1.0.0 start
nodemon -L ./index.js

[nodemon] 2.0.19
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node ./index.js
(node:14108) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
(Use node --trace-warnings ... to show where the warning was created)
listening on port 5000

Please what should I do from here?

Your setup now works fine and this one is not an error but a warning for the future of the driver.

You can now continue your course and and should be fine until you hit the wtimeout problem I mentioned earlier.

Have fun :wink:

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.