sqlite 为什么我不能运行`npm install`?

knsnq2tg  于 12个月前  发布在  SQLite
关注(0)|答案(1)|浏览(132)

我正在尝试完成Codecademy的Web开发技能路径提供的一个项目,名为“Gold Metal Skill”。目标是构建一个使用SQLite的Web应用程序。他们提供了一些启动代码,并指示首先运行npm install来安装所有依赖项,但我甚至无法完成第一步,因为npm一直向我抛出错误。下面是package.json文件:

{
  "name": "agoldmedalmetric",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "mocha",
    "webpack": "webpack",
    "start": "node server.js"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.2",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "react": "^15.6.1",
    "react-dom": "^15.6.1",
    "webpack": "^3.5.5"
  },
  "dependencies": {
    "chai": "^4.1.2",
    "cors": "^2.8.4",
    "csv-parse": "^1.2.1",
    "express": "^4.15.4",
    "fs": "0.0.1-security",
    "mocha": "^6.1.3",
    "react-router-dom": "^4.2.2",
    "sqlite3": "^4.0.6"
  }
}

字符串
我的错误日志:

npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: This is probably built in to whatever tool you're using. If you still need it... idk
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path /Users/masonbennett/Dropbox/My Mac (Mason’s MacBook Air)/Desktop/Programming/programs/github/web_apps/project-5-gold-medal-metrics-start/node_modules/sqlite3
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c
npm ERR! Failed to execute '/Users/masonbennett/.nvm/versions/node/v18.18.0/bin/node /Users/masonbennett/.nvm/versions/node/v18.18.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/masonbennett/Dropbox/My Mac (Mason’s MacBook Air)/Desktop/Programming/programs/github/web_apps/project-5-gold-medal-metrics-start/node_modules/sqlite3/lib/binding/node-v108-darwin-arm64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/masonbennett/Dropbox/My Mac (Mason’s MacBook Air)/Desktop/Programming/programs/github/web_apps/project-5-gold-medal-metrics-start/node_modules/sqlite3/lib/binding/node-v108-darwin-arm64 --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok


我注意到有几个npm WARN deprecated消息,我认为最好的办法是一次解决一个。但是当我试图运行npm install babel-preset-env --save-dev来更新“babel-preset-es 2015”时:“^6.24.1”我收到了同样的错误消息。我真的必须一次重新安装所有这些软件包吗?我必须更新所有的starter js文件吗?

jjjwad0x

jjjwad0x1#

我建议从删除package.json中的^字符开始。
这个字符告诉npm选择每个包的最新的次要版本,理想情况下没有破坏性的更改。
通过删除它,您应该安装作者当时拥有的版本。
如果你一个接一个地安装它们,你会得到最新的版本,就像作者在创建它时所做的那样。

相关问题