npm软件包scrypt的安装错误

时间:2020-07-21 13:22:12

标签: npm npm-install

我需要在计算机上安装一个npm软件包,该软件包依赖于软件包“ scrypt”。安装时,由于此依赖性,构建失败。现在,我想解决这个错误,第一个(显而易见的)想法是单独安装scrypt-package。

有关环境的一些信息:我正在运行MacOS X 10.15.6和npm 6.14.6。我的海湾合作委员会是

Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0

在这里,当我尝试安装软件包时会发生什么:

npm install -g scrypt

> scrypt@6.0.3 preinstall /usr/local/lib/node_modules/scrypt
> node node-scrypt-preinstall.js


> scrypt@6.0.3 install /usr/local/lib/node_modules/scrypt
> node-gyp rebuild

  SOLINK_MODULE(target) Release/copied_files.node
  CC(target) Release/obj.target/scrypt_wrapper/src/util/memlimit.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/keyderivation.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/pickparams.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/hash.o
  LIBTOOL-STATIC Release/scrypt_wrapper.a
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/crypto/crypto_scrypt.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/crypto/crypto_scrypt_smix.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/util/warnp.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/alg/sha256.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/util/insecure_memzero.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/scryptenc/scryptenc_cpuperf.o
  LIBTOOL-STATIC Release/scrypt_lib.a
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_common.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_async.o
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:
../src/node-boilerplate/inc/scrypt_common.h:39:14: error: no matching member function for call to 'Get'
      N(obj->Get(Nan::New("N").ToLocalChecked())->Uint32Value()),
        ~~~~~^~~
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3713:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3716:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:
../src/node-boilerplate/inc/scrypt_common.h:40:14: error: no matching member function for call to 'Get'
      r(obj->Get(Nan::New("r").ToLocalChecked())->Uint32Value()),
        ~~~~~^~~
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3713:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3716:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:
../src/node-boilerplate/inc/scrypt_common.h:41:14: error: no matching member function for call to 'Get'
      p(obj->Get(Nan::New("p").ToLocalChecked())->Uint32Value()) {}
        ~~~~~^~~
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3713:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3716:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
../src/node-boilerplate/inc/scrypt_async.h:53:17: warning: 'Call' is deprecated [-Wdeprecated-declarations]
      callback->Call(1, argv);
                ^
../node_modules/nan/nan.h:1741:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../node_modules/nan/nan.h:106:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_params_async.h:35:36: error: too few arguments to function call, single argument 'context' was not specified
      maxtime(info[0]->NumberValue()),
              ~~~~~~~~~~~~~~~~~~~~ ^
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8.h:2857:3: note: 'NumberValue' declared here
  V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
  ^
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8config.h:422:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_params_async.h:36:39: error: too few arguments to function call, single argument 'context' was not specified
      maxmemfrac(info[1]->NumberValue()),
                 ~~~~~~~~~~~~~~~~~~~~ ^
/Users/sebastian/Library/Caches/node-gyp/14.5.0/include/node/v8.h:2857:3: note: 'NumberValue' declared here
  V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
  ^
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8config.h:422:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_params_async.h:37:36: error: too few arguments to function call, single argument 'context' was not specified
      maxmem(info[2]->IntegerValue()),
             ~~~~~~~~~~~~~~~~~~~~~ ^
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8.h:2859:3: note: 'IntegerValue' declared here
  V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
  ^
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8config.h:422:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_params_async.h:38:39: error: too few arguments to function call, single argument 'context' was not specified
      osfreemem(info[3]->IntegerValue())
                ~~~~~~~~~~~~~~~~~~~~~ ^
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8.h:2859:3: note: 'IntegerValue' declared here
  V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
  ^
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8config.h:422:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/node-boilerplate/scrypt_params_async.cc:23:8: error: no matching member function for call to 'Set'
  obj->Set(Nan::New("N").ToLocalChecked(), Nan::New<Integer>(logN));
  ~~~~~^~~
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3666:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3669:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
../src/node-boilerplate/scrypt_params_async.cc:24:8: error: no matching member function for call to 'Set'
  obj->Set(Nan::New("r").ToLocalChecked(), Nan::New<Integer>(r));
  ~~~~~^~~
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3666:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3669:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
../src/node-boilerplate/scrypt_params_async.cc:25:8: error: no matching member function for call to 'Set'
  obj->Set(Nan::New("p").ToLocalChecked(), Nan::New<Integer>(p));
  ~~~~~^~~
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3666:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/xyz/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3669:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
../src/node-boilerplate/scrypt_params_async.cc:32:13: warning: 'Call' is deprecated [-Wdeprecated-declarations]
  callback->Call(2, argv);
            ^
../node_modules/nan/nan.h:1741:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../node_modules/nan/nan.h:106:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
2 warnings and 10 errors generated.
make: *** [Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_async.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/Cellar/node/14.5.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/scrypt
gyp ERR! node -v v14.5.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt@6.0.3 install 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!     /Users/xyz/.npm/_logs/2020-07-21T10_17_05_706Z-debug.log

提到的“完整日志”如下所示:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/usr/local/Cellar/node/14.5.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'scrypt'
1 verbose cli ]
2 info using npm@6.14.5
3 info using node@v14.5.0
4 verbose npm-session f8e98571f4b1970b
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/scrypt 204ms
8 http fetch GET 200 https://registry.npmjs.org/scrypt/-/scrypt-6.0.3.tgz 94ms
9 silly pacote tag manifest for scrypt@latest fetched in 316ms
10 timing stage:loadCurrentTree Completed in 331ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 1ms
14 silly install loadShrinkwrap
15 timing stage:loadIdealTree:loadShrinkwrap Completed in 0ms
16 silly install loadAllDepsIntoIdealTree
17 silly resolveWithNewModule scrypt@6.0.3 checking installable status
18 http fetch GET 200 https://registry.npmjs.org/nan 59ms
19 http fetch GET 200 https://registry.npmjs.org/nan/-/nan-2.14.1.tgz 57ms
20 silly pacote range manifest for nan@^2.0.8 fetched in 122ms
21 silly resolveWithNewModule nan@2.14.1 checking installable status
22 timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 128ms
23 timing stage:loadIdealTree Completed in 130ms
24 silly currentTree lib
25 silly idealTree lib
25 silly idealTree └─┬ scrypt@6.0.3
25 silly idealTree   └── nan@2.14.1
26 silly install generateActionsToTake
27 timing stage:generateActionsToTake Completed in 16ms
28 silly diffTrees action count 2
29 silly diffTrees add nan@2.14.1
30 silly diffTrees add scrypt@6.0.3
31 silly decomposeActions action count 16
32 silly decomposeActions fetch nan@2.14.1
33 silly decomposeActions extract nan@2.14.1
34 silly decomposeActions preinstall nan@2.14.1
35 silly decomposeActions build nan@2.14.1
36 silly decomposeActions install nan@2.14.1
37 silly decomposeActions postinstall nan@2.14.1
38 silly decomposeActions finalize nan@2.14.1
39 silly decomposeActions refresh-package-json nan@2.14.1
40 silly decomposeActions fetch scrypt@6.0.3
41 silly decomposeActions extract scrypt@6.0.3
42 silly decomposeActions preinstall scrypt@6.0.3
43 silly decomposeActions build scrypt@6.0.3
44 silly decomposeActions install scrypt@6.0.3
45 silly decomposeActions postinstall scrypt@6.0.3
46 silly decomposeActions finalize scrypt@6.0.3
47 silly decomposeActions refresh-package-json scrypt@6.0.3
48 silly install executeActions
49 silly doSerial global-install 16
50 verbose correctMkdir /Users/xyz/.npm/_locks correctMkdir not in flight; initializing
51 verbose lock using /Users/xyz/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
52 silly doParallel extract 2
53 silly extract nan@2.14.1
54 silly extract scrypt@6.0.3
55 silly tarball trying scrypt@latest by hash: sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0=
56 silly tarball trying nan@^2.0.8 by hash: sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==
57 silly extract nan@^2.0.8 extracted to /usr/local/lib/node_modules/.staging/nan-7d749488 (47ms)
58 silly extract scrypt@latest extracted to /usr/local/lib/node_modules/.staging/scrypt-71ea5a1b (73ms)
59 timing action:extract Completed in 76ms
60 silly doReverseSerial unbuild 16
61 silly doSerial remove 16
62 silly doSerial move 16
63 silly doSerial finalize 16
64 silly finalize /usr/local/lib/node_modules/scrypt/node_modules/nan
65 silly finalize /usr/local/lib/node_modules/scrypt
66 timing action:finalize Completed in 9ms
67 silly doParallel refresh-package-json 2
68 silly refresh-package-json /usr/local/lib/node_modules/scrypt/node_modules/nan
69 silly refresh-package-json /usr/local/lib/node_modules/scrypt
70 timing action:refresh-package-json Completed in 16ms
71 silly doParallel preinstall 2
72 silly preinstall nan@2.14.1
73 info lifecycle nan@2.14.1~preinstall: nan@2.14.1
74 silly preinstall scrypt@6.0.3
75 info lifecycle scrypt@6.0.3~preinstall: scrypt@6.0.3
76 verbose lifecycle scrypt@6.0.3~preinstall: unsafe-perm in lifecycle true
77 verbose lifecycle scrypt@6.0.3~preinstall: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/local/lib/node_modules/scrypt/node_modules/.bin:/usr/local/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin
78 verbose lifecycle scrypt@6.0.3~preinstall: CWD: /usr/local/lib/node_modules/scrypt
79 silly lifecycle scrypt@6.0.3~preinstall: Args: [ '-c', 'node node-scrypt-preinstall.js' ]
80 silly lifecycle scrypt@6.0.3~preinstall: Returned: code: 0  signal: null
81 timing action:preinstall Completed in 4346ms
82 silly doSerial build 16
83 silly build nan@2.14.1
84 info linkStuff nan@2.14.1
85 silly linkStuff nan@2.14.1 has /usr/local/lib/node_modules/scrypt/node_modules as its parent node_modules
86 silly linkStuff nan@2.14.1 is part of a global install
87 silly linkStuff nan@2.14.1 is installed into a global node_modules
88 silly build scrypt@6.0.3
89 info linkStuff scrypt@6.0.3
90 silly linkStuff scrypt@6.0.3 has /usr/local/lib/node_modules as its parent node_modules
91 silly linkStuff scrypt@6.0.3 is part of a global install
92 silly linkStuff scrypt@6.0.3 is installed into a global node_modules
93 silly linkStuff scrypt@6.0.3 is installed into the top-level global node_modules
94 timing action:build Completed in 1ms
95 silly doSerial global-link 16
96 silly doParallel update-linked 0
97 silly doSerial install 16
98 silly install nan@2.14.1
99 info lifecycle nan@2.14.1~install: nan@2.14.1
100 silly install scrypt@6.0.3
101 info lifecycle scrypt@6.0.3~install: scrypt@6.0.3
102 verbose lifecycle scrypt@6.0.3~install: unsafe-perm in lifecycle true
103 verbose lifecycle scrypt@6.0.3~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/local/lib/node_modules/scrypt/node_modules/.bin:/usr/local/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin
104 verbose lifecycle scrypt@6.0.3~install: CWD: /usr/local/lib/node_modules/scrypt
105 silly lifecycle scrypt@6.0.3~install: Args: [ '-c', 'node-gyp rebuild' ]
106 silly lifecycle scrypt@6.0.3~install: Returned: code: 1  signal: null
107 info lifecycle scrypt@6.0.3~install: Failed to exec install script
108 timing action:install Completed in 4464ms
109 verbose unlock done using /Users/xyz/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
110 timing stage:rollbackFailedOptional Completed in 42ms
111 timing stage:runTopLevelLifecycles Completed in 9439ms
112 verbose stack Error: scrypt@6.0.3 install: `node-gyp rebuild`
112 verbose stack Exit status 1
112 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
112 verbose stack     at EventEmitter.emit (events.js:314:20)
112 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
112 verbose stack     at ChildProcess.emit (events.js:314:20)
112 verbose stack     at maybeClose (internal/child_process.js:1051:16)
112 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
113 verbose pkgid scrypt@6.0.3
114 verbose cwd /Users/xyz
115 verbose Darwin 19.6.0
116 verbose argv "/usr/local/Cellar/node/14.5.0/bin/node" "/usr/local/bin/npm" "install" "-g" "scrypt"
117 verbose node v14.5.0
118 verbose npm  v6.14.5
119 error code ELIFECYCLE
120 error errno 1
121 error scrypt@6.0.3 install: `node-gyp rebuild`
121 error Exit status 1
122 error Failed at the scrypt@6.0.3 install script.
122 error This is probably not a problem with npm. There is likely additional logging output above.
123 verbose exit [ 1, true

现在,我去阅读有关堆栈溢出和类似网站中的内容,并认为由于缺少权限,这可能是一个问题。仍然,将/ usr / local / lib / node-modules中的整个节点文件夹设置为chmod 777不会执行任何操作-使用sudo运行节点只会失败。

我还完全删除了所有内容(节点等),并从头开始(通过brew)重新安装-同样的问题...

有人知道如何解决此问题吗?

3 个答案:

答案 0 :(得分:1)

从源代码安装模块是可行的,但这不能解决问题。我将解释原因:

这将克隆scrypt存储库并构建程序包而不会出错:

git clone https://github.com/barrysteyn/node-scrypt.git
cd node-scrypt
npm install
node-gyp configure build

在该线程How to install a node.js module without using npm?之后,我能够使用该仓库从该仓库安装节点模块而没有错误

node install .

(在目录或仓库中)

不过,我其他脚本中scrypt的依赖关系(例如react)触发了重新安装,并进行了重新编译/编译,导致出现与上面完全相同的错误。

答案 1 :(得分:0)

scrypt软件包的Github问题来看,该软件包已被弃用,并且不支持高于10的Node版本。您似乎正在尝试在Node 14上安装。

https://github.com/barrysteyn/node-scrypt/issues/192

答案 2 :(得分:0)

已经有fix in master branch,但是新版本还没有发布。您可以尝试使用 git 中的固定版本:

npm install github:barrysteyn/node-scrypt#fb60a8d3c158fe115a624b5ffa7480f3a24b03fb

但是,如果这是您的直接依赖,请考虑以下自述文件中的警告:

<块引用>

#警告!!!此模块已弃用。相反,使用 https://nodejs.org/api/crypto.html#crypto_crypto_scrypt_password_salt_keylen_options_callback

徒劳地等待 2020 年 5 月的新版本发布:https://github.com/barrysteyn/node-scrypt/pull/197#issuecomment-630954048