In my Nuxt.js application, I want to use the newest version (5.4.2) of nuxt-i18n. I used it previously without any problems, but I do not understand what is going wrong now:
Version
v5.4.2
Reproduction link
https://github.com/begueradj/nuxti18nerror
Steps to reproduce
Either clone my project and follow the README file instructions
Or create the a Nuxt.js project: yarn create nuxt-app my-project, then install the plugin: yarn add nuxt-i18n , then add it to the configuration file nuxt.config.js as the official documentation says: modules: [ ['nuxt-i18n', { // Options }] ]
What is expected ?
I expect to launch the server without errors when I run yarn run dev. As simple as that.
What is actually happening?
When I run yarn run dev I am getting this error message:
INFO Building project
✖ fatal /home/begueradj/nuxti18nerror/node_modules/nuxt-i18n/src/helpers/components.js:1
Error: Cannot find module 'acorn-walk'
at Object.<anonymous> (/home/begueradj/nuxti18nerror/node_modules/nuxt-i18n/src/helpers/components.js:5:16)
at Object.Module._extensions..js (module.js:664:10)
Nuxt Fatal Error :(
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
For anyone stumbling on the same issue, my boss solved the problem as soon as I informed him about it:
yarn add acorn-walk
(I think the solution is self explanatory)
Update:
This is officially fixed now.
Related
I installed Vue cli. I'm running the npm run serve command without writing any code yet, but unfortunately I'm getting below error. Is there anyone who can help?
The latest version of Node Js is installed. I thought it had something to do with Nodejs so I reinstalled nodejs but it didn't work.
I encountered the same issue today. Apparently it is caused by the newest version of esquery (1.4.1).
To fix this simply use an older version of esquery. You can do this via:
npm install --save-dev esquery#1.4.0
Be sure to not update or remove the ^ from "esquery": "^1.4.0" in package.json afterwards.
It's an esquery bug. Here is the relevant issue: https://github.com/estools/esquery/issues/135
If you are using yarn you can resolve a previous version of the problematic package (esquery) by putting this into packge.json. This will ignore the problematic version from one of the deps and use this explicit version.
"resolutions": {
"esquery": "1.4.0"
},
If you are using npm you can replace resolutions with overrides: https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides
How resolution works: https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/#toc-how-to-use-it
Thank you for your answers. After I asked my question here, I reinstalled the vue cli project, but this time I did it by installing the default settings. I had installed it using airnb settings in the previous installation. This is how I solved the problem.
After creating a vite app. I run the command npm run dev and I get this error
[vite:esbuild] The service is no longer running: write EPIPE
Please, How do I solve this error.
I have tried the following solutions
Vite build fails with esbuild error
error while transforming /app/client/vite.config.ts with esbuild in Docker image
Turn off your Antivirus Software
Disable your antivirus software then go ahead and run:
npm run dev
I found a solution to my problem. If you have an anti-virus, you need to uninstall it.
I myself, I had to uninstall SMADAV anti-virus.
I have a next.js project and I keep getting:
error - ./node_modules/jspdf/dist/jspdf.es.min.js:458:25
Module not found: Can't resolve 'canvg'
I'm not sure why because I'm not including either jspdf or canvg.
Not sure what's causing it. Any help would be appreciated. I'm using material-ui if that matters.
It seems dependency error means that particular Module is missing when it's running.
Run npm ls or yarn list will print to stdout all the versions of packages that are installed, as well as their dependencies, in a tree-structure. Then search for that particulate packages are listed or not.
Run npm ls jspdf or yarn list jspdf then you can see its list of dependencies in tree-structure.
Please check your node version is updated or not ? If not then update first.
Quick & Dirty way: delete package.lock or yarn.lock file and delete .node_modules folders And Then run npm install or yarn to install again.
Look at console while you installing and make sure there are no error in the installing process. If you saw error you better look that massages also.
I am getting the below error when doing next build in my next.js app, after it's been working fine with just next (or npm run dev).
The error:
$ next build
The module 'react-dom' was not found. Next.js requires that you include it in 'dependencies' of your 'package.json'. To add it, run 'npm install --save react-dom'
Creating an optimized production build ...
> Using external babel configuration
> Location: "../.babelrc"
Failed to compile.
./pages/_app.js
Module not found: Can't resolve 'next/head' in '../pages'
> Build error occurred
Error: > Build failed because of webpack errors
at build (.../AppData/Roaming/npm/node_modules/next/dist/build/index.js:7:847)
I started my project by cloning Material UI's next.js example and just use that as it seems updated:
https://github.com/mui-org/material-ui/tree/master/examples/nextjs
However, thinking I just may of have an outdated or broken build, I re-cloned the next.js example and did next build as well, without modifying any files and I get the same error.
How can I fix this?
I just cloned that next.js example and it worked both with npm run dev, as well as npm run build->npm run start.
Judging by your error, I would check that "react-dom": "latest" is present in your package.json's dependencies. Did you run npm install after cloning the example?
The solution to this problem is to Just rerun these two commands again then your project will successfully Run. I also faced this problem but I got the solution.
npm i
yarn install
I ran into a similar problem when I included my nextjs app in a yarn workspace. I got around the issue by deleting the following directories in my nextjs app:
node_modules
.next
build
After removing them I ran yarn from the repo directory and started the nextjs app back up and it was working again.
After updating my NPM packages, this application stopped working and started throwing the following errors:
**Error Message #1**
Uncaught (in promise) TypeError: Cannot read property 'call' of undefined
at o (fusioncharts.js:13)
at o.t (fusioncharts.js:13)
**Error Message #2**
Uncaught Error: #90211 ExtensionName Error >> A FusionCharts extension must have a getName API or a name property.
at o (fusioncharts.js:13)
at Function.i (fusioncharts.js:13)
at Function.e.addDep (fusioncharts.js:13)
at fusioncharts.js:13
The Error #1 appears once, and Error #2 happens about 30x, until it crashes the app.
Things I tried
Lots of googling about these errors, very little information came up; searched SO and found nothing about these specific errors.
I thought the errors might mean the CDN for FusionCharts was corrupted, so I replaced the CDN and refreshed (tried several options); no change.
I also considered that a global variable may be messing something up, but I double-checked and all of my required dependencies are in the package.json.
I thought it might be related to package managers, so I tried running "NPM install" and "Yarn install" to refresh packages. Nothing.
Does anyone have any ideas about these errors? Or other things I can try?
Solved
This was a package management issue. I was using NPM and Yarn together (known to be risky), and I accidentally used "npm install" to refresh the packages instead of "yarn install". This scrambled the yarn tree for my local environment, creating dependency gaps. I tried "yarn install", but by then it was too late (detailed explanation here)
To fix this, you need to reset your local environment.
Steps I took to resolution:
1. Delete node & yarn and local repository
2. Reinstall node & yarn and download repo
3. Run "yarn install" (builds the dependency tree)
4. Run "yarn start" or "yarn dev"
I'm very relieved this worked. I hope this is helpful, please comment for more detail.
For others that run into this issue, it can also be a matter of mismatch fusioncharts versions between what you have installed with node and what is in the index.html of your project.
<script
type="text/javascript"
src="https://cdn.fusioncharts.com/fusioncharts/3.18.0/fusioncharts.js"
></script>
The version defined here (3.18.0) must match what is installed via node (fusioncharts#3.18.0).
This was the case when using both Fusiontime & Fusioncharts Suites in an angular(v12.2) project.