npm WARN old lockfile npm WARN old lockfile The package-lock.json file was created with an old version of npm, npm WARN old lockfile so supplemental metadata must be fetched from the registry. npm WARN old lockfile npm WARN old lockfile This is a one-time fix-up, please be patient... npm WARN old lockfile npm WARN deprecated bcrypt@4.0.1: versions < v5.0.0 do not handle NUL in passwords properly npm ERR! code 1 npm ERR! path /Users/nikhil/Desktop/admin/myprivatescout-master/node_modules/node npm ERR! command failed npm ERR! command sh -c node installArchSpecificPackage npm ERR! npm ERR! code ETARGET npm ERR! npm ERR! notarget No matching version found for node-darwin-arm64@16.6.1. npm ERR! npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! npm ERR! notarget a package version that doesn't exist. npm ERR! npm ERR! npm ERR! A complete log of this run can be found in: npm ERR! npm ERR! /Users/nikhil/.npm/_logs/2021-08-23T17_20_39_011Z-debug.log npm ERR! node:internal/modules/cjs/loader:936 npm ERR! throw err; npm ERR! ^ npm ERR! npm ERR! Error: Cannot find module 'node-darwin-arm64/package.json' npm ERR! Require stack: npm ERR! - /Users/nikhil/Desktop/admin/myprivatescout-master/node_modules/node/installArchSpecificPackage.js npm ERR! at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) npm ERR! at Function.resolve (node:internal/modules/cjs/helpers:100:19) npm ERR! at ChildProcess.<anonymous> (/Users/nikhil/Desktop/admin/myprivatescout-master/node_modules/node-bin-setup/index.js:18:27) npm ERR! at ChildProcess.emit (node:events:394:28) npm ERR! at maybeClose (node:internal/child_process:1067:16) npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) { npm ERR! code: 'MODULE_NOT_FOUND', npm ERR! requireStack: [ npm ERR! '/Users/nikhil/Desktop/admin/myprivatescout-master/node_modules/node/installArchSpecificPackage.js' npm ERR! ] npm ERR! } npm ERR! A complete log of this run can be found in: npm ERR! /Users/nikhil/.npm/_logs/2021-08-23T17_20_39_074Z-debug.logNo puedo instalar ningún paquete en mi repositorio de proyectos en mi mac M1, ya eliminé node_modules y package-lock.json y probé npm i después de eso.
Intenté ejecutar npm i, npm i para paquetes individuales pero no pude solucionarlo. También intenté instalar con yarn pero tengo el mismo problema.
Encontré la solución, solo tenía que agregar la arquitectura al nodo,
$ nvm uninstall 14 $ arch -x86_64 zsh $ nvm install 14 $ nvm alias default 14```La solución proporcionada por Nikhil es un buen comienzo. Sin embargo, esto es más completo y aplicable en más situaciones:
Primero, instale nvm (Administrador de versiones de nodos):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bashLuego, ejecuta el siguiente comando:
arch -x86_64 zshTuvimos un desarrollador con este problema, una computadora portátil M1 comprada nueva en diciembre de 2021. La solución de ralphjsmit nos ayudó en parte.
Estamos usando Nodejs v16.13.1. Después de ejecutar arch -x86_64 zsh , la instalación de npm aún falló ( Error: Cannot find module 'node-darwin-arm64/package.json' ).
arch devolvió i386 .
La clave para nosotros fue reinstalar Nodejs (a través de nvm, nvm use v16.5.0 && nvm uninstall v16.13.1 && nvm install v16.13.1 )
Si tuviera que resumir todos los pasos que ejecutamos, serían
> node -v v16.13.1 > node -p process.arch arm64 > arch -x86_64 zsh > nvm use 16.5.0 && nvm uninstall v16.13.1 && nvm install v16.13.1 nvm use 16.5.0 && nvm uninstall v16.13.1 && nvm install v16.13.1 Now using node v16.5.0 (npm v7.19.1) Uninstalled node v16.13.1 Downloading and installing node v16.13.1... ... # output here, I am not on an M1 machine, but it mentions x64 in the name of the node binary file ... Now using node v16.13.1 (npm v8.1.2) > npm install