I am using vue-cli (6.3.0), node (10.8.0) and npm (6.3.0) and have set up a basic project using this tutorial Build your first vue.js components I came to add vue-awesome
$ npm install vue-awesome
$ npm install
and I can see that vue-awesome has been added to package.json
I have a file componets/rating.vue
<template>
<div>
<ul>
<li><icon name="star"/></li>
<li><icon name="star"/></li>
<li><icon name="star"/></li>
<li><icon name="star-o"/></li>
<li><icon name="star-o"/></li>
</ul>
<span>3 of 5</span>
</div>
</template>
<script>
import 'vue-awesome/icons/star'
import 'vue-awesome/icons/star-o'
import Icon from 'vue-awesome/components/Icon'
export default {
components: { Icon }
}
</script>
and main.js is,
import Vue from 'vue'
import App from './App'
import router from './router'
import Rating from './components/Rating'
Vue.config.productionTip = false
new Vue({
el: '#app',
router,
template: '<Rating/>',
components: {
Rating
}
})
npm run dev
gives me this error,
ERROR Failed to compile with 1 errors
7:11:40 PM
This dependency was not found:
vue-awesome/icons/star-o in ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/Rating.vue
To install it, you can run: npm install --save
vue-awesome/icons/star-o
So I ran $ npm install --save vue-awesome/icons/star-o
this gives me
npm ERR! code ENOLOCAL npm ERR! Could not install from
"vue-awesome/icons/star-o" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in: npm ERR!
/Users/shanegibney/.npm/_logs/2018-08-15T18_18_10_343Z-debug.log
Any help on what might be causing this would be very much appreciated,
Thanks
you can use regular/star :
<v-icom name='regular/star'></v-icon>
Related
i tried to use Active Reports in Angular 8 and i did all the steps needed from this website,https://www.grapecity.com/activereportsjs/docs/GettingStarted/QuickStart/QuickStart-Angular
Still i get this error when i try to compile my app :
ERROR in The target entry-point "#grapecity/activereports-angular" has missing dependencies:
- rdlx-model
- #grapecity/ar-js-viewer/ExportPanel
- #grapecity/viewer-core
- #grapecity/ar-js-viewer
- #grapecity/viewer-core/features/search
and this is my code :
In App.Component.Html
gc-activereports-viewer [height]="height" [availableExports]="availableExports" (documentLoaded)="onDocumentLoaded($event)" #reportviewer></gc-activereports-viewer
In App.Module.Ts
import { BrowserModule } from '#angular/platform-browser';<br />
import { NgModule } from '#angular/core';<br />
import { ActiveReportsModule } from '#grapecity/activereports-angular';
import { AppComponent } from './app.component';
#NgModule({<br />
declarations: [<br />
AppComponent<br />
],<br />
imports: [
BrowserModule,
ActiveReportsModule
],
providers: [],
bootstrap: [AppComponent]
})<br />
export class AppModule { }
In App.Component.Ts
i used the exact same Code from the website.(Grapecity.com)
and the rest of the steps;
i used to run this Command as adminstrator **npm install #grapecity/activereports-angular** and it didn't work either
**CMD page shows me this message :
**<br /> D:\Angular Projects\Reporter-so> npm install #grapecity/activereports-angular<br />
npm WARN #grapecity/activereports-angular#1.1.0 requires a peer of #angular/common#^7.0.0 || ^8.0.0 but none is installed. You must install peer dependencies yourself.<br />
npm WARN #grapecity/activereports-angular#1.1.0 requires a peer of #angular/core#^7.0.0 || ^8.0.0 but none is installed. You must install peer dependencies yourself.<br />
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.2 (node_modules\fsevents):<br />
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
Write this code in tsconfig.app.json
"angularCompilerOptions": {
"enableIvy": false
}
I try to run the following to build my project for production and receive the error as stated in the subject:
ng build --prod
When I look in the core.d.ts file, it cannot find the following:
"./src/change_detection/differs/default_iterable_differ";
"./src/profile/profile";
"./src/util/decorators";
The following is the entire file:
/**
* Generated bundle index. Do not edit.
*/
export * from "./index";
export {
APPLICATION_MODULE_PROVIDERS as ɵangular_packages_core_core_l,
_iterableDiffersFactory as ɵangular_packages_core_core_i,
_keyValueDiffersFactory as ɵangular_packages_core_core_j,
_localeFactory as ɵangular_packages_core_core_k
} from "./src/application_module";
export {
_appIdRandomProviderFactory as ɵangular_packages_core_core_f
} from "./src/application_tokens";
export {
DefaultIterableDifferFactory as ɵangular_packages_core_core_g
} from "./src/change_detection/differs/default_iterable_differ";
export {
DefaultKeyValueDifferFactory as ɵangular_packages_core_core_h
} from "./src/change_detection/differs/default_keyvalue_differ";
export {
ReflectiveInjector_ as ɵangular_packages_core_core_c
} from "./src/di/reflective_injector";
export {
ReflectiveDependency as ɵangular_packages_core_core_d,
resolveReflectiveProviders as ɵangular_packages_core_core_e
} from "./src/di/reflective_provider";
export {
wtfEnabled as ɵangular_packages_core_core_m
} from "./src/profile/profile";
export {
createScope as ɵangular_packages_core_core_o,
detectWTF as ɵangular_packages_core_core_n,
endTimeRange as ɵangular_packages_core_core_r,
leave as ɵangular_packages_core_core_p,
startTimeRange as ɵangular_packages_core_core_q
} from "./src/profile/wtf_impl";
export {
getOrCreateChangeDetectorRef as ɵangular_packages_core_core_v,
getOrCreateContainerRef as ɵangular_packages_core_core_y,
getOrCreateElementRef as ɵangular_packages_core_core_x,
getOrCreateInjectable as ɵangular_packages_core_core_w,
getOrCreateNodeInjector as ɵangular_packages_core_core_u,
getOrCreateTemplateRef as ɵangular_packages_core_core_z
} from "./src/render3/di";
export {
bindingUpdated as ɵangular_packages_core_core_ba
} from "./src/render3/instructions";
export {
loadInternal as ɵangular_packages_core_core_bb
} from "./src/render3/util";
export {
makeParamDecorator as ɵangular_packages_core_core_a,
makePropDecorator as ɵangular_packages_core_core_b
} from "./src/util/decorators";
export { _def as ɵangular_packages_core_core_s } from "./src/view/provider";
export {
DebugContext as ɵangular_packages_core_core_t
} from "./src/view/types";
Do I run npm i decorators? If I run the following:
ng serve --disable-host-check
Correction to original post - now the project does not run at all. What happened? I have been testing this thing for over a month and, now that I am ready to go live, it just does not work at all after trying to create a dist directory. WTF?
The following is what I am seeing in the console:
TypeError: Class constructor Subject cannot be invoked without 'new'
at new EventEmitter (core.umd.js:3597)
at new NgZone (core.umd.js:3745)
at getNgZone (core.umd.js:4473)
at PlatformRef.push../node_modules/#angular/core/bundles/core.umd.js.PlatformRef.bootstrapModuleFactory (core.umd.js:4369)
at core.umd.js:4415
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:138)
at zone.js:872
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
When I run ng build I am seeing the following:
ng build --prod
Date: 2019-02-02T23:59:21.603Z
Hash: 51184dcdbc91f92a675d
Time: 3998ms
chunk {0} runtime.6afe30102d8fe7337431.js (runtime) 1.05 kB [entry] [rendered]
chunk {1} styles.42d170ae18051bd9f923.css (styles) 177 kB [initial] [rendered]
chunk {2} polyfills.03b06938f23b8f1cb153.js (polyfills) 130 bytes [initial] [rendered]
chunk {3} main.541dbdbf0b123b4c3be8.js (main) 128 bytes [initial] [rendered]
ERROR in Couldn't resolve original symbol for ./src/util/decorators from /Applications/MAMP/htdocs/oshop/node_modules/#angular/core/core.d.ts
BTW, now in app.module.ts, it cannot find module for HttpClientModule or HTTP_INTERCEPTORS
Cannot find module '#angular/common/http'
When I try to re-install #angular/common:
sudo npm i -g #angular/common^6.1.10
npm ERR! code ENOLOCAL
npm ERR! Could not install from "#angular/common^6.1.10" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/tam3/.npm/_logs/2019-02-03T02_29_27_361Z-debug.log
But it is in the package.json:
"devDependencies": {
"#angular-devkit/build-angular": "~0.7.0",
"#angular/cli": "~6.1.0",
"#angular/common": "~6.1.10",
"#angular/compiler-cli": "^6.1.0",
"#angular/core": "^6.1.10",
WTF, I followed a post that suggested all I had to do was to trash the node_modules directory, followed by npm install and it would reinstall everything. What can I do? I literally was ready to go live today
Thanks in advance
I was able to solve this issue, by solving various other issues, that I pointed out in another post that I made on stackoverflow
First, I had to make sure that the npm(s) were no longer being installed in .npm-global, which I had done to get around no longer typing sudo before every/any install, but that came at a price, which I outline in the aforementioned post.
Second, I followed a couple of other posts on stackoverflow that instructed me to change my dependencies in the package.json file to the following:
"rxjs": "6.0.0",
"typescript": "^2.7.2",
Followed by deleting the node_modules directory, then do an npm install, but this only worked because my npm installs were no longer being installed in ~/.npm-global.
Also, as I stated in the other post, the build is still not working, but that is because there are so many other errors that I have to resolve going forward, but at least this issue is out of way and my system is back to where it was before this error popped up.
These are some of the errors moving forward that I am referring to:
Property 'value' does not exist on type 'HTMLElement'
Property 'shoppingCart' does not exist on type {}
I got below error, try adding signature to my angular 6 project
node module : - angular-signature-pad
error: - ERROR in src/app/app.module.ts(5,41): error TS2307: Cannot find module 'angular-signature-pad'.
Things to check?
1) Did you install the package ?
npm install angular-signature-pad --save
2) Import the package in app module.
import { AngularSignaturePadModule } from 'angular-signature-pad';
#NgModule({
imports: [
...
AngularSignaturePadModule.forRoot()
]
...
})
export class AppModule { }
Maybe possibility, It may not be working in angular 4 plus.
https://github.com/BioPhoton/angular-signature-pad/issues/2
try updating node.js to version 16+
or
update angular cli
ng update #angular/cli #angular/core
I have two questions. I am completing a project from the book "Learning to Program", and am a little confused as to why npm is not installing, and why I am receiving another error message. I'm using Windows, I have installed node.js (v0.12.2) and have attempted to install grunt: npm install -g grunt-cli
Question 1 - When I try to install npm, it does not list all of the dependencies defined in package.json.
The following shows when I try to install npm in my main directory:
C:\Users\Me\My Documents\kittenbook\npm install
npm WARN package.json kittenbook#0.0.1 No description
npm WARN package.json kittenbook#0.0.1 No repository field
npm WARN package.json kittenbook#0.0.1 No README data
From what I see, it's supposed to display a bunch of lines after those three warnings, such as:
npm http GET https://registry.npmjs.org/grunt-contrib-concat
npm http GET https://registry.npmjs.org/grunt
npm http GET https://registry.npmjs.org/grunt-contrib-copy
and so on.
Question 2:
This is probably because installing npm is not working correctly, but when I try to run "grunt jshint" it gives me this error:
>> Local Npm module "grunt-contrib-.copy" not found. Is it installed?
Running "jshint:files" (jshint) task
>> 2 files lint free
Done, without errors.
Sorry for this very unorganized question, but I am very new to programming and I am very confused as to where the problem is.
Here is some more information.
Gruntfile.js
module.exports = function(grunt) {
// Project configuration
grunt.initConfig({
concat: {
release: {
src: ['js/values.js', 'js/prompt.js'],
dest: 'release/main.js'
}
},
copy: {
release: {
src: 'manifest.json',
dest: 'release/manifest.json'
}
},
jshint: {
files: ['js/values.js', 'js/prompt.js']
}
});
// Load Grunt plugins
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib.copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
// Register Tasks
grunt.registerTask('default', ['jshint', 'concat', 'copy']);
};
package.json
{
"name": "kittenbook",
"version": "0.0.1",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-jshint": "~0.6.3",
"grunt-contrib-copy": "~0.5.0"
}
}
If you need other information I will gladly get it to you. Thank you all so much for your help.
grunt-contrib.copy should be grunt-contrib-copy (use dash, not period)
I get the following error when running gulp test:
Error: Please run node with the --harmony flag!
Here is my gulp task:
var jest = require('gulp-jest');
gulp.task('test', function() {
return gulp.src('src/**/__tests__').pipe(jest({
rootDir: 'src',
scriptPreprocessor: '../node_modules/6to5-jest',
unmockedModulePathPatterns: [ 'react' ]
}));
});
To reproduce: https://github.com/SEEK-Jobs/react-playground
Note that npm test works properly (test is failing as expected), but gulp test fails with the error above. Both npm test and gulp test have the same config object:
{
rootDir: 'src',
scriptPreprocessor: '../node_modules/6to5-jest',
unmockedModulePathPatterns: [ 'react' ]
}
What am I doing wrong?
As far as I can tell the error is thrown from jest-cli.
The reason you don't get it with npm test is that you probably configured npm to run the jest bin script directly, which uses harmonize to programmatically set the --harmony flag.
You can fix by installing harmonize and putting require('harmonize')() in your gulpfile.
It was a bug in gulp-eslint, and it is fixed now in version 0.3.0.