首页 > 解决方案 > 我想用 npm 安装 THREE.JS。发现15个高危漏洞

问题描述

我正在做官方文档的教程。

官方文档——three.js

我明白了,我需要这样写:npm install three --save-dev 官方three.js上的代码npm


我做到了,我有很多错误


PS C:\Users\laaou\Desktop\three> npm install three --save-dev
npm WARN saveError ENOENT: no such file or directory, 
open 'C:\Users\laaou\package.json'
npm WARN enoent ENOENT: no such file or directory, open     'C:\Users\laaou\package.json'
npm WARN tailwindcss@2.2.7 requires a peer of autoprefixer@^10.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN laaou No description
npm WARN laaou No repository field.
npm WARN laaou No README data      
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ three@0.132.2

18 packages are looking for funding
  run `npm fund` for details

found 15 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
PS C:\Users\laaou\Desktop\three> npm audit fix
npm ERR! code EAUDITNOPJSON
npm ERR! audit No package.json found: Cannot audit a project without a package.json

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\laaou\AppData\Roaming\npm-cache\_logs\2021-08-31T17_59_47_376Z-debug.log      

代码终端错误

有趣的部分:

编辑:我认为是 vscode 扩展代码和源代码,因为不可能,事实是 5k 仅适用于 three.js。


我不知道我是怎么遇到这个错误的(我是初学者)。


谢谢如果你帮助我,我会放✅如果有用。


标签: npmvisual-studio-codeinstallationthree.js

解决方案


您的项目似乎没有正确设置。它是为 设置的git,但不是为npm.

错误信息:

npm ERR! audit No package.json found: Cannot audit a project without a package.json

说明您必须有一个 package.json 文件。

npm init -y

将获得一个基本的 npm 结构


第二件事是您在 vscode 源代码控制中看到 git 更改,但在资源管理器中看不到文件。这可能是因为您的资源管理器正在过滤这些目录:node_modules.git

设置 > 搜索“files.exclude” > 检查列表

通常 .git 默认是隐藏的


推荐阅读