Unable to install Speed-Insights on NextJS Shopify Template
Answered
Blue horntail woodwasp posted this in #help-forum
Blue horntail woodwaspOP
Hi friends, im trying to install "npm i @vercel/speed-insights" in the NextJS ecommerce template.
"https://vercel.com/new/personal-c3cac82c/templates/next.js/nextjs-commerce"
But when i do i get the following error.
I tested the installation with the nextjs boilerplate and was able to install it with no problems
See pic attached
So the issue has to be something with the ecommerce template that i am unaware of.
"https://vercel.com/new/personal-c3cac82c/templates/next.js/nextjs-commerce"
But when i do i get the following error.
$ npm install
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup [
npm WARN cleanup 'C:\\web development\\PS-NextJS\\node_modules\\next',
npm WARN cleanup [Error: EPERM: operation not permitted, rmdir 'C:\web development\PS-NextJS\node_modules\next\dist\esm\client\components'] {
npm WARN cleanup errno: -4048,
npm WARN cleanup code: 'EPERM',
npm WARN cleanup syscall: 'rmdir',
npm WARN cleanup path: 'C:\\web development\\PS-NextJS\\node_modules\\next\\dist\\esm\\client\\components'
npm WARN cleanup }
npm WARN cleanup ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\web development\PS-NextJS\node_modules\@vercel\git-hooks
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node ./install.js
npm ERR! â–³ @vercel/git-hooks: installing base hook to C:\web development\PS-NextJS\.git\hooks
npm ERR! node:fs:1808
npm ERR! binding.symlink(
npm ERR! ^
npm ERR!
npm ERR! Error: EPERM: operation not permitted, symlink '.\_do_hook.cjs' -> 'C:\web development\PS-NextJS\.git\hooks\applypatch-msg'
npm ERR! at Object.symlinkSync (node:fs:1808:11)
npm ERR! at installHook (C:\web development\PS-NextJS\node_modules\@vercel\git-hooks\install.js:122:5)
npm ERR! at Array.forEach (<anonymous>)
npm ERR! at Object.<anonymous> (C:\web development\PS-NextJS\node_modules\@vercel\git-hooks\install.js:146:3)
npm ERR! at Module._compile (node:internal/modules/cjs/loader:1378:14)
npm ERR! at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:1212:32)
npm ERR! at Module._load (node:internal/modules/cjs/loader:1028:12)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:142:12)
npm ERR! at node:internal/main/run_main_module:28:49 {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'symlink',
npm ERR! path: '.\\_do_hook.cjs',
npm ERR! dest: 'C:\\web development\\PS-NextJS\\.git\\hooks\\applypatch-msg'
npm ERR! }
npm ERR!
npm ERR! Node.js v21.6.2
npm ERR! A complete log of this run can be found in: C:\Users\Tech\AppData\Local\npm-cache\_logs\2024-02-21T21_44_03_395Z-debug-0.logI tested the installation with the nextjs boilerplate and was able to install it with no problems
See pic attached
So the issue has to be something with the ecommerce template that i am unaware of.
Answered by Bighead carp
npm install in a regular Windows command prompt will fail, as git-hooks is trying to build a symlink. Running npm install in an administrator command prompt, however, will work.
100 Replies
Blue horntail woodwaspOP
bump
Blue horntail woodwaspOP
Bump
Bighead carp
Do you have your dev server on
Sokoke
Did you see the EPERM error?
@Bighead carp Do you have your dev server on
Blue horntail woodwaspOP
no, i tested on two other templates and was able to install with no issues, so its more of a conflict of libraries i think
Bighead carp
try using yarn
@Sokoke Did you see the EPERM error?
Blue horntail woodwaspOP
i think so yea sec let me find it for you
Bighead carp
or restart your pc
Sokoke
Open a Admin terminal and try it again
Bighead carp
Delete the .next and node_modules folder, and run npm install
@Sokoke Open a Admin terminal and try it again
Blue horntail woodwaspOP
Failed to remove some directories [
npm WARN cleanup [
npm WARN cleanup 'C:\\Users\\Tech\\OneDrive\\Desktop\\Web Development Projects\\ps-v1\\node_modules',
npm WARN cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\Tech\OneDrive\Desktop\Web Development Projects\ps-v1\node_modules\next'] {
npm WARN cleanup errno: -4048,
npm WARN cleanup code: 'EPERM',
npm WARN cleanup syscall: 'rmdir',
npm WARN cleanup path: 'C:\\Users\\Tech\\OneDrive\\Desktop\\Web Development Projects\\ps-v1\\node_modules\\next'
npm WARN cleanup }
npm WARN cleanup ]
npm WARN cleanup ]`@Bighead carp Delete the .next and node_modules folder, and run npm install
Blue horntail woodwaspOP
i deleted node modules but i dont see the .next file , and got the same error
this is what the template comes with
maybe im being dumb since im new to this but
could it be not top level npm install
and instead i need to cd into a folder and do it
?
Bighead carp
Have you restarted your computer since it first happened
@Bighead carp Have you restarted your computer since it first happened
Blue horntail woodwaspOP
yes
Bighead carp
Where are you cd'd into
right now
show me your terminal
Blue horntail woodwaspOP
i deleted nodejs as well and reinstalled
Bighead carp
it'll probably be because you're in onedrive
move your project onto your machine outside of a network drive
Blue horntail woodwaspOP
yea i had a feeling ngl
Bighead carp
Let me know if it works
Blue horntail woodwaspOP
this is going to be dumb af
but i tried this and it always hooks into my onedrive idk why
like i made it on my c drive a folder
i made it on my desktop
i might just reinstall windows and skip the one drive connection this time around
Bighead carp
Yeah I suggest doing that
Blue horntail woodwaspOP
i did think this would be an issue because its a permissions error but i just really wanted to hope to find a different solution
ill reinstall and let yall know
thanks
Bighead carp
Could you mark the solution
If it works
Blue horntail woodwaspOP
ofc
Blue horntail woodwaspOP
@Bighead carp didn't work
npm i @vercel/speed-insights
npm ERR! code 1
npm ERR! path C:\Users\barre\Documents\GitHub\ps-v1\node_modules\@vercel\git-hooks
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node ./install.js
npm ERR! â–³ @vercel/git-hooks: installing base hook to C:\Users\barre\Documents\GitHub\ps-v1\.git\hooks
npm ERR! node:fs:1811
npm ERR! binding.symlink(
npm ERR! ^
npm ERR!
npm ERR! Error: EPERM: operation not permitted, symlink '.\_do_hook.cjs' -> 'C:\Users\barre\Documents\GitHub\ps-v1\.git\hooks\applypatch-msg'
npm ERR! at Object.symlinkSync (node:fs:1811:11)
npm ERR! at installHook (C:\Users\barre\Documents\GitHub\ps-v1\node_modules\@vercel\git-hooks\install.js:122:5)
npm ERR! at Array.forEach (<anonymous>)
npm ERR! at Object.<anonymous> (C:\Users\barre\Documents\GitHub\ps-v1\node_modules\@vercel\git-hooks\install.js:146:3)
npm ERR! at Module._compile (node:internal/modules/cjs/loader:1376:14)
npm ERR! at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:1207:32)
npm ERR! at Module._load (node:internal/modules/cjs/loader:1023:12)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
npm ERR! at node:internal/main/run_main_module:28:49 {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'symlink',
npm ERR! path: '.\\_do_hook.cjs',
npm ERR! dest: 'C:\\Users\\barre\\Documents\\GitHub\\ps-v1\\.git\\hooks\\applypatch-msg'
npm ERR! }
npm ERR!
npm ERR! Node.js v20.11.1
npm ERR! A complete log of this run can be found in: C:\Users\barre\AppData\Local\npm-cache\_logs\2024-02-22T16_33_59_335Z-debug-0.logBighead carp
delete your .git folder
and try again
Blue horntail woodwaspOP
going to try to do another install of the template and try again since that didn't work either, i spoke with vercel themselves and they were able to install it on their end so its something blocking it on my end i just dont know what im doing wrong...
Bighead carp
Did you try to delete your .git folder
Blue horntail woodwaspOP
yes
Bighead carp
100% can't be the same error
Send me a screenshot proving this
Blue horntail woodwaspOP
sure sec
its something with symlink not having access
but i removed onedrive and all
Bighead carp
Get out of WSL
Blue horntail woodwaspOP
sorry whats WSL
ah is it cause my pc isn't linux?
Bighead carp
You're using WSL right now
It's the subsystem for Linux
open the root directory in command prompt and try running your command again
Blue horntail woodwaspOP
this is on powershell
oks ec
Bighead carp
Right I've just asked you to prove to me you dont have a .git folder, through a video
and you've shown me a screenshot proving nothing really other than you have the same issue you've already stated
Show me a VIDEO of you WITHOUT a .git folder, and you trying to run the command
Blue horntail woodwaspOP
you asked me for a screenshot of the error? im confused?
Bighead carp
oh i meant video sorry
I thought I wrote video
Blue horntail woodwaspOP
you're good
give me a second
since this is a new install of the template ill record myself deleting it too
Bighead carp
Do you have the link to the repo by the way
Blue horntail woodwaspOP
i can give it yea sec
Bighead carp
Do you also have antivirus
Blue horntail woodwaspOP
just windows security but i have no alerts or w/e on so i dont need to approve
Bighead carp
There's an (old) github issue here with your issue https://github.com/vercel/git-hooks/issues/10
Bighead carp
npm install in a regular Windows command prompt will fail, as git-hooks is trying to build a symlink. Running npm install in an administrator command prompt, however, will work.
Answer
Bro...
This fucking worked
lmao...
Bighead carp
yeah it'll be a permission error
Blue horntail woodwaspOP
ive spent two days trying to figure this shit out
Bighead carp
Could you mark the solution please
(also use yarn)
yarn > npm
Blue horntail woodwaspOP
ty
im still pretty new to dev so ill look into yarn
Bighead carp
Good luck on your journey
Blue horntail woodwaspOP
Thank you
mind if i ask one more question actually
is pnpm seperate from npm ?
Bighead carp
Yeah
Blue horntail woodwaspOP
cause i cant run this command to launch
@Bighead carp Yeah
Blue horntail woodwaspOP
ok awesome ill look at where to download it
Bighead carp
Open another issue and mention me and I'll help
if needs be
Blue horntail woodwaspOP
â¤ï¸