我正在从凉亭迁移到纱线,在我的bower.json文件中我有这个依赖:
Snap.svg": "snap.svg#^0.4.1
Run Code Online (Sandbox Code Playgroud)
当我尝试在纱线依赖项文件中执行相同操作时,出现此错误:
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "snap.svg@^0.4.1": Tags may not have any characters that encodeURIComponent encodes.
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
我一直在使用npm进行个人项目,最近才偶然发现纱线。在使用npm的同一项目中切换到yarn的卷装管理器是否有任何危害或“预期的副作用”?
我在单一存储库中有这个大型打字稿项目,使用yarn workspaces并lerna具有以下架构:
repo
??? API
? ??? (GraphQL API)
??? Apps
? ??? (Front-end React Apps)
??? Libs
? ??? (Shared libraries)
??? Services
??? (Back-end Services)
Run Code Online (Sandbox Code Playgroud)
我package.json看起来像:
{
...
"workspaces": [
"API/**/*",
"Apps/**/*",
"Libs/**/*",
"Services/**/*",
],
"scripts": {
"bootstrap": "lerna bootstrap",
"build": "lerna run build"
}
...
}
Run Code Online (Sandbox Code Playgroud)
我的lerna.json样子:
{
"lerna": "2.11.0",
"npmClient": "yarn",
"useWorkspaces": true,
"workspaces": [
"Libs/**/*",
"API/**/*",
"Apps/**/*",
"Services/**/*"
],
"version": "1.0.0"
}
Run Code Online (Sandbox Code Playgroud)
现在我需要Libs在两者之前构建所有共享Apps, …
运行时yarn check,我看到:
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
Run Code Online (Sandbox Code Playgroud)
GitHub评论说,可以安全地忽略该消息。
有没有办法防止它首先发生?
我们开始采用使用毛线工作区的monorepo设置,并且我们希望将Firebase函数包含在其中。回购结构类似于:
repo
node_modules <- all dependencies
packages
core
commom
functions <- firebase functions
Run Code Online (Sandbox Code Playgroud)
因此,此设置存在2个问题:
core和commom,因此从node_modules到回购软件包中的纱线符号链接。无论如何,我可以处理吗?
node.js firebase google-cloud-functions monorepo yarn-workspaces
在原始问题没有回答之后重新发布更简洁和专注的问题.在另一天的研究之后,还要对问题进行更深入的了解:
在我的app delegate(didFinishLaunching)中,我设置了一个callEventHandleron CTCallCenter.我的想法是,当callState发生变化时,我会发布一个包含userInfo dict的通知call.callState.在我看来,我观察到这个通知,当
userInfodict包含值时CTCallDisconnected,我想取消隐藏视图.
我遇到的问题是,无需担心的方面,几乎是一致的,约7秒钟.其他一切工作正常,我知道这是因为我NSLog在取消隐藏之前和之后,这些日志立即出现,但是看不见的视图仍然滞后7秒.
这是我的代码:
appDidFinishLaunching:
self.callCenter = [[CTCallCenter alloc] init];
self.callCenter.callEventHandler = ^(CTCall* call) {
// anounce that we've had a state change in our call center
NSDictionary *dict = [NSDictionary dictionaryWithObject:call.callState forKey:@"callState"];
[[NSNotificationCenter defaultCenter] postNotificationName:@"CTCallStateDidChange" object:self userInfo:dict];
};
Run Code Online (Sandbox Code Playgroud)
然后,当用户点击拨打电话号码的按钮时,我会收听此通知:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ctCallStateDidChange:) name:@"CTCallStateDidChange" object:nil];
Run Code Online (Sandbox Code Playgroud)
然后,在ctCallStateDidChange中:
- (void)ctCallStateDidChange:(NSNotification *)notification
{
NSLog(@"121");
NSString *callInfo = [[notification userInfo] objectForKey:@"callState"];
if ([callInfo isEqualToString:CTCallStateDisconnected]) {
NSLog(@"before show"); …Run Code Online (Sandbox Code Playgroud) iphone objective-c grand-central-dispatch ios core-telephony
在使用 Yarn 安装软件包时,我收到以下警告
warning Unmet peer dependency "webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc"
即使我在全球范围内安装了 webpack。
我如何抑制这个警告,或者我是否只需要在项目中安装它?
这是我的npm list -g --depth=0输出
npm list -g --depth=0
/usr/local/lib
??? bower@1.8.0
??? browser-sync@2.17.5
??? bufferutil@1.3.0
??? chai@3.5.0
??? create-react-app@1.1.0
??? emoj@0.4.0
??? handlebars@4.0.6
??? hpm-cli@2.0.0
??? http-server@0.9.0
??? jsdoc@3.4.2
??? jshint@2.9.4
??? mocha@3.2.0
??? node-gyp@3.5.0
??? node-inspector@0.12.8
??? nodemon@1.11.0
??? npm@4.4.0
??? snazzy@6.0.0
??? standard@8.6.0
??? webpack@2.2.1
??? webpack-dev-server@2.4.1
??? yarn@0.18.2
Run Code Online (Sandbox Code Playgroud)
谢谢
有人对此有经验吗?运行yarn build完成构建但永远不会退出进程,它只是挂起......当我运行时也会发生同样的事情npm run build
stars-app|master? ? yarn build
yarn build v0.27.5
$ react-scripts build
Creating an optimized production build...
Compiled successfully.
File sizes after gzip:
132.04 KB build/static/js/main.54f97667.js
24.93 KB build/static/css/main.43aab3e7.css
The project was built assuming it is hosted at the server root.
To override this, specify the homepage in your package.json.
For example, add this to build it for GitHub Pages:
"homepage" : "http://myname.github.io/myapp",
The build folder is ready to be deployed.
You may serve it …Run Code Online (Sandbox Code Playgroud) 如何在ubuntu中安装0.27.5版纱线?因为最新的纱线版本是1.2.1.
我已经解决了:
warning " > react-native@0.54.3" has incorrect peer dependency "react@^16.3.0-alpha.1".
Run Code Online (Sandbox Code Playgroud)
我只是编辑 package.json 依赖项:
...
"react": "^16.3.0-alpha.1",
...
Run Code Online (Sandbox Code Playgroud)
并跑了yarn。
但是我该如何解决以下警告:
warning "react-native > metro > @babel/plugin-check-constants@7.0.0-beta.38" has incorrect peer dependency "@babel/core@7.0.0-beta.38".
warning "jest-expo > babel-jest@22.4.3" has unmet peer dependency "babel-core@^6.0.0 || ^7.0.0-0".
Run Code Online (Sandbox Code Playgroud)
我的纱线版本是 1.5.1
我的整个 package.json:
{
"name": "#######",
"version": "0.1.0",
"private": true,
"devDependencies": {
"jest-expo": "^25.1.0",
"react-native-scripts": "^1.11.1",
"react-test-renderer": "^16.2.0"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": …Run Code Online (Sandbox Code Playgroud) yarnpkg ×8
npm ×4
node.js ×2
webpack ×2
bower ×1
build ×1
firebase ×1
ios ×1
iphone ×1
javascript ×1
lerna ×1
monorepo ×1
objective-c ×1
react-native ×1
reactjs ×1
typescript ×1
ubuntu ×1