angular-cli keeps throwing Error: Cannot find module 'source-map' - npm

So I installed the angular-cli using npm install #angular-devkit/build-angular but every time I try and use the ng command I get this error: Error: Cannot find module 'source-map'
even trying ng version throws the error. I also trying installing it using npm install angualt-cli but that didnt work either. Anyone know how to fix this issue?

I tried a lot of things and ended up just giving up and running npm install source-map which solved it for me.

Related

Cannot find module ‘#expo/metro-config’ when trying to start the project with expo cli >= 4.8.0

I recently tried to launch my project on a new computer. I downloaded the source code from its repository and ran npm install to get all the needed packages.
However, when I run npm start or expo start:web, I get the error:
Cannot find module '#expo/metro-config'
I ran npm install #expo/metro-config and the install run without issue, but I still get the “Cannot find module '#expo/metro-config'” error.
The only post I saw regarding this error recommends editing the metro.config.js but I do not use one.
I am on SDK 42, and the project launches fine on my other computer. Any idea what is happening?
FYI, I use to perform this whole operation without any issue until now.
UPDATE:
I ran npm install -g #expo/metro-config and now I get the error Cannot find module 'resolve-from'
So it looks like maybe running npm install -g expo-cli doesn't actually install all the necessary packages? Could it be the issue?
I managed to make it "work" (get other missing packages errors down the line) by reverting to expo-cli 4.7.3. Anything from 4.8.0 and above will cause the error.
Something else is that on a fresh npm install, after running npm install -g expo-cli, if I try to create a project with expo init, I will get the error Error: Cannot find module 'kleur'. Running npm install kleur fix it, but maybe that's also a clue.

vue ui Error: Cannot find module 'core-js/proposals/array-flat-and-flat-map'

I'm starting to learn Vue.js but when I try to launch vue ui, I get this error:
Error: Cannot find module 'core-js/proposals/array-flat-and-flat-map'
I tried to npm install -g core-js and yet still the same error.
my npm version is 6.4.1
Thanks for your anwsers
Here's a temp workaround while they work on resolving the underlying issue:
npm install -g core-js#3.0.0-beta.11
That temp resolution comes from this GitHub issue:
https://github.com/vuejs/vue-cli/issues/3406#issuecomment-459956718

Vue-cli 3: "command failed: npm install --loglevel error"

Every time I try to create a new project (vue create my-project), I get this error:
ERROR : command failed: npm install --loglevel error
I'm on PC / Windows 10, Vue-cli 3.2.1, Node 8.11.3, Npm 5.6.0.
Presets:
Babel, ESLint & Prettier, SASS, Vue router, Vuex
From the log:
2736 silly saveTree `-- vuex#3.0.1
2737 warn ajv-keywords#2.1.1 requires a peer of ajv#^5.0.0 but none is
installed. You must install peer dependencies yourself.
2738 verbose stack Error: EINVAL: invalid argument, read
Any idea what that means and how to solve it?
EDIT: I figured out that excluding any lint feature makes the problem disappear. So the question becomes: how can I still use linting and make it work?
Try
npm cache clean --force
If it doesn't work then manually delete %appdata%\npm-cache folder. Then try to create the project again.
Try pointing the npm registry url from 'https' to 'http'
Run following command :
npm config set registry="http://registry.npmjs.org/"
Then try creating vue project :
vue create my-project
It worked for me.
OR
Try :
sudo npm cache clean -f
npm update
npm update -g #vue/cli
vue create vue-first-app
I've tried everything above but still the error kept occuring. Finally I upgraded my npm version and node version, both to the latest ones and it worked.
Try using 'Dart-Sass' instead of using 'Node-Sass'. This will create your Vue project without any errors.
I am using "vue-cli 3.0.0-rc.1", I solve the problems by setting the ~/.vuerc from "useTaobaoRegistry": true, to false. Hope it help to you!!
The reason behind the error is , u are having an outdated version of node js. Try to reinstall node js and the probelm will get fixed("dont forget to uninstall and clear all the node js file before re-installing ")
I am using vue-cli 3.7.0-rc.1, I solve the problems by editing the ~/.vuerc from "useTaobaoRegistry": false to true.
Hope it works for you!
change permission by using the cli
npm config set unsafe-perm true
The problem is on the CLI
npm cache clean --force
%appdata%\npm-cache Just run on the "Run" Then Delete all the files
npm install -g #vue/cli
Just use npm 6 or greater
vue create projectName
problem solved 100% work for me
cheers
If you run into this issue on a Mac or Linux machine, you may simply need to sudo.
sudo vue create my-project
If you run into it on Windows, you may resolve the issue by running the terminal as admin.
I had the same issue. You have to use the command vue config --set useTaobaoRegistry false. After that it worked for me.
I had same issue when i was installing vue-cli with npx .... tried all the solutions from google.. nothing worked for me ..
so then i moved to install vue-cli with yarn package manager
thats when i figured out the issue ..
my issue was basically my node version which was 8.x.x but yarn was expecting 10.x.x
with nvm i have installed latest node which is 16.x.x
then tried installing vue-cli with yarn ..
it worked like charm!!!!
Source: https://medium.com/tableless/sass-vs-stylus-28c7e2884f1a
base language
Sass: Ruby
Stylus: JavaScript
Take out sass and use stylus. It will work.
I had the same issue using Ubuntu 20.04 OS. I used the command
npm install --loglevel error --legacy-peer-deps
and it worked for me.
Likely issue is your proxy settings:
I was having this issue recur intermittently and in the end I found out it was being caused by network proxy issues. See this article on how run npm behind a proxy server

Vue.js 2.3.2 version mismatch

After running npm run watch in terminal on my php laravel project I got this error:
Module build failed: Error:
Vue packages version mismatch:
- vue#2.3.2
- vue-template-compiler#2.2.6
This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader#>=10.0, simply update vue-template-compiler.
If you are using vue-loader#<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.
I tried to run this command npm update vue-template-compiler but the error remained.
Did somebody else meet with this problem?
I found the soluiton, I had to delete the node_modules folder, after I had to run npm install then the problem is solved.

Module not found: Error: Can't resolve 'ode_modulesue-loaderlibcomponent-normalizer'

I've recently decided to give vue-cli a go but after I run npm install, running npm run dev gives me the following error.
Module not found: Error: Can't resolve 'D:Projects estapp
ode_modulesue-loaderlibcomponent-normalizer' in 'D:\Projects\testapp\src'
Any ideas?
Thanks
I was able to fix this error by reinstalling previous version.
npm install vue-loader#10.0.0 --save-dev