[英]Failed doing npm install showing error "Undefined variable standalone_static_library in binding.gyp" and node-sass chokidar error
我正在更新 3 年前的 ruby on rails 和 React 项目,试图安装 npm 但我卡在这里得到这个错误
$ npm 安装
gyp: Undefined variable standalone_static_library in binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
$ npm 开始
sh: node-sass-chokidar: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! frontend@0.1.0 build-css: `node-sass-chokidar src/styles -o src/styles`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the frontend@0.1.0 build-css script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
我尝试删除 node_modules,更新节点版本和 npm 版本。
对我来说,这个问题发生在 NodeJS 19(特别是 19.2.0)
当我恢复到 NodeJS 18 时,问题已解决; 又名 NodeJS LTS
NodeJS LTS = 长期支持; “推荐给大多数用户”- 在撰写本文时 (12/9/2022) 是 NodeJS 18.12.1
似乎这个问题( Undefined variable standalone_static_library...
)可能会发生,因为:
节点 19.0.0 已更改为只读 process.config #43627
还原后,它可能仍被提及为警告,但不是错误:
npm 错误:(节点:7120)[DEP0150] 弃用警告。 设置 process.config 已弃用。 将来该属性将是只读的。
当我们谈论版本时,请注意 Python3 与 Python2!
npm 错误! 失败错误
which
gyp 动词:未找到:python2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.