1

I'm using the command 'npm -g install parcel-bundler', to install parcel globally and get no error, but then it doesn't seem to be installed. When i run the command 'parcel --version' i get 'command not found', same for any other 'parcel' commands. I've tried running the 'install' command again and I get a '[email protected] updated 2 packages in 20.003s'. i have several 'deprecated' warnings, could the problem come from that ? here they are :

npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3. npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142 npm WARN deprecated [email protected]: this library is no longer supported /Users/user.npm-packages/bin/parcel -> /Users/user/.npm-packages/lib/node_modules/parcel-bundler/bin/cli.js

Thanks

EDIT : I have tried updating all the deprecated items manually and re-installing Parcel, it didin't fix the problem.

4
  • Which version of npm are you using? I encountered this problem today when configuring a development environment on a seldom used laptop. I realized my npm version was very out of date at 3.5.2. Once I upgraded to 6.14.10, I was able to install parcel. Commented Dec 19, 2020 at 1:35
  • I am at 6.14.6. I will update it and try it again then. Thanks for the tip ! Commented Dec 20, 2020 at 15:56
  • @TylerMoore I've tried updating npm using the command 'npm install -g npm' and it seemed successfull, but when I run 'npm --version' I am still at the 6.14.6. Seems like thereis something pretty wrong going on. Commented Dec 20, 2020 at 16:02
  • I had the same problem getting the latest version first in my PATH. which npm was returning /usr/bin/npm, but the npm install -g npm command installs it to /usr/local/bin/npm without updating the symlink at /usr/bin/npm. I tried fixing that symlink with ln -s /usr/local/bin/npm /usr/bin/npm, but kept getting a circular reference error. In the end I uninstalled everything node and npm, reinstalled with apt, and upgraded it. Still, your version is very recent. I suspect you may have a different problem entirely. Good luck. I'm new to Parcel and love it! Commented Dec 20, 2020 at 23:42

1 Answer 1

1

Recently I encountered the same problem and while I don't fully understand why this happens, I manage to find some workarounds to run parcel:

  • After installation using npm, run the same commands but adding npx before them, for example, I create a server through npx parcel index.html;
  • Install it using yarn (yarn add parcel-bundler) and then, for example, run a server (yarn parcel index.html). Same deprecated warnings here but they don't prevent the package from running;

Update: if install the package locally there are even more ways.

  • You can do what npx does under the hood: ./node_modules/.bin/parcel --version;
  • Create custom shorthand command in package.json. Under scripts object add "server": "parcel index.html". The part before colon can be named anything you like. After that run npm run server and this would work.
Sign up to request clarification or add additional context in comments.

1 Comment

i had same ploblem. this solution helpull to me. thank you!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.