我正在尝试在 Jenkins 上配置我的项目,以便每次提交都会导致自动构建。当我yarn install
使用 Jenkins NodeJS 脚本运行时,它拒绝安装从 git 存储库导入的依赖项。我正在按照以下方式进行操作。
"some-component": "git+https://bitbucket.org/owner/repo.git"
Run Code Online (Sandbox Code Playgroud)
它显示以下错误:
error Command failed.
Exit code: 128
Command: git
Arguments: clone git+https://bitbucket.org/owner/repo.git
Output:
fatal: destination path 'some path' already exists and is not an empty directory.
error Command failed with exit code 1.
Run Code Online (Sandbox Code Playgroud)
如果文件为空,则显示以下错误
error Couldn't find the binary git
error Command failed with exit code 1.
Run Code Online (Sandbox Code Playgroud)
尽管同样yarn install
可以在 IDE(例如 VS Code)上完美运行。
yarn install
我使用以下代码在 Jenkins 上的 NodeJS 脚本中执行
var exec = require('child_process').exec,
child;
child …
Run Code Online (Sandbox Code Playgroud) 起亚啦!我正在尝试在本地安装 ghost-blog,但在安装过程中遇到了问题。它在“安装依赖项”时停止,而 yarn install --no-emoji -no-progress(ghost-cli 生成的命令)拉出一个错误:“../../../../package.json:名称包含非法字符”。
从那时起,我注意到几乎每个 yarn 命令(除了 yarn --version)都会出现相同的错误,包括 yarn cache clear,这使得故障排除非常困难。
我已经去寻找可能导致它的系统周围漂浮的 package.json 文件,因为我在某处读到纱线寻找最接近的文件,并删除了其中的大部分 - 剩下的那些是 npm 包的一部分,似乎具有有效的文件/路径名(全部小写,无空格)。我还将Ghost 的 package.json复制到父目录中(因为 ghost-cli 需要一个空目录才能安装),希望 Yarn 会选择它,但没有运气。
我已经卸载并重新安装了纱线(通过自制软件)并确保它在我的个人资料(zsh)中。
这是 ghost-cli-debug 的输出,不幸的是不是很有用:
Debug Information:
OS: Mac OS X, v10.15
Node Version: v10.16.1
Ghost-CLI Version: 1.11.0
Environment: development
Command: 'ghost install local'
Message: Command failed: yarn install --no-emoji --no-progress
error ../../../../package.json: Name contains illegal characters
yarn install v1.16.0
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Exit code: 1 …
Run Code Online (Sandbox Code Playgroud) 我遇到了一个奇怪的问题,除了 select2 之外,一切都按预期工作。我有 Rails 6.0.0 应用程序并通过安装 select2 yarn add select2
。
然后我将其添加到 application.js 文件中。文件如下所示。
#app/javascripts/packs/application.js
require("@rails/ujs").start()
require("turbolinks").start()
require("@rails/activestorage").start()
require("channels")
require('datatables.net')
require('datatables.net-dt')
require('datatables.net-bs4')
require('select2')
import "bootstrap"
import 'popper.js/dist/popper.js';
import $ from 'jquery';
global.$ = jQuery;
import "chart.js"
import 'select2'; // globally assign select2 fn to $ element
import 'select2/dist/css/select2.css'; // optional if you have css loader
document.addEventListener("turbolinks:load", () => {
setTimeout(function() {
$('.success, .alert').fadeOut();
}, 10000);
})
Run Code Online (Sandbox Code Playgroud)
现在看起来像这个 select2 下拉框
当我转到 Chrome 开发人员工具中的“源”选项卡时,它仅显示select2/dist/js
node_modules 下的文件夹。我已经尝试precompiling
过clobbering
资产但不起作用。整个过程在我的本地运行良好,只会在生产服务器中引起问题。
编辑: …
ruby-on-rails jquery-select2 yarnpkg webpacker ruby-on-rails-6
我正在考虑使用包管理器来避免在 GIT 中注册外部资源。但我想知道我应该如何设置我的项目?
现在在 GIT 中,我将 NSF 代码注册在 ODP 文件夹中,例如 projectx\ODP\ eg projectx\OODP\WebContent\DataTables
当我运行包管理器时,我注意到资源存储在文件夹 node_modules 中包含 package.json 文件的文件夹中。
这是否意味着我应该将 package.json 文件存储在 WebContent 文件夹中,或者我可以在包文件中指定模块的安装位置?
为了避免在 GIT 中为源代码管理注册文件,我应该在 .gitignore 文件中注册它们并声明 ODP\WebContent* 但这也会使 package.json 文件不受源代码管理的影响,我希望将其置于源代码管理之下。
一切都让我困惑。
有人能告诉我您是如何使用包管理器和 GIT 为 XPage 开发设置工作区的吗?
我知道我的问题被问了很多,但似乎没有什么对我有用。我创建了一个新的 nuxt 项目,每当我尝试使用yarn dev
它启动它时,它都会给我这个错误:yarn is not recognized as an internal or external command,
operable program or batch file.
即使将 windows 中的变量设置为正确的纱线路径,它仍然对我不起作用。我已经有这个问题几个月了,但我一直拖延去解决它。我觉得问这个问题是我解决这个问题的最后希望。我真的希望有人能帮助我解决我的问题。
我有一个包含两个工作区的yarn 2工作区项目:
|-foo
\-bar
Run Code Online (Sandbox Code Playgroud)
现在,在 root 中package.json
,我引入了常见的开发依赖项:
"devDependencies": {
"@rollup/plugin-commonjs": "^14.0.0",
"@rollup/plugin-node-resolve": "^8.4.0",
"@rollup/plugin-replace": "^2.3.3",
"@rollup/plugin-typescript": "^5.0.2",
"@types/jest": "^26.0.13",
"nollup": "^0.13.10",
"rimraf": "^3.0.2",
"rollup": "^2.23.1",
"ts-jest": "^26.3.0",
"tslib": "^2.0.1",
"typescript": "^4.0.2"
}
Run Code Online (Sandbox Code Playgroud)
我现在如何轻松(无需太多样板)从 foo 和 bar 的 package.json 中的脚本引用汇总等?
示例:foo/package.json
"build": "rollup ...",
Run Code Online (Sandbox Code Playgroud)
写“../node_modules/.bin/rollup”很糟糕。
请注意,我不想在全球范围内安装汇总等。
我正在尝试使用 React Native CLI 启动 React 应用程序(也尝试使用 Expo,分别使用 Yarn 启动和 NPM 启动)。
这是 NPM 尝试使用 npm 安装样式组件时出现的错误(见下文),我已尝试完成互联网提供的所有修复,例如:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: styled-components@5.3.5
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! react@"17.0.2" from the root project
npm ERR! peer react@">=16.0" from @react-native-community/masked-view@0.1.11
npm ERR! node_modules/@react-native-community/masked-view
npm ERR! @react-native-community/masked-view@"^0.1.11" from the root project
npm ERR! 18 more (@react-native-masked-view/masked-view, ...)
npm ERR!
npm ERR! …
Run Code Online (Sandbox Code Playgroud) yarnpkg ×8
npm ×3
node.js ×2
cmd ×1
ghost-blog ×1
git ×1
jenkins ×1
lotus-notes ×1
nuxt.js ×1
react-native ×1
reactjs ×1
webpacker ×1
windows ×1
xcode ×1
xpages ×1
yarnpkg-v2 ×1