Cannot find module './src/data' with vue-cli - vue.js

I created a project with vue-cli 4.1.1, and after running yarn serve, i got the following error
Error: [BABEL] C:\dev\vuestudy\src\main.js: Cannot find module './src/data' (While processing: "C:\\dev\\vuestudy\\node_modules\\#vue\\cli-plugin-babel\\preset.js")
Any tips on this?
Thanks in advance.
UPDATE:
Kousha and Dave are right,after waiting for the core-js package update, I created a new project, and now it's working.

It looks like there's been a bad build of npm package core-js-compat. This is a deep-down dependency of Babel. Lots of things will be affected, things that use Babel.
You will experience this problem if you have core-js-compat v.3.4.6. You can check this by doing npm list core-js-compat. The problem is apparently fixed by v.3.4.7, which was pushed out pretty quickly, about half-an-hour later, but unfortunately it takes a while to spread out through the repositories. You can either wait until an npm update gets you v.3.4.7 or you can go manually download v.3.4.7 if you want to get going right away.

This is a bug with core-js-compat v3.4.6, but already the fix has gone with v3.4.7. See https://github.com/zloirock/core-js/issues/712 for more detail.

You may be able to force install the not-broken version with
npm i core-js-compat#3.4.7 --save
It worked on my machine™

With Vue / Nuxt, you can delete package-lock.json and node_modules and do an npm install to fix this issue.

Related

react-native-math-view can't find variable require

While importing MathText and Mathview, im getting this error. There is no error in install. How can I fix this?
I have tried to reset cache, but it didn't work.
A few days ago, I had the same issue, but I downgraded to "react-native-math-view": "3.9.4", which solved the issue. Remember to delete node_modules and npm install again and reset your cache

React-Admin translations broken after upgrade to 3.18

Recently upgraded React-Admin in our project from 3.16.2 to 3.18.1 and noticed a bunch of the UI strings changed.
Where it previously said, 'ADD FILTER' or 'CREATE' it now says, 'RA.ACTION.ADD_FILTER' and 'RA.ACTION.CREATE'
We weren't passing an i18nProvider prop to the <Admin> component.
After the strings changed, I thought maybe it was required now, but adding one seems to have no effect.
package.json looks like this
"react-admin": "^3.18.1",
"ra-language-english": "^3.18.0",
"ra-i18n-polyglot": "^3.18.0",
Did some googling and found one similar sounding issue, but with no solution.
Has anyone else run into anything like this? Thanks.
Great suggestion by Gildas to use yarn.
For those wondering, got up and running very quickly by running:
npm install -g yarn
yarn
yarn start
Some additional helpful info in the yarn docs.

Vue Material postinstall failed

So I've been working on a Vue.js project for couple times now, and I am facing a problem I've never seen before.
Trying to git pull the project on another computer, or even downloading the project as a zip file, when it's time to npm install, vue-material module fails and the whole thing cannot be run.
It goes this way, with vie-material :
vue-material#1.0.0 postinstall C:\<my_things>\node_modules\vue-material
sh build/git-hooks/install.sh
Then I see this :
/usr/bin/bash: build/git-hooks/install.sh: No such file or directory
Then the modules' tree shows in the terminal, and at the end, I can see all the errors related to vue-material, with this statement :
Tell the author that this fails on your system:
sh build/git-hooks/install.sh
By the way, I tried to crate a brand new Vue project, and tried to add vue-material inside, no problem, so it has to do with my project.
Obviously though, /usr/bin/bash does not exist, since I'm running Windows 10.
Any knowledge on npm's installing routine ? I'm out of solution to try...
Can you share your package.json file?
I had this same problem just now and found that NPM could possibly be installing the incorrect version. Where I had "^vue-material": "1.0.0-beta-7" NPM was installing version 1.0.0 instead of 1.0.0-beta-7. If you remove the ^ then it may work for you. This is where I found the answer that helped me.
https://github.com/vuematerial/vue-material/issues/1155
Well, after couple times figuring out what was wrong, I got this :
I tried to use yarn and it told me that my node version was too old (vue-material needed 7.0+ and my node was 6.9, or at least that is what yarn told me), so I got myself the 8.9.3 node.
After this I tried to use yarn again, and the error with that bash script showed again.... then I just tried to use npm install again, and it worked just fine...
I don't know about the bash script thing, but one thing to remember is to always check for node and npm's version when errors happend.... (and yarn looks very cool and simple imo ^^).
You kinda made me think about a version problem though, I got you that ! :D
Problem solved....

Problems with resolving dependency node-fetch from github - fork still necessary?

While trying to install build dependencies in a docker environment (no git), we got follwing error:
npm ERR! git clone --template=/home/node/.npm/_git-remotes/_templates --mirror git#github.com:archilogic-com/node-fetch.git /home/node/.npm/_git-remotes/git-github-com-archilogic-com-node-fetch-git-1-x-03653294: undefined
Problem seems the dependency archilogic-com/node-fetch#1.x here.
Ok. We should be able to handle this.
On the other hand, the question is wether the fork is still necessary.
Imho the reason for forking was overriding the array-buffer,
which is already done in original node-fetch.
Maybe i'm wrong but using the original would help us a lot.
Many thanks in advance
Indeed looks like an update would be a good idea!
A Pull request is welcome: https://github.com/archilogic-com/3dio-js
Thank you!

How to install flow type correctly for react native#0.46+?

I've googled many sites but cannot found a tutorial that actually works for react-native + flow type.
There was flow installation guide from react-native#0.22 document, but it's gone in react-native#0.46.
However, it comes up again in Running Tests and Contributing, I tested to run npm run flow but not working, and yet it doesn't say how to make it works. It's possibly been a missing part inside of react-native documentation.
What I need is to run flow correctly with react-native. Auto-check flow every time I reload the page with ⌘R would be the best.
I just finished covering half of our project by flow and we use RN 0.44.0.
The tricky part is: do you also want to know errors inside node_modules, someone says those errors are helpful.
Anyway, I disable the error in node_modules, and here is my .flowconfig:
[ignore]
<PROJECT_ROOT>/node_modules/.*
<PROJECT_ROOT>/flowLibs.js
.....
[include]
[libs]
./flowLibs.js
.....
[lints]
[options]
You should install flow first if you not setup correctly,
npm install --save-dev flow-bin
and also run this in you project root after install:
npm run flow init
If npm run flow init does not work, just add "flow": "flow" in npm scripts.
After init, put my .flowconfig in your project .flowconfig file.
Then create a js file flowLibs.js and if npm run flow check cause your any error like Module_Name. Required module not found
Write down code in flowLibs.js:
declare module 'Module_Name' { declare var exports: any; };
After that, you should be good to go with you project now.
BTW, don't forget add //#flow on the top of the file which you want to check type.
I found flowtype is built in with react-native#0.46+.
For react-native document, I think they should at least tell flowtype is already built in. And for the rest document ex: Testing Your Changes#flow, it won't work without flow-bin, they should mention that too.
To make flowtype of best use, I use it with Visual Studio Code.
Steps:
Install flow-bin globally, by npm i flow-bin -g.
Make sure your terminal is responsive to command flow.
Install vscode flow extension.
Set vscode workspace preference with "javascript.validate.enable": false, to disable default javascript validation, so flow validation can take place.
To access vscode preference, ALT+F,P,S for windows, ⌘+, for mac.
then you have flowtype installed with visual result with every key stroke:
Try this one:
Adding Flow to React Native
https://medium.com/react-native-training/getting-started-with-react-native-and-flow-d40f55746809
Hope this helps!