Cannot find module 'webpack-cli/bin/config-yargs', cannot find module 'webpack-cli' - npm

I have tried nearly all solutions however nothing has worked for me. i cloned a repo from a friend and tried to run the client directory. When i try run client, i get the error:
Cannot find module 'webpack-cli/bin/config-yargs'
Cannot find module 'webpack-cli'
Once i cloned the project i did npm install (as it said in the readME) but when i tried to run the client i would run into this problem:
solutions i tried:
npm install -g vue-cli
npm install --save-dev webpack
npm install --save-dev webpack-cli
i tried 'webpack --version' it will tell me i am missing something and if i want to install it. i click yes and i get the following error:
Installing 'webpack-cli' (running 'npm install -D webpack-cli')...
npm WARN ajv-keywords#3.4.1 requires a peer of ajv#^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-middleware#3.4.0 requires a peer of webpack#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-server#3.1.11 requires a peer of webpack#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-cli#3.3.11 requires a peer of webpack#4.x.x but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
webpack-cli#3.3.11
updated 1 package and audited 12959 packages in 13.437s
24 packages are looking for funding
run npm fund for details
found 33 vulnerabilities (22 low, 7 moderate, 4 high)
run npm audit fix to fix them, or npm audit for details
Error: Cannot find module 'webpack-cli'

UPDATE:
My colleague updated some of the dependencies by GitHub bot and i pulled the repo. That seemed to do the trick

Related

How do I install jest?

Been trying to install jest with this command:
npm i --global jest
and get these messages:
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated request-promise-native#1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
/Users/GRW/.nvm/versions/node/v6.11.1/bin/jest -> /Users/GRW/.nvm/versions/node/v6.11.1/lib/node_modules/jest/bin/jest.js
npm WARN jsdom#16.4.0 requires a peer of canvas#^2.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN ws#7.3.1 requires a peer of bufferutil#^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws#7.3.1 requires a peer of utf-8-validate#^5.0.2 but none is installed. You must install peer dependencies yourself.
+ jest#26.4.2
updated 1 package in 32.731s
Have tried manually installing peer dependencies with:
npm i --save --global canvas#^2.5.0
npm i --save --global bufferutil#^4.0.1
npm i --save --global utf-8-validate#^5.0.2
but still am unable to install jest.
How do I install jest?
EDIT: Forget about the global install and the peer dependency warnings go away, but I still get:
-bash: jest: command not found
Since I seemed to have a prior installation of nvm that kept installations of different versions of node in different directories, I decided to start fresh.
Uninstalled and deleted jest, node, npm, and nvm.
Reinstalled node/npm, and was able to install jest and get the jest -v command to work properly.

Uninstalling quasar-cli via npm not working?

I was working on a Quasar project on my windows machine and out of blue it is saying quasar is not recognized as an internal or external command.
I tried to uninstall quasar-cli with the command npm uninstall -g quasar-cli but it seems it is not working. npm list -g --depth=0 command tells me that I still have the quasar-cli.
C:\Users\nitin>npm uninstall -g quasar-cli
up to date in 0.028s
C:\Users\nitin>npm list -g --depth=0
C:\Users\nitin\AppData\Roaming\npm
+-- #quasar/cli#1.1.0
+-- cordova#9.0.0
+-- nodemon#2.0.4
`-- vue-cli#2.9.6
I am also not able to install it again as it gives the following errors
C:\Users\nitin>npm install -g quasar-cli
npm WARN deprecated #babel/preset-stage-2#7.0.0-beta.54: � We've deprecated any official stage presets in favor of users explicitly opt-ing into the proposals they want to use versus any perceived convenience. You can also check https://github.com/babel/babel/issues/7770 for more information.
npm WARN deprecated chokidar#2.0.4: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated #babel/preset-stage-3#7.0.0-beta.54: � We've deprecated any official stage presets in favor of users explicitly opt-ing into the proposals they want to use versus any perceived convenience. You can also check https://github.com/babel/babel/issues/7770 for more information.
npm WARN deprecated core-js#2.6.11: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated joi#11.4.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated topo#2.0.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated hoek#4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN rollback Rolling back is-descriptor#1.0.2 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\nitin\AppData\Roaming\npm\node_modules\quasar-cli\node_modules\define-property\node_modules'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.2.2 (node_modules\quasar-cli\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN notsup Unsupported engine for watchpack-chokidar2#2.0.0: wanted: {"node":"<8.10.0"} (current: {"node":"12.17.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: watchpack-chokidar2#2.0.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.1.2 (node_modules\quasar-cli\node_modules\watchpack\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN ajv-keywords#3.5.1 requires a peer of ajv#^6.9.1 but none is installed. You must install peer dependencies yourself.
npm ERR! code EEXIST
npm ERR! path C:\Users\nitin\AppData\Roaming\npm\node_modules\quasar-cli\bin\quasar
npm ERR! dest C:\Users\nitin\AppData\Roaming\npm\quasar
npm ERR! EEXIST: file already exists, cmd shim 'C:\Users\nitin\AppData\Roaming\npm\node_modules\quasar-cli\bin\quasar' -> 'C:\Users\nitin\AppData\Roaming\npm\quasar'
npm ERR! File exists: C:\Users\nitin\AppData\Roaming\npm\quasar
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\nitin\AppData\Roaming\npm-cache\_logs\2020-07-19T04_24_31_029Z-debug.log
Can you please suggest where am I going wrong. I am new with npm and JS in general so please correct if I am missing something.
I've recently performed a manual delete for a similar issue I was facing, opting instead to use the rimraf package to delete a module from the npm root directory where global packages are installed.
Install rimraf using:
npm install rimraf -g
Navigate to the root folder of where the global packages are installed. Path to this can be found using:
npm root -g
Once you've cd' into the root folder perform the delete on the quasar-cli module using:
rimraf <name of folder>
Note:
<name of folder> is the name of the folder quasar-cli is contained within. Perform a dir/w to list the folder in the directory to check the exact name of the folder to insert in the command above.
The rimraf package is a cross-platform equivalent of what I use in the bash terminal rm -rf to recursively delete files and folders. You can see this in action on windows via: https://www.youtube.com/watch?v=qPCK6mWeqsk
Check that the removal of the package as per your previous command:
npm list -g --depth=0
Hope that helps
I ultimately had to delete the node-modules folder from
C:\Users\{user}\AppData\Roaming\npm\node_modules
as I was having issue not only with quasar but also with vue and everything else.
vue --version also wasn't working.
I deleted the node-modules folder from the above path and also from my project folder and then re-installed them using npm install -g command. This command needs to be run in your project folder where you have your package.json file.
Else you can individually install(globally using the -g appended to the command) each component of your need.
Restart the command prompt after installing the packages.
Don't forget to keep a list of all the packages you have using
npm list -g --depth=0`
Try this
npm uninstall -g #quasar/cli

npm audit fix --force

I wanted to get rid of my vurnerabilities and used
npm audit fix --force
But i canceled it after a few lines, because it said: "I hope you know what you are doing"
Now if i try
npm install
i get
$ npm install
npm WARN #angular-devkit/build-angular#0.900.7 requires a peer of typescript#>=3.6 < 3.8 but none is installed. You must install peer dependencies yourself.
npm WARN #ngtools/webpack#9.0.7 requires a peer of typescript#>=3.6 < 3.8 but none is installed. You must install peer dependencies yourself.
npm WARN #angular/compiler-cli#9.0.7 requires a peer of typescript#>=3.6 <3.8 but none is installed. You must install peer dependencies yourself.
npm WARN #angular/platform-browser-dynamic#8.1.3 requires a peer of #angular/compiler#8.1.3 but none is installed. You must install peer dependencies yourself.
npm WARN #ngtools/webpack#9.0.7 requires a peer of typescript#>=3.6 < 3.8 but none is installed. You must install peer dependencies yourself.
npm WARN ts-jest#24.0.2 requires a peer of jest#>=24 <25 but none is installed. You must install peer dependencies yourself.
audited 1219421 packages in 12.454s
39 packages are looking for funding
run `npm fund` for details
found 23 vulnerabilities (21 low, 2 moderate)
run `npm audit fix` to fix them, or `npm audit` for details
If I install #angular/compiler#8.1.3 i need #angular/compiler#9.0.7 and vise versa
I had the same problem i resolved it by running the command "ng update", this command will provide you with packages need to be updated and the commands to update it.Hope this will help you.

Expo says react-native is missing

I installed expo using the facebook guide by running
npm install -g expo-cli
npm install react-navigation
expo start
However it still says
npm WARN #react-native-community/netinfo#2.0.10 requires a peer of react-native#>=0.57 <0.60 but none is installed. You must install peer dependencies yourself.
npm WARN react-google-maps#9.4.5 requires a peer of #types/googlemaps#^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-google-maps#9.4.5 requires a peer of #types/markerclustererplus#^2.1.29 but none is installed. You must install peer dependencies yourself.
npm WARN react-google-maps#9.4.5 requires a peer of #types/react#^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-reanimated#1.0.1 requires a peer of react#16.0.0-alpha.6 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-reanimated#1.0.1 requires a peer of react-native#^0.44.1 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-webview#5.8.1 requires a peer of react-native#>=0.57 <0.60 but none is installed. You must install peer dependencies yourself.
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"})
I tried to delete my node_modules folder and rerunning npm install in the directory of my project
It still says react-native not found, although running
react-native -v
in command line, shows
react-native-cli: 2.0.1
react-native: 0.60.3
Actually you have only install expo-cli not react native cli , even if your package.json has react-native it is not accessiable from your cli . so you have to install react-native-cli seperately so that you can access react-native.
npm install –g react-native-cli

#vue-cli peer dependency warn

I created project using vue-cli 3, cd into it, ran npm install and got this error:
npm WARN ajv-keywords#2.1.1 requires a peer of ajv#^5.0.0 but none is installed. You must install peer dependencies yourself.
I ran
npm install ajv
Which finished with success, but I'm still getting same warn on npm install
npm install -g npm-install-peers
try this it will add all the missing peers and remove all the error