Javascript systemJS 错误找不到模块
Javascript systemJS Error Cannot find module
我有一个没有安装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);
});
我做错了什么?
我有一个没有安装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);
});
我做错了什么?