You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Stackblitz执行start命令失败:eleventy权限被拒问题求助

问题描述

在Stackblitz中开发GitHub仓库时,无法启动终端运行live server查看Eleventy修改后的效果。执行npm install && npm start后触发权限错误,终端输出如下:

~/phillippdi/JAMStack-PaperJourney
❯ npm install && npm start

up to date in 3s

44 packages are looking for funding
  run `npm fund` for details

> jamstack-paperjourney@1.0.0 start
> eleventy --serve

jsh: permission denied: eleventy

同时Stackblitz提示Please restart your terminal processes.

已尝试的操作:

  • 重启终端进程
  • 使用npx @11ty/eleventy重新运行Eleventy
  • 重复执行npm install和npm start
  • 在浏览器中添加[*.]staticblitz.com例外以启用WebAssembly

问题仍未解决,需可行的解决方案。

解决方案尝试

1. 指定本地依赖路径执行Eleventy

确认Eleventy已安装在项目本地依赖中:

ls node_modules/.bin | grep eleventy

若输出eleventy,修改package.json的start脚本,使用本地可执行文件路径:

"scripts": {
  "start": "./node_modules/.bin/eleventy --serve"
}

修改后重新执行npm start。

2. 清理缓存并重装依赖

Stackblitz的缓存可能导致依赖权限异常,执行以下命令重置:

npm cache clean --force
rm -rf node_modules package-lock.json
npm install
npm start

3. 修复Eleventy脚本权限

若本地依赖中的Eleventy脚本权限不足,执行:

chmod +x node_modules/.bin/eleventy

完成后重新运行npm start。

4. 直接用npx替换脚本

将package.json的start脚本改为直接调用npx:

"scripts": {
  "start": "npx @11ty/eleventy --serve"
}

绕开本地依赖的权限问题。

5. 切换Stackblitz运行环境

尝试将Stackblitz的运行模式切换为"Node.js"(而非默认Web容器),重新加载项目后再执行启动命令。

内容的提问来源于stack exchange,提问作者UTINNI

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.26 04:02:22