Le dim. 21 juil. 2019 à 20:48, <s...@riseup.net> a écrit : > Package: nodejs > Version: 10.15.2~dfsg-2 > Severity: grave > > After creating a fresh chroot 'sid' environment > and installing nodejs and npm > `npm install` is throwing the below error: > internal/modules/cjs/loader.js:583 > throw err; > ^ > > Error: Cannot find module 'semver' > at Function.Module._resolveFilename > (internal/modules/cjs/loader.js:581:15) > at Function.Module._load (internal/modules/cjs/loader.js:507:25) > at Module.require (internal/modules/cjs/loader.js:637:17) > at require (internal/modules/cjs/helpers.js:22:18) > at Object.<anonymous> (/usr/share/npm/lib/utils/unsupported.js:2:14) > at Module._compile (internal/modules/cjs/loader.js:689:30) > at Object.Module._extensions..js > (internal/modules/cjs/loader.js:700:10) > at Module.load (internal/modules/cjs/loader.js:599:32) > at tryModuleLoad (internal/modules/cjs/loader.js:538:12) > at Function.Module._load (internal/modules/cjs/loader.js:530:3) > ------------------------------------------------------------ > even installed modules are not working while trying to run the below > cmd. > $ ls /usr/share/nodejs/ > mixin-deep normalize-path y18n > $ node -e "require('y18n');" > internal/modules/cjs/loader.js:583 > throw err; > ^ > > Error: Cannot find module 'y18n' > at Function.Module._resolveFilename > (internal/modules/cjs/loader.js:581:15) > at Function.Module._load (internal/modules/cjs/loader.js:507:25) > at Module.require (internal/modules/cjs/loader.js:637:17) > at require (internal/modules/cjs/helpers.js:22:18) > at [eval]:1:1 > at Script.runInThisContext (vm.js:96:20) > at Object.runInThisContext (vm.js:303:38) > at Object.<anonymous> ([eval]-wrapper:6:22) > at Module._compile (internal/modules/cjs/loader.js:689:30) > at evalScript (internal/bootstrap/node.js:587:27) >
I cannot say what's wrong from the information you gave. Here with same node version $ node -p "require.resolve('y18n')" /usr/share/nodejs/y18n/index.js can you check that last file path exists ? Then can you compare with your output of: node -p process.execPath /usr/bin/node node -p "require.resolve.paths('y18n')" [ '/home/dev/node_modules', '/home/node_modules', '/node_modules', '/home/dev/.node_modules', '/home/dev/.node_libraries', '/usr/lib/x86_64-linux-gnu/nodejs', '/usr/share/nodejs', '/usr/lib/nodejs' ] Also maybe of interest node -p process.env.NODE_PATH Thanks, Jérémy