运行 来自 github 的 js 代码有一些问题

having some problem running js code from github

我正在建立一个网站,我想产生效果 like this 所以我想在本地下载 GitHub 的代码并在我的 trial/error 上做一些实验计算机了解如何使用该效果。

问题是我无法运行代码,如果我下载zip文件夹然后运行HTML文件,页面不显示任何事物。我还按照 GitHub 页面上的“说明”部分进行了操作,我已经安装了 npm,但是如果我从终端执行代码 npm 运行 start1 我会收到这些错误(我目前正在使用 Mac OS High Sierra 作为操作系统)。

npm ERR! code ENOENT

npm ERR! syscall open

npm ERR! path /Users/name-user/package.json

npm ERR! errno -2

npm ERR! enoent ENOENT: no such file or directory, open '/Users/name-user/package.json'

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/name-user/.npm/_logs/2020-09-14T18_45_57_300Z-debug.log

所以我真的不知道如何 运行 在本地演示,你能帮我弄清楚我做错了什么吗?

谢谢!

当我这样做时它对我有用。

当 运行 npm run start1 时,你确定你在项目目录中吗?

此外还有 yarn.lockpackage-lock.json,您应该只保留其中之一。尝试 rm -rf node-modules rm yarn.lock 然后再 npm install