I was following an online tutorial and it suggestd using PMPM as its better than NPM.
As I am on Windows I ran:
iwr https://get.pnpm.io/install.ps1 -useb | iex
in my root folder (D:/) but I get the error:
node:fs:2552
handleErrorFromBinding(ctx);
^
Error: ENOENT: no such file or directory, lstat 'D:\projects\aston\nextjs\my_username'
at Object.realpathSync (node:fs:2552:7)
at Object.realpathSync (pkg/prelude/bootstrap.js:1361:36)
at ../node_modules/.pnpm/[email protected]/node_modules/temp-dir/index.js (C:\snapshot\dist\pnpm.cjs)
at __require (C:\snapshot\dist\pnpm.cjs)
at ../node_modules/.pnpm/[email protected]/node_modules/tempy/index.js (C:\snapshot\dist\pnpm.cjs)
at __require (C:\snapshot\dist\pnpm.cjs)
at ../env/node.fetcher/lib/index.js (C:\snapshot\dist\pnpm.cjs)
at __require (C:\snapshot\dist\pnpm.cjs)
at ../env/plugin-commands-env/lib/node.js (C:\snapshot\dist\pnpm.cjs)
at __require (C:\snapshot\dist\pnpm.cjs) {
errno: -4058,
syscall: 'lstat',
code: 'ENOENT',
path: 'D:\\my_username'
}
- Why am I getting this error? / How do I resolve?
- Why does it matter which folder I am in when I run this command? Shouldn't it be defaulting to C:\Users\my_username - or is the fact I'm doing this from the d drive confusing it? (I also installed node.js on the d dive due to space constraints on my main c drive)
- Also my windows username folder is
c:\users\username_with_last_letter_chopped_off
- but this install is asking for
D:\\full_username. Therefore running in the install command from myc:\\usersdirectory does not solve things either.
Ok so then I tried running npm install instead which ran successfully..
3. Does it matter which folder I am in when run this?
Then I created my Next.JS app using npx create-next-app@latest and Cd'd into the folder
Within this folder I then ran pnpm install because that's why i saw in the tutorial.
This then gave me the error:
node:fs:2552
handleErrorFromBinding(ctx);
^
Error: ENOENT: no such file or directory, lstat 'D:\projects\aston\nextjs\my_username'
at Object.realpathSync (node:fs:2552:7)
at Object.realpathSync (pkg/prelude/bootstrap.js:1361:36)
at ../node_modules/.pnpm/[email protected]/node_modules/temp-dir/index.js (C:\snapshot\dist\pnpm.cjs)
at __require (C:\snapshot\dist\pnpm.cjs)
at ../node_modules/.pnpm/[email protected]/node_modules/tempy/index.js (C:\snapshot\dist\pnpm.cjs)
at __require (C:\snapshot\dist\pnpm.cjs)
at ../env/node.fetcher/lib/index.js (C:\snapshot\dist\pnpm.cjs)
at __require (C:\snapshot\dist\pnpm.cjs)
at ../env/plugin-commands-env/lib/node.js (C:\snapshot\dist\pnpm.cjs)
at __require (C:\snapshot\dist\pnpm.cjs) {
errno: -4058,
syscall: 'lstat',
code: 'ENOENT',
path: 'D:\\projects\\aston\\nextjs\\my_username'
}
- As you see it is looking for: 'D:\projects\aston\nextjs\my_username'
Well I obvioulsly would not want my_username to be part of my app folder. So what folder shoud I be running it from.
- Finally I keep noticing a
D:\\projects\\my_username\\AppData\\Localfolder being created at various times. Why is this appearing in my projects folder. Shouldn't it be defaulting to using my actual Windows username folder? Or is it because I'm on the D directory instead of the C drive and it's getting confused?
So yeah as you can see I'm confused about a lot of things!
Edit: Ok I created this folder:
C:\Users\full_username\AppData\Local
and now iwr https://get.pnpm.io/install.ps1 -useb | iex seems to have worked. But now if I go into my project folder and type pnpm just to see if it's detected it gives the error:
node:fs:2552
handleErrorFromBinding(ctx);
^
Error: ENOENT: no such file or directory, lstat 'D:\projects\aston\nextjs\my_username'
...
errno: -4058,
syscall: 'lstat',
code: 'ENOENT',
path: 'D:\\projects\\aston\\nextjs\\my_username'
}
But I don't want my username to be in my project folder!
Ok after reading through: https://pnpm.io/faq
I concluded that PNPM is just buggy on windows,esp. when you have different volumes like I do. Will just give up on it and stick to npm.