bnoordhuis / node-iconv

node.js iconv bindings - text recoding for fun and profit!
Other
799 stars 123 forks source link

WSL npm install iconv failing #222

Closed souravsaraf123 closed 2 years ago

souravsaraf123 commented 2 years ago
npm ERR! code 7
npm ERR! path /home/developer/projects/test/node_modules/iconv
npm ERR! command failed
npm ERR! command sh /tmp/install-cb3638f2.sh
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@16.17.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
npm ERR! gyp ERR! UNCAUGHT EXCEPTION
npm ERR! gyp ERR! stack Error: Cannot find module './package.json'
npm ERR! gyp ERR! stack Require stack:
npm ERR! gyp ERR! stack - /usr/lib/node_modules/npm/node_modules/node-gyp/node_modules/make-fetch-happen/index.js
npm ERR! gyp ERR! stack - /usr/lib/node_modules/npm/node_modules/node-gyp/lib/install.js
npm ERR! gyp ERR! stack - /usr/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js
npm ERR! gyp ERR! stack - /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
npm ERR! gyp ERR! stack     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
npm ERR! gyp ERR! stack     at Function.Module._load (node:internal/modules/cjs/loader:804:27)
npm ERR! gyp ERR! stack     at Module.require (node:internal/modules/cjs/loader:1028:19)
npm ERR! gyp ERR! stack     at require (node:internal/modules/cjs/helpers:102:18)
npm ERR! gyp ERR! stack     at Object.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/node_modules/make-fetch-happen/index.js:5:13)
npm ERR! gyp ERR! stack     at Module._compile (node:internal/modules/cjs/loader:1126:14)
npm ERR! gyp ERR! stack     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
npm ERR! gyp ERR! stack     at Module.load (node:internal/modules/cjs/loader:1004:32)
npm ERR! gyp ERR! stack     at Function.Module._load (node:internal/modules/cjs/loader:839:12)
npm ERR! gyp ERR! stack     at Module.require (node:internal/modules/cjs/loader:1028:19)
npm ERR! gyp ERR! System Linux 5.4.72-microsoft-standard-WSL2
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/developer/projects/test/node_modules/iconv
npm ERR! gyp ERR! node -v v16.17.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! Node-gyp failed to build your package.
npm ERR! gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-08-31T12_08_45_565Z-debug-0.log
bnoordhuis commented 2 years ago

Looks like a problem with npm or node-gyp, not iconv. Closing, but let me know if you have reason to believe otherwise.

souravsaraf123 commented 2 years ago

hi , i tried a few things.

earlier my npm version was 8.15

i downgraded my npm version to 8.1.0

then iconv got installed

thanks 👍

bnoordhuis commented 2 years ago

Do you still get the exact same error after that? Can you rm -rf node_modules and post the verbatim output of npm install iconv?