我不能 运行 我的项目 npm 运行 示例中的这个命令

i can't run this command with my project npm run sample

这是我的 package.json 我已经下载了这个项目,我正在尝试 运行 在我的电脑上

标题

我不能运行因为我遇到错误


我想知道我应该怎么做才能解决它



{
  "name": "ng-contact-manager",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "build": "ng build --prod",
    "start": "run-s build start:server",
    "start:server": "node src/server/index.js",
    "watch:client": "ng serve --proxy-config proxy.conf.json --open",
    "watch:server": "nodemon src/server/index.js",
    "watch": "run-p watch:*",
    "sample": "node src/server/data/seed-db.js",
    "test": "ng test",
    "lint": "ng lint"
  }

我正在尝试安装 npm run sample

i git 终端出现这个错误

> ng-contact-manager@0.0.0 sample C:\Users\power\Downloads\Compressed\angular-node-contact-manager-master\angular-node-contact-manager-master
> node src/server/data/seed-db.js

internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'bcrypt'
Require stack:
- C:\Users\power\Downloads\Compressed\angular-node-contact-manager-master\angular-node-contact-manager-master\src\server\data\seed-db.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\Users\power\Downloads\Compressed\angular-node-contact-manager-master\angular-node-contact-manager-master\src\server\data\seed-db.js:4:16)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\Users\power\Downloads\Compressed\angular-node-contact-manager-master\angular-node-contact-manager-master\src\server\data\seed-db.js'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ng-contact-manager@0.0.0 sample: `node src/server/data/seed-db.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ng-contact-manager@0.0.0 sample script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\power\AppData\Roaming\npm-cache\_logs21-03-11T12_55_42_814Z-debug.log

bcrypt:帮助您散列密码的库。

按顺序尝试 运行 这些:

npm install node-gyp -g
npm install bcrypt -g
npm install bcrypt --save

如果这不起作用,请重建节点模块。

npm rebuild

此命令在匹配的文件夹上运行 npm build 命令。

项目下载完成,还需要安装依赖[=​​13=]

运行先npm install安装项目需要的所有依赖

(见https://docs.npmjs.com/cli/v6/commands/npm-install

然后运行你的脚本npm run sample