【问题标题】:Parcel command not found找不到包裹命令
【发布时间】:2020-01-12 19:27:34
【问题描述】:

在我的项目中,我使用 Parcel 来捆绑所有内容。现在,我需要部署我的应用程序。 我用我的 React 应用程序克隆了我的 git repo 并放入了 Node 服务器。

我尝试了所有可能的命令来安装包裹,但我总是收到以下错误:


> 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

我该如何解决这个问题?

【问题讨论】:

    标签: node.js reactjs npm


    【解决方案1】:

    要运行任何已安装的节点包(不仅仅是 Parcel),请使用 npm 附带的实用命令 npx。它在您的node_modules/packagename/.bin 目录中执行带有运行时命令的包。

    npx parcel build index.html

    更多信息请访问the npx readme

    【讨论】:

      猜你喜欢
      • 2020-05-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-25
      • 2018-06-02
      • 2018-03-30
      • 2019-09-22
      • 2011-01-24
      相关资源
      最近更新 更多