简体   繁体   中英

Parcel command not found

In my project, I use Parcel to bundle everything. Now, I am at the point where I need to deploy my app. I clone my git repo with my React app and I put in the Node server.

I tried every command possible to install parcel, but I always get the following error :


> pp-react@0.1.0 build /home/volodymk/react
> parcel build index.html

sh: parcel: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! pp-react@0.1.0 build: `parcel build index.html`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the pp-react@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/volodymk/.npm/_logs/2020-01-12T19_26_22_634Z-debug.log

How can I fix this ?

To run any installed node package (not just Parcel), use npx , the utility command shipped with npm. It executes packages that come with a runtime command in your node_modules/packagename/.bin directories.

As in npx parcel build index.html

More information available in the npx readme .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM