question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module 'node-darwin-arm64/package.json'

See original GitHub issue

Hello I am trying to launch a new project on M1 but I get the error below. Perhaps this may be an incompatibility with the M1 chip?

config: MacOS BigSur 11.5.1 M1 chip yarn :1.22.11 node :v15.14.0

[5/5] 🔨 Rebuilding all packages… [1/13] ⠄ fsevents [8/13] ⠄ core-js [7/13] ⠄ sharp [4/13] ⠄ node error /Users/viktoryia_zgirskaya/work/ewave/platypus-pwa/node_modules/node: Command failed. Exit code: 1 Command: node installArchSpecificPackage Arguments: Directory: /Users/viktoryia_zgirskaya/work/ewave/platypus-pwa/node_modules/node Output: npm ERR! code ETARGET npm ERR! notarget No matching version found for node-darwin-arm64@12.22.4. npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn’t exist.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/viktoryia_zgirskaya/.npm/_logs/2021-08-10T05_53_29_116Z-debug.log node:internal/modules/cjs/loader:927 throw err; ^

Error: Cannot find module ‘node-darwin-arm64/package.json’ Require stack:

  • /Users/viktoryia_zgirskaya/work/ewave/platypus-pwa/node_modules/node/installArchSpecificPackage.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15) at Function.resolve (node:internal/modules/cjs/helpers:98:19) at ChildProcess.<anonymous> (/Users/viktoryia_zgirskaya/work/ewave/platypus-pwa/node_modules/node-bin-setup/index.js:18:27) at ChildProcess.emit (node:events:369:20) at maybeClose (node:internal/child_process:1067:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) { code: ‘MODULE_NOT_FOUND’, requireStack: [ ‘/Users/viktoryia_zgirskaya/work/ewave/platypus-pwa/node_modules/node/installArchSpecificPackage.js’

warning Error running install script for optional dependency: “/Users/viktoryia_zgirskaya/work/ewave/platypus-pwa/node_modules/sharp: Command failed. Exit code: 1 Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy) Arguments: Directory: /Users/viktoryia_zgirskaya/work/ewave/platypus-pwa/node_modules/sharp Output: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.8.1/libvips-8.8.1-darwin-arm64v8.tar.gz ERR! sharp Prebuilt libvips binaries are not yet available for darwin-arm64v8 info sharp Attempting to build from source via node-gyp but this may fail due to the above error info sharp Please see https://sharp.pixelplumbing.com/page/install for required dependencies gyp info it worked if it ends with ok gyp info using node-gyp@7.1.2 gyp info using node@15.14.0 | darwin | arm64 gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python" gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python gyp info spawn args [ gyp info spawn args ‘/Users/viktoryia_zgirskaya/.nvm/versions/node/v15.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py’, gyp info spawn args ‘binding.gyp’, gyp info spawn args ‘-f’, gyp info spawn args ‘make’, gyp info spawn args ‘-I’, gyp info spawn args ‘/Users/viktoryia_zgirskaya/work/ewave/platypus-pwa/node_modules/sharp/build/config.gypi’, gyp info spawn args ‘-I’, gyp info spawn args ‘/Users/viktoryia_zgirskaya/.nvm/versions/node/v15.14.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi’, gyp info spawn args ‘-I’, gyp info spawn args ‘/Users/viktoryia_zgirskaya/Library/Caches/node-gyp/15.14.0/include/node/common.gypi’, gyp info spawn args ‘-Dlibrary=shared_library’, gyp info spawn args ‘-Dvisibility=default’, gyp info spawn args ‘-Dnode_root_dir=/Users/viktoryia_zgirskaya/Library/Caches/node-gyp/15.14.0’, gyp info spawn args ‘-Dnode_gyp_dir=/Users/viktoryia_zgirskaya/.nvm/versions/node/v15.14.0/lib/node_modules/npm/node_modules/node-gyp’, gyp info spawn args ‘-Dnode_lib_file=/Users/viktoryia_zgirskaya/Library/Caches/node-gyp/15.14.0/<(target_arch)/node.lib’, gyp info spawn args ‘-Dmodule_root_dir=/Users/viktoryia_zgirskaya/work/ewave/platypus-pwa/node_modules/sharp’, gyp info spawn args ‘-Dnode_engine=v8’, gyp info spawn args ‘–depth=.’, gyp info spawn args ‘–no-parallel’, gyp info spawn args ‘–generator-output’, gyp info spawn args ‘build’, gyp info spawn args ‘-Goutput_dir=.’ gyp info spawn args ] gyp info spawn make gyp info spawn args [ ‘BUILDTYPE=Release’, ‘-C’, ‘build’ ] TOUCH Release/obj.target/libvips-cpp.stamp CXX(target) Release/obj.target/sharp/src/common.o …/src/common.cc:25:10: fatal error: ‘vips/vips8’ file not found #include <vips/vips8> ^~~~~~~~~~~~ 1 error generated. make: *** [Release/obj.target/sharp/src/common.o] Error 1 gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/Users/viktoryia_zgirskaya/.nvm/versions/node/v15.14.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (node:events:369:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12) gyp ERR! System Darwin 20.6.0 gyp ERR! command "/Users/viktoryia_zgirskaya/.nvm/versions/node/v15.14.0/bin/node" "/Users/viktoryia_zgirskaya/.nvm/versions/node/v15.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/viktoryia_zgirskaya/work/ewave/platypus-pwa/node_modules/sharp gyp ERR! node -v v15.14.0 gyp ERR! node-gyp -v v7.1.2 gyp ERR! not ok” info This module is OPTIONAL, you can safely ignore this error

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

78reactions
michaell-enpoweredcommented, Feb 3, 2022

Reinstalling node with this arch flag worked for me

$ nvm uninstall 14
$ arch -x86_64 zsh 
$ nvm install 14
$ nvm alias default 14

https://stackoverflow.com/questions/68896696/having-trouble-installing-npm-on-mac-m1

2reactions
GerritRRTcommented, Aug 27, 2021

I’m getting this same error. I’m also on a M1 chip macbook

Read more comments on GitHub >

github_iconTop Results From Across the Web

NPM Install "Cannot Find Module ' node-darwin-arm64 ...
NPM Install "Cannot Find Module ' node-darwin-arm64/package.json' ... I'm a node newbie and am struggling to figure out what's even failing.
Read more >
Solved: "Cannot find module 'node-darwin-arm64/package.json'"
How to Fix the " Cannot find module node - darwin - arm64 / package.json " problem on the Apple M1 Chip architecture!...
Read more >
node-darwin-arm64 - npm
Start using node-darwin-arm64 in your project by running `npm i ... There are no other projects in the npm registry using node-darwin-arm64.
Read more >
@netlify/esbuild-darwin-arm64 | Yarn - Package Manager
✘ [ERROR] Could not resolve "path" example.tsx:21:23: 21 │ const path = require('path') ╵ ~~~~~~ The package "path" wasn't found on the file...
Read more >
Cannot find module 'internal/modules/cjs/loader.js' | bobbyhadz
If the error is not resolved, try to delete your node_modules and package-lock.json (not package.json ) files, re-run npm install and restart your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found