Выполнение любой команды gatsby показывает «-bash: gatsby: команда не найдена» - PullRequest
1 голос
/ 07 июня 2019

Я пытаюсь клонировать сайт, созданный с помощью gatsby, и запускать его локально на моем ноутбуке.Но при вводе любой команды gatsby в командной строке выдается следующее предупреждение:

-bash: gatsby: команда не найдена

Я попытался удалить и переустановить gatsby вручную, не работая наGitHub Repository.Но это все равно не сработало.

На сайте локально я следовал этим инструкциям этого сайта :

  1. git clone git@github.com:PlatformOfTrust/pot-websites.git
  2. cd developer-site or marketing-site
  3. npm install
  4. npm install --global gatsby-cli
  5. gatsby develop -o -p 8000

при выполнении gatsby develop -o -p 8000, сайт должен работатьлокально на localhost: 8000.Но терминал просто говорит

-bash: gatsby: команда не найдена

Вот вывод от терминала при выполнении последовательностей команд:

Last login: Fri Jun  7 15:15:07 on ttys000
TILMACLT17-2:~ naziahasan$ cd Documents/GitHub/
TILMACLT17-2:GitHub naziahasan$ ls -a
.       ..      .DS_Store   docs
TILMACLT17-2:GitHub naziahasan$ git clone git@github.com:PlatformOfTrust/pot-websites.git
Cloning into 'pot-websites'...
remote: Enumerating objects: 418, done.
remote: Counting objects: 100% (418/418), done.
remote: Compressing objects: 100% (256/256), done.
remote: Total 3958 (delta 267), reused 279 (delta 158), pack-reused 3540
Receiving objects: 100% (3958/3958), 39.25 MiB | 250.00 KiB/s, done.
Resolving deltas: 100% (2384/2384), done.
TILMACLT17-2:GitHub naziahasan$ cd pot-websites/developers-site/
TILMACLT17-2:developers-site naziahasan$ npm install

> fsevents@1.2.7 install /Users/naziahasan/Documents/GitHub/pot-websites/developers-site/node_modules/fsevents
> node install

node-pre-gyp WARN Using request for node-pre-gyp https download 
[fsevents] Success: "/Users/naziahasan/Documents/GitHub/pot-websites/developers-site/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" is installed via remote

> sharp@0.21.3 install /Users/naziahasan/Documents/GitHub/pot-websites/developers-site/node_modules/gatsby-plugin-sharp/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached /Users/naziahasan/.npm/_libvips/libvips-8.7.0-darwin-x64.tar.gz

> sharp@0.21.1 install /Users/naziahasan/Documents/GitHub/pot-websites/developers-site/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached /Users/naziahasan/.npm/_libvips/libvips-8.7.0-darwin-x64.tar.gz

> gatsby-telemetry@1.0.2 postinstall /Users/naziahasan/Documents/GitHub/pot-websites/developers-site/node_modules/gatsby-telemetry
> node src/postinstall.js


> gatsby-telemetry@1.0.4 postinstall /Users/naziahasan/Documents/GitHub/pot-websites/developers-site/node_modules/gatsby/node_modules/gatsby-telemetry
> node src/postinstall.js


> cwebp-bin@5.0.0 postinstall /Users/naziahasan/Documents/GitHub/pot-websites/developers-site/node_modules/cwebp-bin
> node lib/install.js

  ✔ cwebp pre-build test passed successfully

> mozjpeg@6.0.1 postinstall /Users/naziahasan/Documents/GitHub/pot-websites/developers-site/node_modules/mozjpeg
> node lib/install.js

  ✔ mozjpeg pre-build test passed successfully

> pngquant-bin@5.0.2 postinstall /Users/naziahasan/Documents/GitHub/pot-websites/developers-site/node_modules/pngquant-bin
> node lib/install.js

  ✔ pngquant pre-build test passed successfully

> styled-components@4.2.0 postinstall /Users/naziahasan/Documents/GitHub/pot-websites/developers-site/node_modules/styled-components
> node ./scripts/postinstall.js || exit 0

Use styled-components at work? Consider supporting our development efforts at https://opencollective.com/styled-components
added 1926 packages from 1048 contributors in 99.154s
TILMACLT17-2:developers-site naziahasan$ npm install --global gatsby-cli
/Users/naziahasan/.npm-global/bin/gatsby -> /Users/naziahasan/.npm-global/lib/node_modules/gatsby-cli/lib/index.js
+ gatsby-cli@2.6.5
updated 1 package in 15.567s
TILMACLT17-2:developers-site naziahasan$ gatsby develop -o -p 8000
-bash: gatsby: command not found
TILMACLT17-2:developers-site nazia

После вывода из терминала, когда я попытался удалить и переустановить gatsby:

TILMACLT17-2:~ naziahasan$ gatsby --version
-bash: gatsby: command not found
TILMACLT17-2:~ naziahasan$ npm uninstall -g gatsby-cli
removed 296 packages in 1.618s
TILMACLT17-2:~ naziahasan$ npm install -g gatsby-cli
/Users/naziahasan/.npm-global/bin/gatsby -> /Users/naziahasan/.npm-global/lib/node_modules/gatsby-cli/lib/index.js

> core-js@2.6.9 postinstall /Users/naziahasan/.npm-global/lib/node_modules/gatsby-cli/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> gatsby-telemetry@1.0.11 postinstall /Users/naziahasan/.npm-global/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry
> node src/postinstall.js

+ gatsby-cli@2.6.5
added 296 packages from 172 contributors in 14.686s
TILMACLT17-2:~ naziahasan$ gatsby --version
-bash: gatsby: command not found
TILMACLT17-2:~ naziahasan$ 

Мне интересно, нужно ли мне что-то изменить в конфигурации gatsby в .npm-global / bin / или добавить местоположение gatsbyв переменную Path.

Помощь будет очень признательна!Спасибо!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...