javascript - 本地主机无法显示在 javascript 中创建的输出映射
问题描述
这个来自 openlayers 的研讨会文件
https://openlayers.org/workshop/en/basics/
包含一个例子。我试图让它运行,但尽管两者
npm start
npm run build
运行成功,但是当我访问本地主机时“请查看附件图像”
http://localhost:3000/
或者
http://localhost:1234/
什么都不能显示。请让我知道如何解决这个问题
包.json
{
"name": "app6",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "parcel index.html",
"build": "parcel build --public-url . index.html"
},
"author": "",
"license": "ISC",
"dependencies": {
"ol": "^6.5.0"
},
"devDependencies": {
"parcel-bundler": "^1.12.5"
} }
图片
解决方案
不要停止这个过程。
npm start
然后让服务器运行(nicht abbrechen)并转到:
http://localhost:1234/
如果你运行:
npm run build
您必须将构建文件夹复制到服务器才能运行。
推荐阅读
- excel - 从 ssrs 更改 excel 中选项卡的名称
- django - 需要知道批量导入的问题在哪里以及如何解决它
- django - 姜戈。“python manage.py 运行服务器
: “获取”资源( ) 在线,但没有响应连接尝试。”在 chrome 上 - qt - QT socket无法连接,但是hercules app可以连接
- python - 使用 Paramiko 或其他 Python 库通过 SSH 跳转服务器远程登录网络设备
- mysql - 比较两个 mysql-database 转储的内容并生成补丁 sql 文件
- r - Shiny 如何将文本放在页面底部
- reactjs - 在 React 样式的组件中使用 SVG 作为输入范围拇指背景
- angularjs - 容器上下文中的 Angular 使用函数
- c# - xgettext 工具无法使用 C# 和 NGettext 库提取带有上下文的字符串