NPM install on mflix-js Error

I am getting the following error that is resulting in a rollback of the install. I checked the previous post and this one looks different. Please let me know what you think.

Error from NPM install -
WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: unable to get local issuer certificate
gyp ERR! stack at TLSSocket.onConnectSecure (_tls_wrap.js:1051:34)
gyp ERR! stack at TLSSocket.emit (events.js:189:13)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:633:8)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\salvagl\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “rebuild”
gyp ERR! cwd C:\Project Workarea\MongoDB\Courses\Downloads\M220JS_MongoDB_for_Javascript_Developers_HandOuts\mflix-js\node_modules\weak-napi
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v5.0.5

Hi @Louis_99687,

This is expected, try running npm start. It should work.

Kanika

Kanika,

what is the expected result for this command? npm start
what I got was a message and then ti command line sits -
“[nodemon] app crashed - waiting for file changes before starting…”

does this mean that it’s working? It looks like something crashed…

Please advise
Thank you
Lou

No, that is definitely not the expected result. Is there any other line above this error?

Kanika

Hi Kanika,
A couple of things…

  1. Here is the output from the npm install - which now has a different message and says I need to install peer dependencies myself -
    How would I do that?
    PS C:\TEMPAREA\mflix-js> npm install
    npm WARN eslint-config-react-app@2.1.0 requires a peer of babel-eslint@^7.2.3 but none is installed. You must install peer dependencies yourself.
    npm WARN eslint-config-react-app@2.1.0 requires a peer of eslint-plugin-jsx-a11y@^5.1.1 but none is installed. You must install peer dependencies yourself.
    npm WARN server@1.0.0 No repository field.
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules@jest\reporters\node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules@jest\core\node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\jest-watcher\node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\jest-cli\node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\jest-resolve-dependencies\node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})

audited 2109820 packages in 12.305s

21 packages are looking for funding
run npm fund for details

found 2 vulnerabilities (1 low, 1 high)
run npm audit fix to fix them, or npm audit for details
P

  1. Here is the output from the npm start command -

PS C:\TEMPAREA\mflix-js> npm start

server@1.0.0 start C:\TEMPAREA\mflix-js
nodemon -L ./index.js

[nodemon] 1.19.4
[nodemon] to restart at any time, enter rs
[nodemon] watching dir(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node ./index.js
MongoParseError: URI malformed, cannot be parsed
at parseConnectionString (C:\TEMPAREA\mflix-js\node_modules\mongodb\lib\core\uri_parser.js:542:21)
at connect (C:\TEMPAREA\mflix-js\node_modules\mongodb\lib\operations\connect.js:297:3)
at ConnectOperation.execute (C:\TEMPAREA\mflix-js\node_modules\mongodb\lib\operations\connect.js:208:5)
at executeOperation (C:\TEMPAREA\mflix-js\node_modules\mongodb\lib\operations\execute_operation.js:81:17)
at MongoClient.connect (C:\TEMPAREA\mflix-js\node_modules\mongodb\lib\mongo_client.js:219:10)
at Function.connect (C:\TEMPAREA\mflix-js\node_modules\mongodb\lib\mongo_client.js:389:22)
at Object. (C:\TEMPAREA\mflix-js\src/index.js:23:13)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Module._compile (C:\TEMPAREA\mflix-js\node_modules\pirates\lib\index.js:99:24)
at Module._extensions…js (internal/modules/cjs/loader.js:712:10)
[nodemon] app crashed - waiting for file changes before starting…

I was not able to resolve this configuration issue before failing chapter one. I would like to have this resolved for when I retake the class. what ever you can do to help would be greatly appreciated.

Thanks

Louie

This can be fixed after renaming the file to .env and adding connection string to the file.

Kanika

1 Like

I’m sorry to tag this on another request but every time I try to create my own topic I get “error creating tag” and can’t post my question. So I am piggybacking on your question…

zsh: command not found: npm

Can anyone help me understand why it shows a version but doesn’t recognize the npm command? See screenshot above. Using Mac Catalina. Thanks!

I think you have to switch the shell to bash by running
exec bash
There must be a step in your instructions to change the shell from zsh to bash
Please search our forum threads.You will get tips/clues

1 Like

Screen Shot 2020-10-06 at 2.32.21 PM

Tried but that did not work either.

You will need to install npm to continue with the course. :slight_smile:

Kanika