【问题标题】:Squarespace Local Development doesnt seem to want to workSquarespace Local Development 似乎不想工作
【发布时间】:2019-03-09 07:09:22
【问题描述】:

我正在关注developers.squarespace.com 文档,并且正在尝试使用本地开发环境将我的静态网站制作成squarespace 模板。至于启动服务器,一切正常,直到我将 squarespace 服务器安装到我的系统。要开始,我在我的 Mac 终端中使用这个命令:

npm install -g @squarespace/server

在我输入这个之后,一切似乎再次正常工作,因为我遇到了这个(它没有显示任何错误,正如我为其他人看到的那样):

 Executing: npm run bundle

> @squarespace/server@1.1.2 bundle /Users/Squid/.npm-global/lib/node_modules/@squarespace/server
> node scripts/bundlejre.js --accept --clear -tz -j 8u131 -o build/distributions/runtimes/jre

Bundling compatible JRE (This may take a while)

> @squarespace/server@1.1.2 cleanupscript /Users/Squid/.npm-global/lib/node_modules/@squarespace/server
> node scripts/execif.js --os=win32 --exists=build node scripts/vetolines.js build/distributions/local-developer/bin/run.bat #!

+ @squarespace/server@1.1.2
updated 1 package in 56.891s

之后,我从 git 将我的网站克隆到桌面上的一个文件夹中,然后导航到终端中的文件夹。此时,我尝试通过运行以下命令启动开发服务器(将“站点名称”更改为我的站点名称:

squarespace-server https://site-name.squarespace.com

我的问题从这里开始,我收到了来自终端的以下响应:

-bash: squarespace server: command not found

我的 mac 无法识别服务器,即使我在计算机上手动找到了该文件夹(但我不知道如何处理它)。 到目前为止,我尝试了几种故障排除方法:

  1. 我有一个试用站点,因此我尝试按照文档中的建议使用 --auth 标志。
  2. 我重新启动了整个过程,因此我从系统中删除了所有与节点和 squarespace 相关的文件并重新开始。
  3. 在网上寻找答案后,我安装了homebrew 以确保我将 node 和 git 正确安装到我的系统中。
  4. 最后,我尝试更改 npm 的权限(但我不确定这部分是否正确,因为我没有收到任何权限错误)。

另外,非常感谢您阅读所有这些内容。我只是真的想确保你们都了解我在整个过程中所处的位置。

【问题讨论】:

    标签: server terminal development-environment squarespace


    【解决方案1】:

    我认为您可以通过在您的个人资料中添加导出路径来解决此问题。

    打开终端

    输入以下命令

    touch ~/.bash_profile
    

    (这将创建 bash 配置文件)

    open ~/.bash_profile 
    

    (这将打开您刚刚创建的 bash 配置文件)

    您的 bash 配置文件将在文本编辑器中打开。

    添加以下行,然后保存:

    export PATH=~/.npm-global/bin:$PATH
    

    重新启动终端并再次尝试使用该命令。

    https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

    【讨论】:

      猜你喜欢
      • 2016-02-27
      • 1970-01-01
      • 2014-06-24
      • 2019-07-31
      • 2018-05-29
      • 1970-01-01
      • 2014-05-09
      • 2013-11-25
      • 2017-08-26
      相关资源
      最近更新 更多