简体   繁体   English

不适用于“package.json”中的“type”:“module”

[英]Does not work with “type”: “module” in “package.json”

i run npm start我运行 npm 启动

get the error得到错误

(node:1079) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
/Users/sangkuoh/Desktop/Udacity_FEND_TravelApp-master/src/server/server.js:61
export default { app };
^^^^^^

why this don't work?为什么这不起作用? :) :)

Add添加

"type": "module"

in your package.json在你的package.json

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么“类型:模块”在 package.json 文件中? - Why is 'type: module' in package.json file? 尽管在 package.json 中声明了“type”:“module”,但仍会发生错误 - Despite "type": "module" declaration in package.json the error occurs 当我将 tsconfig.json 中的“模块”更改为“ESNext”并将 package.json 中的“类型”更改为“模块”时,出现错误 - When I change "module" in tsconfig.json to 'ESNext' and "type" in package.json to 'module', I get an error 要加载ES模块,请在package.json中设置“type”:“module”或使用.mjs扩展名 - To load an ES module, set "type": "module" in the package.json or use the .mjs extension Typescript - 警告:要加载 ES 模块,请在 package.json 中设置 "type": "module" 或使用 .mjs 扩展名 - Typescript - Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension 即使我在 package.json 中有 '"type": "module"' 也得到“不能在模块外使用 import 语句” - Getting "Cannot use import statement outside a module" even if I have '"type": "module"' in package.json Index.js 文件错误警告:要加载 ES 模块,请在 package.json 文件中设置“类型:”模块“ - Index.js file error Warning: to load an ES module, set “type: ”module" in the package.json file npm 安装不起作用,因为某些 package 不包含 package.Z466DEEC76ECDF35FCA6DZ485D 文件 - npm install does not work because certain package does not contain a package.json file WebStorm:模块未在 package.json 依赖项中列出 - WebStorm: Module is not listed in package.json dependencies 错误:找不到模块“../../package.json” - Error: Cannot find module '../../package.json'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM