tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"allowJs": true,
"noImplicitAny": false,
"baseUrl": "./src",
"module": "system",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
// "./src/typings.d.ts",
"node_modules/@types",
],
"lib": [
"es2017",
"es2015",
"dom",
"es5",
"es6",
],
},
"exclude": [
"node_modules"
]}
.angular-cli.json app.scripts[0] = "../node_modules/json-rpc-protocol/dist/index.js";
答案 0 :(得分:-2)
如果您尝试使用Google搜索...
在编译时,编译器不了解require。 将其声明为:
declare const require: any
应该有帮助。