fireship-io / threejs-scroll-animation-demo

3D Scrolling Portfolio Website with Three.js
1.49k stars 644 forks source link

Problem running Vite build following YouTube video, also problem installing as in readme -- Error Node Module esbuild #6

Open 5IM-I-LAR opened 3 years ago

5IM-I-LAR commented 3 years ago

I'm having a problem initializing Vite build with npm in VSCode...

When I try to install:

    npm init @vitejs/app
    Select a framework: vanilla
    Select a variant:

the options aren't (like I see in the YouTube tutorial)

    >JavaScript
    >TypesScript

they are

     >vanilla
     >vanilla-ts

If I go ahead with the 'vanilla' option (as there is no 'JavaScript' option for some reason??), am receiving error on npm install.

The problem seems to be with the esbuild?

npm ERR! path /../prjct-vite/node_modules/esbuild
npm ERR! command failed
npm ERR! command sh -c node install.js

Does anyone else have any experince with this?

I'm stuck and don't know where to go to find answers...

npm -v7.19.1 node -v14.17.3

form the debug log:

133 error code 1
134 error path /../prjct-vite/node_modules/esbuild
135 error command failed
136 error command sh -c node install.js
137 error dyld: Symbol not found: _clock_gettime
137 error   Referenced from: /../prjct-vite/node_modules/esbuild/bin/esbuild__
137 error   Expected in: flat namespace
137 error
137 error The version of the downloaded binary is incorrect: Command failed: /../prjct-vite/node_modules/esbuild/bin/esbuild__ --version
137 error dyld: Symbol not found: _clock_gettime
137 error   Referenced from: /../prjct-vitenode_modules/esbuild/bin/esbuild__
137 error   Expected in: flat namespace
137 error
137 error
137 error Install unsuccessful
138 verbose exit 1

If follow readme only:

If I try to run:

git clone 
npm install
npm run dev

also geting errors on npm install:

npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile 
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile 
npm ERR! code 1
npm ERR! path /../prjct-vite/node_modules/esbuild
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! dyld: Symbol not found: _clock_gettime
npm ERR!   Referenced from: /../prjct-vite/node_modules/esbuild/bin/esbuild__
npm ERR!   Expected in: flat namespace
npm ERR! 
npm ERR! The version of the downloaded binary is incorrect: Command failed: /../prjct-vite/node_modules/esbuild/bin/esbuild__ --version
npm ERR! dyld: Symbol not found: _clock_gettime
npm ERR!   Referenced from: /../prjct-vite/node_modules/esbuild/bin/esbuild__
npm ERR!   Expected in: flat namespace
npm ERR! 
npm ERR! 
npm ERR! Install unsuccessful

Thanks in advace!

DrewDevero commented 3 years ago

If you're still having issues, I wound up having issues using Vite as well (I'm on windows), so I went with rendering using React instead. Live version works at Three D Website Code is here: Three D Code Any more tips from the fireship team welcome. Hope this helps.

spencerbart commented 2 years ago

I am having the same issue. DrewDevero's code works though.