【问题标题】:Error:Cannot find module 'shrink-ray', tried installing hitting another error错误:找不到模块“shrink-ray”,尝试安装遇到另一个错误
【发布时间】:2022-06-11 13:26:55
【问题描述】:

节点版本为 8.9.4。 (项目要求)

npm 版本是 5.6.0。

这是一个现有项目,安装节点模块后,当我尝试npm start 时,我遇到了这个错误。所以我尝试了npm install shrink-ray。它引发以下错误。我还尝试安装 windows-build-tools,它仍然不起作用。我已经在这部分卡了一天多。

我已经附加了我的系统变量信息以及 python 变量。 当我执行python --version 时它在我的命令行中工作时,它仍然会抛出相同的错误,它找不到我的python exe。 [在此处输入图像描述] https://i.stack.imgur.com/LhZER.png

> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v57-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-zopfli@1.4.0 and node@8.9.4 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "D:\Library\Python\Python27\python.exe", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.19044
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\krrajesh\\Project\\ahcom-pixel\\node_modules\\node-zopfli\\lib\\binding\\node-v57-win32-x64\\zopfli.node" "--module_name=zopfli" "--module_path=C:\\Users\\krrajesh\\Project\\ahcom-pixel\\node_modules\\node-zopfli\\lib\\binding\\node-v57-win32-x64" "--python=D:\\Library\\Python\\Python27\\python.exe" "--msvs_version=2017"
gyp ERR! cwd C:\Users\krrajesh\Project\ahcom-pixel\node_modules\node-zopfli
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\krrajesh\Project\ahcom-pixel\node_modules\node-zopfli\lib\binding\node-v57-win32-x64\zopfli.node --module_name=zopfli --module_path=C:\Users\krrajesh\Project\ahcom-pixel\node_modules\node-zopfli\lib\binding\node-v57-win32-x64 --python=D:\Library\Python\Python27\python.exe --msvs_version=2017' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\krrajesh\Project\ahcom-pixel\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Windows_NT 10.0.19044
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\krrajesh\\Project\\ahcom-pixel\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\krrajesh\Project\ahcom-pixel\node_modules\node-zopfli
node-pre-gyp ERR! node -v v8.9.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\krrajesh\Project\ahcom-pixel\node_modules\node-zopfli\lib\binding\node-v57-win32-x64\zopfli.node --module_name=zopfli --module_path=C:\Users\krrajesh\Project\ahcom-pixel\node_modules\node-zopfli\lib\binding\node-v57-win32-x64 --python=D:\Library\Python\Python27\python.exe --msvs_version=2017' (1)
npm WARN jest-config@26.6.3 requires a peer of ts-node@>=9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN jsdom@16.7.0 requires a peer of canvas@^2.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-addons-test-utils@15.6.2 requires a peer of react-dom@^15.4.2 but none is installed. You must install peer dependencies yourself.
npm WARN slick-carousel@1.8.1 requires a peer of jquery@>=1.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.5.7 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.5.7 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN ahcom-re-redesign@2.4.0 No repository field.
npm WARN ahcom-re-redesign@2.4.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\jest-haste-map\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"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\watchpack\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"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-zopfli@1.4.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-zopfli@1.4.0 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!     C:\Users\krrajesh\AppData\Roaming\npm-cache\_logs\2022-02-16T04_40_42_505Z-debug.log```




【问题讨论】:

    标签: node.js


    【解决方案1】:

    这也发生在

    • 节点 14
    • 节点 12
    • 节点 10

    似乎开发 node-zopfli 的人试图通过 403 错误来引起注意 ? ? ? ?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-11
      • 2015-10-23
      • 1970-01-01
      • 1970-01-01
      • 2021-08-26
      • 2012-10-25
      相关资源
      最近更新 更多