How to remove Perl6 package installed by Panda - raku

I was just wondering how one might uninstall a Perl6 package installed by Panda, as it seems to be missing the 'remove' or 'uninstall' command.
Thank you!

As of today, you cannot remove a package with panda; the alternate package manager zef does support this, however.
https://github.com/ugexe/zef

I forget where I found this code for removing something installed via Panda, but it works amazingly.
#!/usr/bin/env perl6
use v6.c;
sub MAIN($short-name, :$ver = True, :$auth = True, :$api = True) {
my $comp-unit = $*REPO.resolve(CompUnit::DependencySpecification.new(:$short-name, :$ver, :$auth, :$api));
$comp-unit.repo.uninstall($comp-unit.distribution);
}

Related

Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class in angular 8 [duplicate]

This question already has answers here:
error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class
(33 answers)
Closed 2 months ago.
ERROR in node_modules/#angular/common/http/http.d.ts:2801:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class
2801 export declare class HttpClientModule {
restart your server...
terminate server for windows
ctrl + C
start again
ng serve
I had the same issue.
I was going through comments here https://github.com/angular/angular/issues/35399 for solution.
I simple ran ng serve --prodand the error was gone. After that I even ran ng serve.
Other solutions proposed are
Ensure that the tsconfig.json of your library has set "importHelpers": true
Add "enableIvy": false to compilerOptions in tsconfig.app.json
Adding "postinstall": "ngcc" to scripts: {...} in package.json then run npm run postinstall solved problem.
if you still want to keep the Anuglar Ivy and AOT advantage
Simply restart the server (press ctrl+c on the prompt) and then, run ng serve again.
I had the same issue. Then I realized that previously I've some changes in app.module.ts Every time you made changes in app.module.ts remember restart the server process.
I had the same issue. I was adding service to module i.e. app.module.ts's imports array instead of adding it to the providers array.
app.module.ts
#NgModule({
imports: [
MyService // wrong here
],
providers: [
MyService // should add here
]
})
export class EventsModule { }
For me I had a Pipe declared in my 'imports' in my module. Apparently many things can produce this error. I do not suggest you disable IVY, as that is not the problem.
Setting "aot": false inside angular.json file worked for me.
I terminated the current build and restarted it again.
i.e ng serve solved my error. Hope it helps.
In my case, I had included HttpClientModule run running the Angular server.
The below solution works best for my case
Just Close the Server, and reopen it.
It will work.
Working within an NX workspace I just came across this issue.
After a lot of searching I realised that the internal library that I just created had by default Ivy turned off.
I do have it on everywhere else. And yes, even for my libraries. They're only internal to the monorepo we don't expose any of them so we don't want to have an extra step to compile them with the deprecated view engine instructions and later on run ngcc onto it to turn that into Ivy code.
Conclusion: I just forgot to set
"angularCompilerOptions": {
"enableIvy": true
}
on my newly created library and the default is false which wasn't working in my case.
I had same issue in ubuntu. But when I used sudo bash command and executed ng serve. It resolve the issue
I had the same problem, it seems like there is a lot of ways to trigger the problem. I recommend trying to verify the .component, .module and the app.module declarations. Mine was triggered because I've declared the .component in app.module instead of the .module.
This happened to me in VSCode with another module after installing it with npm install. This is most likely related to how the Angular language service extension works and the quickest way to solve it was to restart the IDE.
this problem caused by angular extension and snippets in vscode
be careful not to install obsolete extensions like Angular Extension Pack and Angular Language Service
enter image description here

How can I use react-error-overlay outside create-react-app?

I want to use react-error-overlay package from create-react-app outside the create-react-app.
But it doesn't provide any document about how to apply it.
Does anyone know how to make that happened?
Thanks
Install the react-error-overlay package via npm
Add a require.resolve to your app entry point array
app: [
require.resolve('react-error-overlay'),
'./src/app/'
],
Add the setup function to your webpack-dev-server configuration so you can add the middleware
setup(app) {
app.use(errorOverlayMiddleware());
}
All done
Option B - Roll back your react-error-overlay to a 1.x compatible version inside your package.json
hello just leaving a tip - if you want to just use the runtime overlay, do this: https://twitter.com/swyx/status/961413452446257152
you can also synchronously call the buildtime overlay but that is more involved and is best done using the errorOverlayMiddleware (which FYI has moved to react-dev-utils)
good luck

Multiple versions of the same package using npmjs

Anyone knows a trick to install multiple versions of the same package through npmjs ? I know it's not possible to use the same package-name in package.json but it gives you an idea of what I try to achieve:
"dependencies": {
"mypackage": "user/mypackage#v1.0",
"mypackage": "user/mypackage#v2.0"
}
At the end, I want to A/B test my package with different versions. Thanks a lot !
Based on npm discussion, this won't be implemented any time soon.
Some reference:
https://github.com/npm/npm/issues/5499
https://github.com/npm/npm/issues/2943

How to use APScheduler without installing it?

I know the normal way to use APScheduler is "python setup.py install". But I want to embed it into my program directly, so the user don't need install it when using my program.
class BaseScheduler(six.with_metaclass(ABCMeta)):
_trigger_plugins = dict((ep.name, ep) for ep in iter_entry_points('apscheduler.triggers'))
# print(_trigger_plugins, 'ddd')
_trigger_classes = {}
_executor_plugins = dict((ep.name, ep) for ep in iter_entry_points('apscheduler.executors'))
_executor_classes = {}
_jobstore_plugins = dict((ep.name, ep) for ep in iter_entry_points('apscheduler.jobstores'))
_jobstore_classes = {}
_stopped = True
thks.
You can instantiate the triggers directly, without going through their aliases. That eliminates the need to install APScheduler or setuptools. Does this answer your question?
I find a way to work around this problem.
use 'pip install apscheduler' to install locally
goto the installed directory and cp that directory to your lib directory
use 'pip uninstall apscheduler' to remove it.
make you code to import the apscheduler from your lib directory.
done.

How to change a dependency version in npm

I'm actually trying to use gulp-handlebars but I need to change handlebars version in the gulp-handlebars package. I can't find a way to do that with a command line, and I'm new to all of this stuff, so I'm asking for clear help, what files do I have to change ?
I assume that copy/paste of my good version of Handlebars in the gulp-handlebars folder wouldn't be enough (and I actually tried that).
Thanks.
It looks like gulp-handlebars is incredibly simple. It should be fairly simple to use handlebars and vinyl-map without relying on a plugin, something like:
In the terminal:
$ npm remove gulp-handlebars
$ npm install --save-dev handlebars#version-you-want vinyl-map gulp-rename
In your gulpfile.js:
var handlebars = require('handlebars'),
rename = require('gulp-rename'),
map = require('vinyl-map');
// ... in your task ...
return gulp.src(...)
.pipe(map(function(contents) {
return handlebars.precompile(contents.toString() /*, options */);
})
.pipe(rename({ extname: '.js' }))
.pipe(gulp.dest(...));
I haven't test this, but it should get you going in the right direction.