npm run dev:h5, 编译没报异常,但 访问 http://localhost:8080/ 是 Cannot GET /
Taro v0.0.63 和 Taro v0.0.60 都有这个问题, 访问 本机 ip 和 127.0.0.1,问题依旧, 没有更改 config/ 里的文件 运行 npm run build:h5 是正常的, 项目为 非 typescript , 系统 win7 64bit 以下为编译信息: $ npm run build:h5 -- --watch
[email protected] build:h5 C:\git\weapp taro build --type h5 "--watch"
👽 Taro v0.0.63
开始编译项目 js
监听文件修改中...
Listening at http://192.168.10.244:8080/ Listening at http://localhost:8080/
以下为 chrome network 里的信息:
Request URL: http://localhost:8080/ Request Method: GET Status Code: 404 Not Found Remote Address: 127.0.0.1:8080 Referrer Policy: no-referrer-when-downgrade
v0.0.64也发现这个问题
是 taro init 直接创建的 js 项目么
是的
➜ myApp git:(master) ✗ taro --version
👽 Taro v0.0.70
0.0.70
➜ myApp git:(master) ✗ npm --version
5.6.0
同样的问题。
{
"name": "myApp",
"version": "1.0.0",
"private": true,
"description": "foo",
"main": "index.js",
"scripts": {
"build:weapp": "taro build --type weapp",
"build:h5": "taro build --type h5",
"dev:weapp": "npm run build:weapp -- --watch",
"dev:h5": "npm run build:h5 -- --watch",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "MIT",
"dependencies": {
"@tarojs/components": "^0.0.70",
"@tarojs/router": "^0.0.70",
"@tarojs/taro": "^0.0.70",
"@tarojs/taro-h5": "^0.0.70",
"@tarojs/taro-weapp": "^0.0.70",
"nervjs": "^1.3.0"
},
"devDependencies": {
"@tarojs/cli": "^0.0.70",
"@tarojs/plugin-babel": "^0.0.70",
"@tarojs/plugin-csso": "^0.0.70",
"@tarojs/plugin-sass": "^0.0.70",
"@tarojs/plugin-uglifyjs": "^0.0.70",
"@tarojs/webpack-runner": "^0.0.70",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-eslint": "^8.2.3",
"eslint": "^4.19.1",
"eslint-config-taro": "^0.0.70",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-taro": "^0.0.70",
"typescript": "^2.9.2"
}
}
10.14 Beta (18A336e) Developer beta 4
今天刚下载taro尝试,先是跑了一次 sudo npm run dev:weapp,然后再sudo npm run dev:h5, 也是这个问题
@tvxqljw 你下的是啥版本
同上, 「先是跑了一次 sudo npm run dev:weapp,然后再sudo npm run dev:h5, 也是这个问题」
@Nexoi 版本多少,其次,为什么要加 sudo
@luckyadam 没加 sudo,版本是: npm 6.4.1 taro 1.0.0-beta.23
@Nexoi 编译过程截个图看看咯~ 其次看看直接用 ip 地址能不能访问,有可能是 hosts 文件的问题
@luckyadam 编译结果:
> [email protected] dev:h5 /Users/neo/Projects/VSCodeProjects/lihezaiwu
> npm run build:h5 -- --watch
> [email protected] build:h5 /Users/neo/Projects/VSCodeProjects/lihezaiwu
> taro build --type h5 "--watch"
👽 Taro v1.0.0-beta.23
开始编译项目 lihezaiwu
创建 发现文件 src/app.css
创建 发现文件 src/app.js
创建 发现文件 src/index.html
创建 发现文件 src/pages/index/index.css
创建 发现文件 src/pages/index/index.js
🙅 Compile failed!
./.temp/app.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Couldn't find preset "es2015" relative to directory "/Users/neo/Projects/VSCodeProjects"
at Array.map (<anonymous>)
ℹ️ Listening at http://10.21.113.59:8080/
ℹ️ Listening at http://localhost:8080/
btw, dist 文件夹是空的。。
@Nexoi 你有加 es2015 这个 preset 么
曾经遇到过,我是因为开VPN倒是,可以检查下关掉VPN试下
我也遇到了,通过yarn add --dev babel-preset-env解决