[英]I can not run in the single `.js` file, if there is the `import xxx from xxx`
I can not run in the single .js
file, if there is the import xxx from xxx
. 如果存在
import xxx from xxx
,则无法在单个.js
文件中运行。
I use the single file to debug the imported ts_config
, how can I do this in WebStorm? 我使用单个文件调试导入的
ts_config
,如何在WebStorm中执行此操作?
EDIT-1 编辑1
The configuration choices are bellow: 配置选项如下:
Tell me how to do with this? 告诉我该怎么做?
You are using older version of nodejs
and import
keyword is not supported in v6.6. 您使用的是旧版本的
nodejs
,而nodejs
不支持import
关键字。 Please use version 8 or above for import
keyword to work without using any transpiler like babel. 请使用版本8或更高版本的
import
关键字来工作,而无需使用任何翻译工具,例如babel。
The functionality you are trying to use is part of the ES Modules
specification. 您尝试使用的功能是
ES Modules
规范的一部分。
However, ES Modules
are NOT stable in Node.js
as of version v9.9.0
, and should not be used in production. 但是,从
v9.9.0
版本v9.9.0
, ES Modules
在Node.js
中v9.9.0
,因此不应在生产中使用。 This functionality is under development, and expected to be stable-released with Node.js v10.0.0
. 此功能正在开发中,预计将随
Node.js v10.0.0
一起稳定发布。
Right now, you can do: 现在,您可以执行以下操作:
const ts_config = require('./tsconfig.json);
Are you exporting your tsConfig? 您要导出tsConfig吗?
export default
{
// json here...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.