尝试使用“gh-pages”部署时“以下路径被您的一个 .gitignore 文件忽略:node_modules”

问题描述 投票:0回答:1

我正在尝试将我的应用程序部署到 github,但我遇到了这个错误:

$ npm run deploy

> [email protected] deploy C:\Users\zarin\Desktop\projects\GIT repository
> gh-pages -d dist

The following paths are ignored by one of your .gitignore files:
node_modules

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] deploy: `gh-pages -d dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] deploy 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!     C:\Users\zarin\AppData\Roaming\npm-cache\_logs\2022-08-28T16_31_01_911Z-debug.log

不太确定在这里如何处理 node_modules

github npm deployment github-pages
1个回答
0
投票

刚遇到这个错误。我删除了以下文件夹并重新运行命令:

距离

node_modules/.cache

成功部署应用程序。

© www.soinside.com 2019 - 2024. All rights reserved.