Parcel-bundler won't install

I am at the Course #42 of Part 3 of HTML/CSS and I followed the same method as the video (npm i -D parcel-bundler also tried typing the same version that Mosh was using for the tutorial) to install the parcel bundler but it gives me bunch of error message and I don’t see a node_modules folder in the Explorer either.

The error message I received:

npm ERR! code 1
npm ERR! path /Users/dalarerana/Desktop/Dalare Photograpahy/node_modules/deasync
npm ERR! command failed
npm ERR! command sh -c node ./build.js
npm ERR! CXX(target) Release/obj.target/deasync/src/deasync.o
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@18.1.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.8.9 found at “/Library/Developer/CommandLineTools/usr/bin/python3”
npm ERR! gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args ‘/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py’,
npm ERR! gyp info spawn args ‘binding.gyp’,
npm ERR! gyp info spawn args ‘-f’,
npm ERR! gyp info spawn args ‘make’,
npm ERR! gyp info spawn args ‘-I’,
npm ERR! gyp info spawn args ‘/Users/dalarerana/Desktop/Dalare Photograpahy/node_modules/deasync/build/config.gypi’,
npm ERR! gyp info spawn args ‘-I’,
npm ERR! gyp info spawn args ‘/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi’,
npm ERR! gyp info spawn args ‘-I’,
npm ERR! gyp info spawn args ‘/Users/dalarerana/Library/Caches/node-gyp/18.1.0/include/node/common.gypi’,
npm ERR! gyp info spawn args ‘-Dlibrary=shared_library’,
npm ERR! gyp info spawn args ‘-Dvisibility=default’,
npm ERR! gyp info spawn args ‘-Dnode_root_dir=/Users/dalarerana/Library/Caches/node-gyp/18.1.0’,
npm ERR! gyp info spawn args ‘-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp’,
npm ERR! gyp info spawn args ‘-Dnode_lib_file=/Users/dalarerana/Library/Caches/node-gyp/18.1.0/<(target_arch)/node.lib’,
npm ERR! gyp info spawn args ‘-Dmodule_root_dir=/Users/dalarerana/Desktop/Dalare Photograpahy/node_modules/deasync’,
npm ERR! gyp info spawn args ‘-Dnode_engine=v8’,
npm ERR! gyp info spawn args ‘–depth=.’,
npm ERR! gyp info spawn args ‘–no-parallel’,
npm ERR! gyp info spawn args ‘–generator-output’,
npm ERR! gyp info spawn args ‘build’,
npm ERR! gyp info spawn args ‘-Goutput_dir=.’
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ ‘BUILDTYPE=Release’, ‘-C’, ‘build’ ]
npm ERR! clang: error: no such file or directory: ‘Photograpahy/node_modules/node-addon-api’
npm ERR! make: *** [Release/obj.target/deasync/src/deasync.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: make failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 21.4.0
npm ERR! gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild”
npm ERR! gyp ERR! cwd /Users/dalarerana/Desktop/Dalare Photograpahy/node_modules/deasync
npm ERR! gyp ERR! node -v v18.1.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/dalarerana/.npm/_logs/2022-05-14T01_21_14_490Z-debug-0.log

Because of this I am stuck in this course for now. Any help would be highly appreciative. Thank you in advance.

The main error seems to be this line:

clang: error: no such file or directory: ‘Photograpahy/node_modules/node-addon-api’

I don’t know if this will help or is the right way to solve this, but you could try running this command before running the parcel install command:

npm i node-addon-api

Tried following your process but it shows the same error message. This time installing the, “npm i node-addon-api” did show a, “node_modules” folder in the Expolorer but there is only, “node-addon-api”, library in it, no any parcel-bundler library. Thanks for trying to help though.

So I found a solution and wanted to share with the new Web Developers like me. If you’re having trouble installing, “parcel-bundler”, then try running the command without the, “-bundler”, eg. (npm i -D parcel). This worked for me and I think the reason why the parcel.bundler wasn’t working is from what i read in the error message is that I assume they discontinued parcel-bundler and their new version(v2) is just, “parcel” not “parcel-bundler”. Thats my assumption for parcel-bundler not working and the mention solution worked for me. Cheers if that helps anyone facing the same issue.

2 Likes

Thanks, Dalare, it works for me. I’ve been struggling with this issue for three days. Now the issues have been resolved. Thanks once again. If anyone having this issue please use (npm i -D parcel) command.