我有一个小项目,我已经安装了systemJS。
下面是package.json:
{
"name": "mytest",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^15.5.4",
"react-dom": "^15.5.4",
"systemjs": "^0.20.13"
},
"devDependencies": {
"react-scripts": "1.0.7"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}在app.js中,我这样做了:
import React, { Component } from 'react';
import './App.css';
var SystemJS = require('systemjs');当我运行这个项目时,它给了我这个错误:
错误:找不到模块“。
我按照这里的说明操作:
https://github.com/systemjs/systemjs
这部分:
var SystemJS = require('systemjs');
// loads './app.js' from the current directory
SystemJS.import('./app.js').then(function (m) {
console.log(m);
});我做错了什么?
https://stackoverflow.com/questions/44541812
复制相似问题