问题描述
我在monorepo项目中构建新的NativeScript-Vue应用程序时遇到问题。 capabilities(7)在这里。
情况
我想使用yarn工作区在Vue.js Web应用程序和NativeScript-Vue本机应用程序之间共享一些代码。我看过一些NativeScript Slack帖子,建议使用yarn工作区。据我了解,setuid进行代码共享在这里不再是一种选择。
在GitHub存储库中,我创建了packages/common
,packages/web
和packages/native
,并在web
中启动了一个新的vue项目,并在{{1 }}。
问题
通过运行native
,我可以在web
文件夹中运行Web应用程序,但是通过运行npm run serve
,不能在native
文件夹中运行NativeScript应用程序。错误提示symlink不适用于未发布的软件包:
ns run ios
...但是我在% tns run ios
Error while loading nativescript-cloud is: Default commands should be required before child commands
Searching for devices...
npm ERR! code ETARGET
npm ERR! notarget No matching version found for common@1.0.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'native'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mm/.npm/_logs/2020-10-16T05_08_56_467Z-debug.log
Unable to install dependencies. Make sure your package.json is valid and all dependencies are correct. Error is: Command npm Failed with exit code 1
下有一个名为common
的文件夹,已链接到/node_modules
。在/packages/common
中删除行"common":"1.0.0",
可以使我构建应用程序,但这扼杀了我在此处试图实现的代码共享的全部目的。
问题
我在做什么错了?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)