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

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

Related

Expo-cli ReferenceError: process is not defined

I installed expo-cli 5.4.10 (node v16.14.0) after which i execute the command
yarn start
I go to the browser and see this error in the console ReferenceError: process is not defined
looking for several solutions such as (https://bobbyhadz.com/blog/react-referenceerror-process-not-defined)
I have tried the following
npm install react-scripts#latest
npm install --save-dev react-error-overlay#6.0.9
package.json
"resolutions": {
"react-error-overlay": "6.0.9"
}
but this does not solve my problem in any way, perhaps someone has come across a similar one and is ready to help me
Had same problem today.
Solution: npm i -g expo-cli#5.4.9
The web interface from cli is broken in version 5.4.10.
You can either use it with the terminal only, or use 5.4.8 (5.4.9 might work, but I haven't tested it yet)

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.

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

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.

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 "ParseError: 'import' and 'export' may appear only with 'sourceType: module'"

I am trying to import a node module into my Vue project and am getting the following error:
ParseError: 'import' and 'export' may appear only with 'sourceType: module'
I understand that this is probably due to the node module not being transformed by babelify but I am not sure how to fix it.
My code can be found here:
https://github.com/timothyylim/vue-date-picker-example
Running
npm install
npm run dev
should show the error. I simply started with the vue-cli browserify template and tried to pull in a date picker component.
Any help would be greatly appreciated!
Follow the readme of the project you linked and use vue-cli: ~
npm install -g vue-cli
vue init browserify my-project
cd my-project
npm install
npm run dev
Follow up the command-line instructions, I had to install also #vue/cli-init as suggested. By the time being this worked, I can see the vue-cli compiles the same example you pointed out.
EDIT:
Looks like this was a issue with the component weifeiyue/vue-datepicker-local, it was recently fixed here:
https://github.com/weifeiyue/vue-datepicker-local/commit/a6e3078936a37acc1d6344b7b4d8c14b42be0844
The solution should be as simple as update the component.