Error: UNKNOWN: unknown error
Answered
Singapura posted this in #help-forum
SingapuraOP
I just ran my npm and get this unknown error:
the package.json file has this inside:
which is all. I have no idea how to fix this, but I can't run my npm dev until it's fixed
$ npm run dev
> ergo@0.1.0 dev
> next dev
[Error: UNKNOWN: unknown error, readlink 'C:\Users\beaur\OneDrive\Documents\programming\ergo\ergo\.next\package.json'] {
errno: -4094,
code: 'UNKNOWN',
syscall: 'readlink',
path: 'C:\\Users\\beaur\\OneDrive\\Documents\\programming\\ergo\\ergo\\.next\\package.json'
}
the package.json file has this inside:
{"type": "commonjs"}
which is all. I have no idea how to fix this, but I can't run my npm dev until it's fixed
22 Replies
can you try deleting .next folder and trying again
Answer
SingapuraOP
Ah, that worked!
Thank you very much I truly appreciate the help
Why did that happen? A bug in the folder?
i think some weird cache issue, it may have gotten a bit confused when you saved a file
SingapuraOP
okay. Thanks and thank you for the quick response
no problem ðŸ‘
SingapuraOP
I'm sorry to bother you again. But another issue has come up
It seems like deleting the .next folder somehow deleted root layout?
I get this:
But I do have a root layout for every page
which is my layout.tsx file
import './globals.css'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import Link from 'next/link'
const inter = Inter({ subsets: ['latin'] })
export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
}
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body className={inter.className}>
<nav className="navBar">
<p id="icon" className='welcome'>Ergo</p>
<Link href='/'>Home</Link>
<Link href='/notes'>Notes</Link>
<Link href='/tasks'>Tasks</Link>
</nav>
{children}
</body>
</html>
)
}
Which just has my navbar
@risky
(sorry about the tag I wasn't sure if you could see this since it's marked as solved)
are you sure that it is in the same folder?
SingapuraOP
yes
ahhhhhh
umm can you create a new post as its now a diferent issue (and just resend the images and code) - also as im about to go to sleep... and i think someone else should beable to help you furthere there
SingapuraOP
okay 👠will do. Thank you for the help