Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.2K
Visualizações
Having trouble installing npm on mac M1
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.log

I am unable to install any package in my project repository on my mac M1, already removed node_modules and package-lock.json and tried npm i after that.

tried running npm i, npm i for individual packages but couldn't fix it, Also tried installing with yarn but I am facing the same issue.

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

I found the solution, I just had to add the architecture to the node,

$ nvm uninstall 14
$ arch -x86_64 zsh 
$ nvm install 14
$ nvm alias default 14```
over 4 years ago · Santiago Trujillo Relatório

0

The solution provided by Nikhil is a good start. However, this is more complete and applicable in more situations:

First, install nvm (Node version manager):

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

Then, run the following command:

arch -x86_64 zsh 
over 4 years ago · Santiago Trujillo Relatório

0

We had a dev with this problem, a M1 laptop bought new in December 2021. The solution by ralphjsmit got us part of the way.

We're using Nodejs v16.13.1. After running arch -x86_64 zsh the npm install still failed (Error: Cannot find module 'node-darwin-arm64/package.json').

arch returned i386.

The key for us was to re-install Nodejs (via nvm, nvm use v16.5.0 && nvm uninstall v16.13.1 && nvm install v16.13.1)

If I were to summarize all the steps we ran, they'd be

> 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
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda