最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Failed doing npm install showing error "Undefined variable standalone_static_library in binding.gyp&qu

programmeradmin1浏览0评论

I'm updating a 3 years ago ruby on rails and react project trying to npm install but im stuck here getting this error

$ npm install

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 start

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! [email protected] build-css: `node-sass-chokidar src/styles -o src/styles`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] build-css script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I tried removing node_modules, update node version and npm version.

I'm updating a 3 years ago ruby on rails and react project trying to npm install but im stuck here getting this error

$ npm install

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 start

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! [email protected] build-css: `node-sass-chokidar src/styles -o src/styles`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] build-css script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I tried removing node_modules, update node version and npm version.

Share Improve this question asked Nov 1, 2022 at 17:48 Stefano RuedaStefano Rueda 3051 gold badge3 silver badges7 bronze badges 4
  • 8 node-sass is deprecated. node-sass-chokidar is also deprecated. – Andy Commented Nov 1, 2022 at 17:52
  • 2 oh yeah. I already switch to sass. thanks! – Stefano Rueda Commented Nov 3, 2022 at 0:42
  • 2 This ended up fixing it for me. Along with some simple project cleanup npm dedupe, npm outdated, and a fresh install. – Timothy Wilburn Commented Nov 22, 2022 at 21:18
  • Hi, @StefanoRueda I am facing the same error. Were you able to fix this? – kajal ojha Commented Nov 30, 2022 at 21:53
Add a comment  | 

1 Answer 1

Reset to default 17

For me this issue happened with NodeJS 19 (specifically 19.2.0) Run node --version to get your version (or you might see the output of that command in the gyp error logs, in my case later when I use NodeJS v20: npm ERR! gyp ERR! node -v v20.10.0)

The issue is fixed when I reverted to NodeJS 18; aka NodeJS LTS (at the time I wrote this answer, 12/9/2022). I used nvm install 18 and nvm use 18 as described here here and here)

NodeJS LTS = Long Term Support; "recommended for most users". At the time I wrote this answer (12/9/2022), Node Long Term Support (LTS) is NodeJS version 18.12.1

It seems like this issue (Undefined variable standalone_static_library...) may have been introduced in NodeJS version 19 because:

node 19.0.0 has been changed to make process.config read only #43627

After reverting, it may still be mentioned as a warning, but not an error:

npm ERR! (node:7120) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.

And while we're talking about versions, be careful about Python3 vs Python2!

npm ERR! gyp verb which failed Error: not found: python2

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论