我对 Angular 2 和 TypeScript 还很陌生。我正在使用 AngularCLI 和 NPM 创建我的 Angular 项目。我已经使用 NPM 将 quill 节点模块安装到我的项目中。我现在正在尝试创建一个组件,在其中我可以通过他们的 API 自定义我的鹅毛笔编辑器。
我正在尝试使用:
import * as Quill from 'quill';
这将返回“找不到鹅毛笔模块”错误。
我已经添加了
"": "0.0.26",
"quill": "^1.0.4",
package.json 作为依赖项。
我尝试在使用以下命令生成的宠物 Angular CLI 项目中重现您的问题ng new
命令,效果很好。这是代码:
import { Component } from '@angular/core';
import * as Quill from 'quill';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app works!';
ngOnInit() {
console.log(Quill);
}
}
And here's the output I get:
Image Link https://i.stack.imgur.com/8a7mn.png
转到您的项目node_modules
文件夹并查找名为的文件夹quill
,反正就算有,删掉node_modules
文件夹并运行npm i
再次命令
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)